markdown spf13-vim + vim-go

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了markdown spf13-vim + vim-go相关的知识,希望对你有一定的参考价值。

1. Install spf13-vim

```sh
sh <(curl https://j.mp/spf13-vim3 -L)
```

2. Install Go bundle

```sh
echo "let g:spf13_bundle_groups=['general', 'neocomplete', 'programming', 'ruby', 'python', 'go', 'javascript', 'html', 'misc', 'writing' ]" >> ~/.vimrc.before.local 
vim +BundleInstall! +qall
```

3. Config `.vimrc.local`

```vim
" Customize
let g:indent_guides_enable_on_vim_startup = 0

" Use neocomplete
let g:neocomplete#enable_at_startup = 1
" Use smartcase.
let g:neocomplete#enable_smart_case = 1
" <TAB>: completion
inoremap <expr><TAB> pumvisible() ? "\<C-n>" : "\<TAB>"

" Theme
let g:solarized_termtrans=0
let g:solarized_contrast="normal"
let g:solarized_visibility="normal"
set background=light
colorscheme solarized

" vim-go
let g:go_highlight_functions = 1
let g:go_highlight_methods = 1
let g:go_highlight_structs = 1
let g:go_highlight_operators = 1
let g:go_highlight_build_constraints = 1
" :GoDef
au Filetype go nmap gd <Plug>(go-def)

" tagbar
nmap <F8> :TagbarToggle<CR>
" ctags
let g:tagbar_type_go = {
    \ 'ctagstype' : 'go',
    \ 'kinds'     : [
        \ 'p:package',
        \ 'i:imports:1',
        \ 'c:constants',
        \ 'v:variables',
        \ 't:types',
        \ 'n:interfaces',
        \ 'w:fields',
        \ 'e:embedded',
        \ 'm:methods',
        \ 'r:constructor',
        \ 'f:functions'
    \ ],
    \ 'sro' : '.',
    \ 'kind2scope' : {
        \ 't' : 'ctype',
        \ 'n' : 'ntype'
    \ },
    \ 'scope2kind' : {
        \ 'ctype' : 't',
        \ 'ntype' : 'n'
    \ },
    \ 'ctagsbin'  : 'gotags',
    \ 'ctagsargs' : '-sort -silent'
\ }

" nerdtree
map <C-n> :NERDTreeToggle<CR>
```

4. Remove annoying indent highlight

```vim
:set nolist
```

以上是关于markdown spf13-vim + vim-go的主要内容,如果未能解决你的问题,请参考以下文章

ubuntu上如何简单快捷地安装spf13-vim?

ubuntu上如何简单快捷地安装spf13-vim?

Linux下安装spf13-vim

VIM配置

解决spf13-vim编辑php丢失语法颜色问题

Vim配置(python版)