cd ~/src
git clone https://github.com/dfang/vim.git
cd vim
./script/setup
homesick clone dfang/vim
homesick link vim
homesick clone will clone to ~/.homesick/repos, homesick link will create symbolic links
let mapleader = ","
try
,d
nmap <silent> <c-k> :wincmd k<CR>
nmap <silent> <c-j> :wincmd j<CR>
nmap <silent> <c-h> :wincmd h<CR>
nmap <silent> <c-l> :wincmd l<CR>
<Leader>d :NERDTreeToggle # to toggle NERDTree
:NERDTreeFind # reveal file in nerdtree
tips: Press
I
(Shift+i) to toggle hidden files in the NERDTree explorer window.
nmap <Leader>f :GFiles<CR>
nmap <Leader>F :Files<CR>
nmap <Leader>b :Buffers<CR>
nmap <Leader>h :History<CR>
https://towardsdatascience.com/how-i-learned-to-enjoy-vim-e310e53e8d56
先选中需要操作的行 比如 v3j 然后执行相应的操作
<leader>ci NERDCommenterInvert
<leader>cc NERDCommenterComment
<leader>cu NERDCommenterUncomment
关于注释代码: 记住
<leader>ci
就够了,如果没有安装nerdcommenter,那就用vim原始模式: 先ctrl+v进入列选模式,I插入注释符,快速按ESC
先选中需要操作的行 vip (visually select inner paragraph) ga = 按等号对齐
ga -> CTRL + X -> 输入正则
set paste
:set fdm?
:set fdm=marker
za
:%!jq .
:%!python -m json.tool
ggvG
gg=G
[h jump to previous hunk
]h jump to next hunk
:Startify
:GBrowse
:GitGutterToggle
:GitGutterNextHunk
:GitGutterPrevHunk
:GitGutterStageHunk
https://github.com/dfang/vim/blob/master/docs/tips
-
https://github.com/tpope/vim-sensible/blob/master/plugin/sensible.vim
sensible defaults
-
https://github.com/tpope/vim-sleuth
no need to set buffer options like tabstop, shiftwidth, expandtab, etc
-
https://github.com/airblade/vim-gitgutter
display git diff markers(gutter) in the sign column