Relive VIM's configuration: Support Go

Source: Internet
Author: User
Tags ack
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

    1. 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.
    2. 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

    1. 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.
    2. CD ~ Exit to the home, be sure to be under home, or you will get an error later.
    3. Terminal Vim open a file, input :GoInstallBinaries , enter to start the download
    4. If you need to update, enter:GoUpdateBinaries
    5. 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

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.