-
vimrc
基本的 Vim 配置
(插件的配置分开存放在.pack目录里) -
gvimrc
GVim 的专属配置 -
pack
用 Vim 8 原生的 packages 特性加载插件-
pack/xxx/start/下的插件 yyy 会在打开 Vim 时自动加载
(不过插件里的 autoload 目录依然会按需实时加载,所以插件放在start里也不会明显拖慢 Vim 的启动) -
pack/xxx/opt/下的插件 zzz 则需要在 Vim 里执行命令:packadd zzz后才会被加载然后可以对插件进行分类分目录存放
比如appearance目录里存放了外观相关的插件
-
-
.pack
(可以自己写 脚本 方便下载、更新插件)
我这里用了别人写好的脚本 pack
这个目录存放了 pack 的配置信息:packfile
用 pack 安装插件时添加的参数都会保存在这个文件里
所以只要保留了这个文件,执行命令pack install就可以把所有插件装回来xxx-yyy.vim
通过pack config xxx/yyy命令添加的插件配置将保存在这个文件
(并且会自动调用pack generate命令,把全部xxx-yyy.vim文件整合成一个文件plugin/_pack.vim)
-
plugin
执行pack generate命令(一般会被自动执行)将把.pack目录里的各插件配置文件合并成plugin下的_pack.vim -
install.sh
一键安装脚本(不包括rg等安装过程跟系统相关性较大的前置依赖) -
swap
统一存放所有交换文件,避免污染项目目录 -
spell
存放 拼写检查 添加的字典文件 -
session
存放 session 文件 -
UltiSnips
存放自定义的snip文件 -
undo-history
存放所有文件的可持久undo历史
(可持久指退出后再进来依然保持) -
globalrc
Gtags 的配置文件
-
mhinz/vim-startify
Provides a start screen to show recently used or bookmarked files and persistent sessions. -
tpope/vim-unimpaired
[b/]bto navigate between buffers.
[t/]tto navigate between tabs.
[f/]fto navigate between files in current file's directory alphabetically.
[<Space>/]<Space>to add[count]blank lines before/below the cursor.
[e/]eto exchange the current line with[count]lines above/below it.
[p/]pto paste before/after linewise.
=p/=Pto paste before/after linewise, reindenting. -
tpope/vim-eunuch
:Deleteto delete a file on disk and the buffer too.
:Removeto delete a file on disk but keep the buffer.
:Move/:Rename/:Copyto rename a buffer and the file on disk simultaneously.
:Chmodto change the permissions of the current file.
:Mkdirto create a directory, defaulting to the parent of the current file.
:Wall/:Wto write every open window instead of buffers.
:SudoWrite/:SudoEditto write/edit a privileged file with sudo.
Typing a shebang line causes the file type to be re-detected, and the file will be automatically made executable (chmod +x) after the next write. -
kana/vim-submode
Create your own submode keymaps.
For example,<C-w><<<to resize split window quickly. -
rhysd/devdocs.vim
<leader>Kto search the word under cursor in devdocs.io.
:DevDocs [query]to search query with filetype related documentations. -
mattn/webapi-vim
An interface to web APIs. This plugin is depended by vim-gists.
-
sheerun/vim-polyglot
A bundle of hundreds of vim plugins:
Provides syntax and indentation support (no other features) for almost all commonly used languages.
Automatically detects indentation (optimized version of vim-sleuth). -
honza/vim-snippets
This repository contains snippets files for various programming languages. -
mlaursen/vim-react-snippets
A collection of common Javascript and Typescript snippets for developing React. -
neoclide/coc.nvim
A LSP client that can load js extensions like VSCode.
<C-k/j>to navigate between diagnostics,<C-y>to auto fix the current diagnostic.
<C-]>to jump to the definition of current symbol,<C-t>to jump back in the tag stack.
<leader>tr/tu/tt/tito jump to the references/references-used/type-definition/implementation of current symbol.
Kto show the documentation of current symbol.<F2>to rename the current symbol.
<leader>thto switch between the implementation file and it's corresponding header file.
<leader><leader>tto toggle the tagbar.
:SnipFilesto view/edit available snippets files for the current file/filetype.
:SnipUserto edit the user snippets file under~/.config/cocfor the current filetype.
<C-j>/<C-k>to jump between placeholders of a snippet.
<leader>mdto open a real-time preview page of the current markdown file. -
dense-analysis/ale
A LSP client that focused on integrating with external linters.
It supports many filetypes by default, so it's a good supplement to CoC. -
lervag/vimtex
A modern filetype and syntax plugin for LaTeX files. -
HealsCodes/vim-gas
Advanced syntax highlighting for GNU asm files.
-
easymotion/vim-easymotion
It takes the<num>out of<num>f{char}by highlighting all possible choices and allowing you to press one key to jump directly to the target.
<leader>f{char}to jump to any{char}in the screen directly.
<leader>j/kto jump to any line in the screen directly. -
lambdalisue/fern.vim
-to open a file tree viewer on the parent directory of the current buffer in the current window, i.e. netrw style.
<Leader><Leader>fto open a project drawer in the sidebar, i.e. nerdtree style.
In the viewer:
h/j/k/lto navigate between files/directories,p/<C-p>to preview the file under cursor.
-or<CR>to change the root node to the parent or the selected children node.
<leader>qor:bdto close the netrw style viewer. -
junegunn/fzf
As a vim plugin, this repo provide some core integration functions:fzf#runandfzf#wrap. -
junegunn/fzf.vim
This repo is a bundle of fzf-based commands and mappings, such asRg. -
antoinemadec/coc-fzf
This plugin uses fzf in place of Coc's built-in CocList sources as well as Coc's jumps (definition, reference etc).
CocFzfListis a drop-in replacement ofCocList, you can alsoadd_list_sourcefor other useful commands.
Mappings in config:<C-f>p/f/b/l/q/m/h/c/g/d/: -
jesseleite/vim-agriculture
RgRawprovide the ability to pass command line options torg(compared withRg).
<C-f>rto grep visual selection (in visual mode) or word under cursor (in normal mode). -
dyng/ctrlsf.vim
Similar to<C-f>r, but<C-f>wcan merge contexts of adjacent grep results. -
dkprice/vim-easygrep
<leader>vv/vrto grep/replace in the open buffers (<leader>voto change options). -
ludovicchabant/vim-gutentags
Automatically generate/update gtags database for the current project. -
skywind3000/gutentags_plus
Automatically connect gtags database for the current project.
Mappings in config:<leader>gs/gg/gd/gc/gt/ge/gf/gi/ga -
Yggdroot/LeaderF
Another fuzzy finder that similar to fzf.
Some subcommands that better than fzf are integrated intoCocFzfList. -
haya14busa/incsearch.vim
Incrementally highlights all matches, but this feature is already provided by vim 8.0.1238.
So only one keymap is left:z/to search without cursor move. -
haya14busa/is.vim
Successor of incsearch.vim (keep incsearch.vim since some plugins depend on it).
Automatically clear search highlights after cursor moved.
<C-j>/<C-k>to incrementally scroll between pages of search matches. -
haya14busa/incsearch-fuzzy.vim
Incremental fuzzy search extension for incsearch.vim.
f//f?/fz/to do fuzzy search.
ff//ff?/ffz/to do fuzzy search with the spell feature of vim. -
haya14busa/incsearch-easymotion.vim
Integration between incsearch.vim and vim-easymotion.
<Leader>//<Leader>?/<Leader>z/to search with easymotion.
<Leader><Leader>/to do fuzzy search with easymotion. -
haya14busa/vim-asterisk
Improve*/#/g*/g#motions: smartcase, work in visual mode.
z*/gz*/z#/gz#to stay cursor. -
andymass/vim-matchup
Extends vim's%motion to language-specific words.
Highlights symbols and words under the cursor which%can work on.
motions:g%/[%/]%/z%.
text objects:i%/a%. -
kshenoy/vim-signature
Manage and display marks:
mx/m.to toggle mark at current cursor.
m-/m<spacee>to delete all marks from the current line/buffer.
['/]'/'[/']/m/to navigate between marks.
-
sbdchd/neoformat
<Leader>=to format the entire buffer or visual selection with various formatters (prefer using coc-formatt). -
mg979/vim-visual-multi
To create multiple cursors:
Select words with<C-n>, or select characters with<S-Right/Left>, thenn/Nto get the next/previous occurrence,qto skip current and get the next.
Create cursors vertically with<C-Down/Up>, then[/]to select the previous/next cursor,Qto remove the current cursor/selection.
<Tab>to switch between cursor mode (similar as normal mode) and extend mode (similar as visual mode). -
gcmt/wildfire.vim
Press<Enter>in normal mode to select the closest text object.
Keep pressing<Enter>for selecting the next closest text object.
To select the previously selected text object, press<BS>.
-
wellle/targets.vim
It adds various text objects to expand the idea of built-indi'.
Pair text objects:()/{}/[]/<>.
Quote text objects:'/"/`.
Separator text objects:,/./;/:/+/-/=/~/_/*/#///|/\/&/$.
Argument text objects: similar to separator text objects, but are specialized for arguments surrounded by braces and commas.
Any text objects:nbfor any block,nqfor any quote.a ( b ( cccccccc ) d ) e │ └─── a) ───┘ │ └────── 2a) ───────┘ a ( b ( cccccccc ) d ) e │ └── i) ──┘ │ └───── 2i) ──────┘ a ( b ( cccccccc ) d ) e │ └─ I) ─┘ │ └──── 2I) ─────┘ func( xxxxxxxxx , yyyyy ) └── aa ────┘ func( xxxxxxxxx , yyyyy ) └── ia ───┘ func( xxxxxxxxx , yyyyy ) └── Ia ─┘ -
vim-sandwich
Use keymaps from vim-surround:
ys{motion/textobject}{surrounding}(orS{surrounding}in visual mode) to addsurrounding, e.g.ysiw)makesfooto(foo)(use(instead of)to add spaces).
ds{surrounding}to deletesurrounding, e.g.ds(ordssmakes( foo )tofoo(dsssearches a set of surrounding automatically).
cs{old}{new}to replaceoldwithnew, e.g.cs("orcss"makes(foo)to"foo"(cssis similar asdss). -
rlue/vim-barbaric
Keep and restore input method state for each buffer separately when leaving/re-entering insert mode.
Like always typing English in normal mode, but Chinese in insert mode. -
jiangmiao/auto-pairs
Insert/Delete in pair.
Insert new indented line after<CR>.
Insert spaces before closing characters.
Only some filetype-based characters are enabled in config. -
tpope/vim-abolish
Work with several variants of a word at once.
crsto coerce to snake_case,crcto camelCase,crmto MixedCase
cruto coerce to UPPER_CASE,cr-to dash-case,cr.to dot.case
:Abolish {despa,sepe}rat{e,es,ed,ing,ely,ion,ions,or} {despe,sepa}rat{}to produce 48iabbrev.
:%S/facilit{y,ies}/building{,s}/gwill be expanded to:%s/facility/building/g :%s/Facilities/Buildings/g :%s/FACILITIES/BUILDINGS/g
-
tpope/vim-capslock
<C-G>cin insert mode to toggle a temporary software caps lock.
gCin normal mode to toggle a slightly more permanent one. -
simnalamburt/vim-mundo
<Leader><Leader>uto visualize the Vim undo tree. -
kkoomen/vim-doge
<Leader>doto generate documentations (cursor should on the first line of function).
<C-j>/<C-k>to jump between TODO items of the documentation generated. -
junegunn/vim-easy-align
ga{motion/textobject}{align-char}(orga{align-char}in visual mode) to align selected lines with align char, e.g.gaip=orvipga=to align lines in current paragraph with=. -
tpope/vim-rsi
Get the most useful key bindings from Readline (similar to Emacs) without blindly overriding built-in Vim functionality.
<C-a>/<C-e>to jump to the start/end of current line in insert mode (similar as<Home>/<End>).
<C-b>/<C-f>to jump to the left/right char in insert mode (similar as<Left>/<Right>).
<M-b>/<M-f>to jump to the previous/next word (similar as<C- <- >/<C- -> >).
<C-d>to delete the next char in insert mode (similar as<Del>). -
tpope/vim-speeddating
<C-a>/<C-x>to increment dates, times, and more. -
tpope/vim-repeat
It remaps.in a way that plugins can tap into it.
The following plugins support it: surround.vim, speeddating.vim and unimpaired.vim. -
ojroques/vim-oscyank
<Leader>yto copy text from remote SSH sessions to the system clipboard using the ANSI OSC52 sequence. -
vim-scripts/DrawIt
<Leader>di/<Leader>dsto start/stop DrawIt mode.
In DrawIt mode, use<left>/<right>/<up>/<down>/</>/^/v/... to draw dashes/arrows.
-
mhinz/vim-sayonara
<Leader>qto delete the current buffer without closing your windows or messing up your layout.
:Qas an alternative to:q. -
vim-scripts/BufOnly.vim
:Bonlyto delete all buffers but the current one. -
mtth/scratch.vim
<Leader>sc/sCto open a unobtrusive scratch window with/without previous content.
It will also copy the selected content to the scratch window if pressed in visual mode. -
farmergreg/vim-lastplace
Intelligently reopen files at your last edit position. -
gou4shi1/GoldenView.Vim
Automatically resize the focused split window to a "golden" view based on golden ratio and textwidth. -
romainl/vim-qf
A collection of settings, commands and mappings to tame the quickfix/location window.
Quickfix buffers are hidden from:lsand buffer navigation.
Quit Vim if the last window is a quickfix/location window.
Close the location window automatically when quitting parent window.
And some commands that are only available in the quickfix/location window.
<leader><leader>lto toggle the location window.
-
voldikss/vim-floaterm
<F8>to open a new terminal in the popup window.
<F9>/<S-F9>to switch to the next/prev terminal.
<F10>to toggle the popup window. -
kassio/neoterm
:T cmdis a replacement of:term cmdthat reuse the terminal already exists.
TODO: Add keymaps for REPL. -
skywind3000/asyncrun.vim
:AsyncRun cmdto run your command asynchronously and see output in quickfix/floaterm/neoterm. -
skywind3000/asynctasks.vim
It uses a.tasksfile in your project folders for local tasks and uses~/.vim/tasks.inito define global tasks.
<F5>/<F6>/<F7>to compile/run/debug the current file in floaterm.
-
airblade/vim-gitgutter
Show git diff in the sign column.
[h/]hto jump between hunks,<leader>hp/hs/huto preview, stage, and undo hunks. -
rhysd/conflict-marker.vim
Highlight, jump and resolve conflict markers quickly.
[</]<to jump to the next/prev conflict marker<<<<<.
ct/co/cn/cb/cBto choose them/our/none/both to resolve conflicts. -
tpope/vim-fugitive
:Git/G xxxas an alternative to:!git xxxto call any arbitrary git command.
For example,:G blameto blame the current file in a scroll-bound split view,:Gto open a summary window.
Additional commands are also provided, e.g.:Gedit HEAD~3:%to load the current file as it existed 3 commits ago. -
tpope/vim-rhubarb
The GitHub extension for fugitive.vim.
:GBrowseto open the corresponding GitHub url in browser.
In commit messages, GitHub issues, issue URLs, and collaborators can be omni-completed. -
jparise/vim-phabricator
The Phabricator extension for fugitive.vim.
:GBrowseto open the corresponding Phabricator url in browser.
Syntax highlighting for Arcanist templates and configuration files.
In arc diff templates, Phabricator users and projects can be omni-completed. -
rbong/vim-flog
:Flogto view the git commit graph.
In the graph,grto toggle viewing the reflog,gbto toggle bisect mode,gqto quit. -
mattn/vim-gist
Gistto post current buffer to gist,:'<,'>Gistto post selected texts,:Gist -mto post all open buffers.
-pto create a private gist,-Pto create a public gist,-ato create anonymously. -
Eliot00/git-lens.vim
Show git blame as VS Code's GitLens plugin.
You can toggle it in the<F1>menu.
-
lifepillar/vim-solarized8
A solarized colorscheme that is optimized for true-color terminals. -
vim-airline/vim-airline
Lean & mean status/tabline for vim. -
vim-airline/vim-airline-themes
A collection of themes for vim-airline. -
jszakmeister/vim-togglecursor
Toggle the cursor shape when entering the insert mode. -
luochen1990/rainbow
Show different levels of parentheses in different colors. -
preservim/vim-indent-guides
Visually display indent levels. -
skywind3000/vim-quickui
<F1>to toggle the help menu.
pin the quickfix window to open a preview window. -
ryanoasis/vim-devicons
Adds file type icons to Vim plugins such as: NERDTree, vim-airline, vim-startify. -
lambdalisue/vim-nerdfont
A simplified version of vim-devicons which does NOT provide any 3rd party integrations in itself. -
lambdalisue/vim-glyph-palette
Universally apply colors on Nerd Fonts, e.g. vim-devicons, vim-nerdfont and vim-fern-renderer-nerdfont will be nicely highlighted.