mirror of
https://github.com/SpaceVim/SpaceVim.git
synced 2025-03-13 10:15:41 +08:00
Add go layer doc
This commit is contained in:
parent
85c24a2793
commit
18712bfa0e
@ -1,3 +1,22 @@
|
|||||||
|
""
|
||||||
|
" @section lang#go, layer-lang-go
|
||||||
|
" @parentsection layers
|
||||||
|
" This layer support go development, include code completion and syntax check.
|
||||||
|
" @subsection mappings
|
||||||
|
" >
|
||||||
|
" mode key function
|
||||||
|
" normal <leader>gi go implements
|
||||||
|
" normal <leader>gf go info
|
||||||
|
" normal <leader>ge go rename
|
||||||
|
" normal <leader>gr go run
|
||||||
|
" normal <leader>gb go build
|
||||||
|
" normal <leader>gt go test
|
||||||
|
" normal <leader>gd go doc
|
||||||
|
" normal <leader>gv go doc vertical
|
||||||
|
" normal <leader>gco go coverage
|
||||||
|
" <
|
||||||
|
|
||||||
|
|
||||||
function! SpaceVim#layers#lang#go#plugins() abort
|
function! SpaceVim#layers#lang#go#plugins() abort
|
||||||
let plugins = [['fatih/vim-go', { 'on_ft' : 'go', 'loadconf_before' : 1}]]
|
let plugins = [['fatih/vim-go', { 'on_ft' : 'go', 'loadconf_before' : 1}]]
|
||||||
if has('nvim')
|
if has('nvim')
|
||||||
@ -16,18 +35,18 @@ function! SpaceVim#layers#lang#go#config() abort
|
|||||||
let g:go_fmt_command = 'goimports'
|
let g:go_fmt_command = 'goimports'
|
||||||
let g:syntastic_go_checkers = ['golint', 'govet', 'errcheck']
|
let g:syntastic_go_checkers = ['golint', 'govet', 'errcheck']
|
||||||
let g:syntastic_mode_map = { 'mode': 'active', 'passive_filetypes': ['go'] }
|
let g:syntastic_mode_map = { 'mode': 'active', 'passive_filetypes': ['go'] }
|
||||||
let g:go_snippet_engine = "neosnippet"
|
let g:go_snippet_engine = 'neosnippet'
|
||||||
|
|
||||||
augroup SpaceVim_go
|
augroup SpaceVim_go
|
||||||
au!
|
au!
|
||||||
au FileType go nmap <Buffer><Leader>s <Plug>(go-implements)
|
au FileType go nmap <Buffer><silent><Leader>s <Plug>(go-implements)
|
||||||
au FileType go nmap <Buffer><Leader>i <Plug>(go-info)
|
au FileType go nmap <Buffer><silent><Leader>i <Plug>(go-info)
|
||||||
au FileType go nmap <Buffer><Leader>e <Plug>(go-rename)
|
au FileType go nmap <Buffer><silent><Leader>e <Plug>(go-rename)
|
||||||
au FileType go nmap <Buffer><Leader>r <Plug>(go-run)
|
au FileType go nmap <Buffer><silent><Leader>r <Plug>(go-run)
|
||||||
au FileType go nmap <Buffer><Leader>b <Plug>(go-build)
|
au FileType go nmap <Buffer><silent><Leader>b <Plug>(go-build)
|
||||||
au FileType go nmap <Buffer><Leader>t <Plug>(go-test)
|
au FileType go nmap <Buffer><silent><Leader>t <Plug>(go-test)
|
||||||
au FileType go nmap <Buffer><Leader>gd <Plug>(go-doc)
|
au FileType go nmap <Buffer><silent><Leader>gd <Plug>(go-doc)
|
||||||
au FileType go nmap <Buffer><Leader>gv <Plug>(go-doc-vertical)
|
au FileType go nmap <Buffer><silent><Leader>gv <Plug>(go-doc-vertical)
|
||||||
au FileType go nmap <Buffer><Leader>co <Plug>(go-coverage)
|
au FileType go nmap <Buffer><silent><Leader>co <Plug>(go-coverage)
|
||||||
augroup END
|
augroup END
|
||||||
endfunction
|
endfunction
|
||||||
|
@ -10,10 +10,11 @@ CONTENTS *SpaceVim-contents*
|
|||||||
1. autocomplete..................................|SpaceVim-autocomplete|
|
1. autocomplete..................................|SpaceVim-autocomplete|
|
||||||
2. colorscheme....................................|SpaceVim-colorscheme|
|
2. colorscheme....................................|SpaceVim-colorscheme|
|
||||||
3. lang#c........................................|SpaceVim-layer-lang-c|
|
3. lang#c........................................|SpaceVim-layer-lang-c|
|
||||||
4. lang#java..................................|SpaceVim-layer-lang-java|
|
4. lang#go......................................|SpaceVim-layer-lang-go|
|
||||||
5. lang#php....................................|SpaceVim-layer-lang-php|
|
5. lang#java..................................|SpaceVim-layer-lang-java|
|
||||||
6. lang#rust..................................|SpaceVim-layer-lang-rust|
|
6. lang#php....................................|SpaceVim-layer-lang-php|
|
||||||
7. lang#xml....................................|SpaceVim-layer-lang-xml|
|
7. lang#rust..................................|SpaceVim-layer-lang-rust|
|
||||||
|
8. lang#xml....................................|SpaceVim-layer-lang-xml|
|
||||||
5. FAQ........................................................|SpaceVim-faq|
|
5. FAQ........................................................|SpaceVim-faq|
|
||||||
|
|
||||||
==============================================================================
|
==============================================================================
|
||||||
@ -426,6 +427,25 @@ get completions within conditional preprocessor blocks. The default is 50,
|
|||||||
setting it to 0 disables this feature.
|
setting it to 0 disables this feature.
|
||||||
|
|
||||||
|
|
||||||
|
==============================================================================
|
||||||
|
LANG#GO *SpaceVim-layer-lang-go*
|
||||||
|
|
||||||
|
This layer support go development, include code completion and syntax check.
|
||||||
|
MAPPINGS
|
||||||
|
|
||||||
|
>
|
||||||
|
mode key function
|
||||||
|
normal <leader>gi go implements
|
||||||
|
normal <leader>gf go info
|
||||||
|
normal <leader>ge go rename
|
||||||
|
normal <leader>gr go run
|
||||||
|
normal <leader>gb go build
|
||||||
|
normal <leader>gt go test
|
||||||
|
normal <leader>gd go doc
|
||||||
|
normal <leader>gv go doc vertical
|
||||||
|
normal <leader>gco go coverage
|
||||||
|
<
|
||||||
|
|
||||||
==============================================================================
|
==============================================================================
|
||||||
LANG#JAVA *SpaceVim-layer-lang-java*
|
LANG#JAVA *SpaceVim-layer-lang-java*
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user