This is a creation in Article, where the information may have evolved or changed.
Refer to the VIMRC configuration to configure the base VIMRC first. This is my previous configuration, but the use of some inconvenient, some skills are not mastered, and then a good study of vim configuration, add the following plug-in configuration, while supporting go.
I have manually added the remaining several common plugins on top of
Vim-easy-align: Quick Alignment
1.vim ~/.vim/bundles.vim, added at the end:
'junegunn/vim-easy-align'
2.vim ~/.VIM/VIMRC, End added:
vmap <Leader>a <Plug>(EasyAlign)nmap <Leader>a <Plug>(EasyAlign)if !exists('g:easy_align_delimiters') let g:easy_align_delimiters = {}endiflet g:easy_align_delimiters['#''pattern''#''ignore_groups': ['String'] }" Start interactive EasyAlign in visual mode (e.g. vipga)xmap ga <Plug>(EasyAlign)"" "forobject (e.g. gaip)nmap ga <Plug>(EasyAlign)
3. Example:
A. v mode, select the following
let g:tagbar_left=1let g:tagbar_width=30let1let0let1
B. Type GA, enter easyalign mode, hit =, will be displayed as the following equals sign:
let g:tagbar_left 1let g:tagbar_width 30let1let g:tagbar_sort 0let g:tagbar_compact 1
For more examples, refer to: https://github.com/junegunn/vim-easy-align
Multiple-cursors: Multiple cursor operation
1.vim ~/.vim/bundles.vim, added at the end:
'terryma/vim-multiple-cursors'
2.vim ~/.VIM/VIMRC, End added:
" 多光标操作 let g:multi_cursor_use_default_mapping=0" Default mapping " ctrl+m 选中一个" ctrl+p 放弃一个, 回到上一个" ctrl+x 跳过当前选中, 选中下一个" esc 退出 let g:multi_cursor_next_key='<C-m>'let g:multi_cursor_prev_key='<C-p>'let g:multi_cursor_skip_key='<C-x>'let g:multi_cursor_quit_key='<Esc>'
3. Example:
A. In the following code, the cursor pauses println any one letter, knocks several times ctrl+m, will select a few println
fmt.Println(url) fmt.Println(url.Scheme)fmt.Println(url.Opaque)fmt.Println(url.User)fmt.Println(url.Host)
B. Type C, enter print, and the selected println will be replaced with print
fmt.Print(url) fmt.Print(url.Scheme)fmt.Print(url.Opaque)fmt.Print(url.User)fmt.Print(url.Host)
Vim-cpp-enhanced-highlight:c++ Highlight
1.vim ~/.vim/bundles.vim, added at the end:
'octol/vim-cpp-enhanced-highlight'
2.vim ~/.VIM/VIMRC, End added:
let1let1
Ack
- This plugin is useful and does not need to be reinstalled and already exists. The cursor rests on a function or variable, input: Ack, and the call is automatically searched globally.
- Common commands:
?aQuick Summary ofTheseKeys,Repeat to CloseO to Open(Same asEnter) O to Open and Close theQuickfix Windowgo toPreviewfile,OpenBut maintain focusOn ack. vim results T to Open inch New TabT to Open inch New Tab withoutMoving to itH to Open inchHorizontalSplitH to Open inchHorizontalSplit, keeping focusOn the results V to Open inchVerticalSplitGv to Open inchVerticalSplit, keeping focusOn the results Q to Close theQuickfix window
Go support
- Plugin vim-go already exists, but needs to run goinstallbinaries and download some bin files. If the $gobin is configured, refer to the GO Environment installation.
- CD ~ Exit to the home, be sure to be under home, or you will get an error later.
- Terminal Vim open a file, input
:GoInstallBinaries
, enter to start the download
- If you need to update, enter
:GoUpdateBinaries
- Add configuration to highlight functions, methods, keywords, and so on go.
Vim ~/.VIM/VIMRC, added at the end:
let1let1let1let1let1let1
Reference:
Http://www.wklken.me/category/vim.html
http://vimawesome.com/
http://studygolang.com/articles/4777
https://github.com/yangyangwithgnu/use_vim_as_ide#4.1