mirror of
https://github.com/SpaceVim/SpaceVim.git
synced 2025-03-13 02:05:40 +08:00
Merge branch 'dev' into lang/xml
This commit is contained in:
commit
e945b2818b
@ -365,6 +365,7 @@ function! SpaceVim#default#SetMappings() abort
|
||||
call SpaceVim#mapping#def('nnoremap <silent>', '<Leader>sg', ':vsplit<CR>:wincmd p<CR>:e#<CR>',
|
||||
\'Open previous buffer in vsplit window' , 'vsplit|wincmd p|e#')
|
||||
call SpaceVim#mapping#def('nnoremap <silent>', 'gf', ':call zvim#gf()<CR>', 'Jump to a file under cursor', '')
|
||||
call SpaceVim#mapping#def('nnoremap <silent>', 'gd', ':call SpaceVim#mapping#gd()<CR>', 'Goto declaration', '')
|
||||
endfunction
|
||||
|
||||
fu! s:tobur(num) abort
|
||||
|
@ -22,7 +22,6 @@ function! SpaceVim#layers#autocomplete#plugins() abort
|
||||
\ ['honza/vim-snippets', {'on_i' : 1, 'loadconf_before' : 1}],
|
||||
\ ['Shougo/neco-syntax', { 'on_i' : 1}],
|
||||
\ ['ujihisa/neco-look', { 'on_i' : 1}],
|
||||
\ ['Shougo/neco-vim', { 'on_i' : 1, 'loadconf_before' : 1}],
|
||||
\ ['Shougo/context_filetype.vim', { 'on_i' : 1}],
|
||||
\ ['Shougo/neoinclude.vim', { 'on_i' : 1}],
|
||||
\ ['Shougo/neosnippet-snippets', { 'merged' : 0}],
|
||||
|
@ -19,4 +19,8 @@ function! SpaceVim#layers#git#config() abort
|
||||
nmap <leader>hk <plug>(signify-prev-hunk)
|
||||
nmap <leader>hJ 9999<leader>gj
|
||||
nmap <leader>hK 9999<leader>gk
|
||||
augroup spacevim_layer_git
|
||||
autocmd!
|
||||
autocmd FileType diff nnoremap <buffer><silent> q :bd!<CR>
|
||||
augroup END
|
||||
endfunction
|
||||
|
@ -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
|
||||
let plugins = [['fatih/vim-go', { 'on_ft' : 'go', 'loadconf_before' : 1}]]
|
||||
if has('nvim')
|
||||
@ -16,18 +35,18 @@ function! SpaceVim#layers#lang#go#config() abort
|
||||
let g:go_fmt_command = 'goimports'
|
||||
let g:syntastic_go_checkers = ['golint', 'govet', 'errcheck']
|
||||
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
|
||||
au!
|
||||
au FileType go nmap <Buffer><Leader>s <Plug>(go-implements)
|
||||
au FileType go nmap <Buffer><Leader>i <Plug>(go-info)
|
||||
au FileType go nmap <Buffer><Leader>e <Plug>(go-rename)
|
||||
au FileType go nmap <Buffer><Leader>r <Plug>(go-run)
|
||||
au FileType go nmap <Buffer><Leader>b <Plug>(go-build)
|
||||
au FileType go nmap <Buffer><Leader>t <Plug>(go-test)
|
||||
au FileType go nmap <Buffer><Leader>gd <Plug>(go-doc)
|
||||
au FileType go nmap <Buffer><Leader>gv <Plug>(go-doc-vertical)
|
||||
au FileType go nmap <Buffer><Leader>co <Plug>(go-coverage)
|
||||
au FileType go nmap <Buffer><silent><Leader>s <Plug>(go-implements)
|
||||
au FileType go nmap <Buffer><silent><Leader>i <Plug>(go-info)
|
||||
au FileType go nmap <Buffer><silent><Leader>e <Plug>(go-rename)
|
||||
au FileType go nmap <Buffer><silent><Leader>r <Plug>(go-run)
|
||||
au FileType go nmap <Buffer><silent><Leader>b <Plug>(go-build)
|
||||
au FileType go nmap <Buffer><silent><Leader>t <Plug>(go-test)
|
||||
au FileType go nmap <Buffer><silent><Leader>gd <Plug>(go-doc)
|
||||
au FileType go nmap <Buffer><silent><Leader>gv <Plug>(go-doc-vertical)
|
||||
au FileType go nmap <Buffer><silent><Leader>co <Plug>(go-coverage)
|
||||
augroup END
|
||||
endfunction
|
||||
|
12
autoload/SpaceVim/layers/lang/vim.vim
Normal file
12
autoload/SpaceVim/layers/lang/vim.vim
Normal file
@ -0,0 +1,12 @@
|
||||
function! SpaceVim#layers#lang#vim#plugins() abort
|
||||
let plugins = []
|
||||
call add(plugins,['tweekmonster/exception.vim'])
|
||||
call add(plugins,['mhinz/vim-lookup'])
|
||||
call add(plugins,['Shougo/neco-vim', { 'on_i' : 1, 'loadconf_before' : 1}])
|
||||
call add(plugins,['tweekmonster/helpful.vim', {'on_cmd': 'HelpfulVersion'}])
|
||||
return plugins
|
||||
endfunction
|
||||
|
||||
function! SpaceVim#layers#lang#vim#config() abort
|
||||
call SpaceVim#mapping#gd#add('vim','lookup#lookup')
|
||||
endfunction
|
@ -6,7 +6,6 @@ function! SpaceVim#layers#tools#plugins() abort
|
||||
\ ['junegunn/goyo.vim', { 'on_cmd' : 'Goyo', 'loadconf' : 1}],
|
||||
\ ['Yggdroot/LeaderF', {'merged' : 0}],
|
||||
\ ['google/vim-searchindex'],
|
||||
\ ['tweekmonster/helpful.vim', {'on_cmd': 'HelpfulVersion'}],
|
||||
\ ['simnalamburt/vim-mundo', { 'on_cmd' : 'MundoToggle'}],
|
||||
\ ['wsdjeg/MarkDown.pl', { 'on_cmd' : 'MarkDownPreview'}],
|
||||
\ ['mhinz/vim-grepper' , { 'on_cmd' : 'Grepper', 'loadconf' : 1} ],
|
||||
|
@ -56,3 +56,11 @@ function! SpaceVim#mapping#enter() abort
|
||||
return "\<Enter>"
|
||||
endif
|
||||
endfunction
|
||||
|
||||
function! SpaceVim#mapping#gd() abort
|
||||
if !empty(SpaceVim#mapping#gd#get())
|
||||
call call(SpaceVim#mapping#gd#get(), [])
|
||||
else
|
||||
normal! gd
|
||||
endif
|
||||
endfunction
|
||||
|
8
autoload/SpaceVim/mapping/gd.vim
Normal file
8
autoload/SpaceVim/mapping/gd.vim
Normal file
@ -0,0 +1,8 @@
|
||||
let s:gd = {}
|
||||
function! SpaceVim#mapping#gd#add(ft, func) abort
|
||||
call extend(s:gd,{a:ft : a:func})
|
||||
endfunction
|
||||
|
||||
function! SpaceVim#mapping#gd#get() abort
|
||||
return get(s:gd, &filetype, '')
|
||||
endfunction
|
@ -1,11 +1,25 @@
|
||||
function! SpaceVim#options#list() abort
|
||||
let list = []
|
||||
if has('patch-7.4.2010')
|
||||
if has('patch-7.4.2010') && 0
|
||||
for var in getcompletion('g:spacevim_','var')
|
||||
call add(list, var . ' = ' . string(get(g:, var[2:] , '')))
|
||||
endfor
|
||||
else
|
||||
call add(list, 'your vim is too old, getcompletion() need patch7-4-2010')
|
||||
redraw
|
||||
for var in filter(map(s:execute('let g:'), "matchstr(v:val, '\\S\\+')"), "v:val =~# '^spacevim_'")
|
||||
call add(list,'g:' . var . ' = ' . string(get(g:, var , '')))
|
||||
endfor
|
||||
endif
|
||||
return list
|
||||
endfunction
|
||||
|
||||
function! s:execute(cmd) abort
|
||||
if exists('*execute')
|
||||
return split(execute(a:cmd), "\n")
|
||||
endif
|
||||
|
||||
redir => output
|
||||
execute a:cmd
|
||||
redir END
|
||||
return split(output, "\n")
|
||||
endfunction
|
||||
|
@ -10,10 +10,11 @@ CONTENTS *SpaceVim-contents*
|
||||
1. autocomplete..................................|SpaceVim-autocomplete|
|
||||
2. colorscheme....................................|SpaceVim-colorscheme|
|
||||
3. lang#c........................................|SpaceVim-layer-lang-c|
|
||||
4. lang#java..................................|SpaceVim-layer-lang-java|
|
||||
5. lang#php....................................|SpaceVim-layer-lang-php|
|
||||
6. lang#rust..................................|SpaceVim-layer-lang-rust|
|
||||
7. lang#xml....................................|SpaceVim-layer-lang-xml|
|
||||
4. lang#go......................................|SpaceVim-layer-lang-go|
|
||||
5. lang#java..................................|SpaceVim-layer-lang-java|
|
||||
6. lang#php....................................|SpaceVim-layer-lang-php|
|
||||
7. lang#rust..................................|SpaceVim-layer-lang-rust|
|
||||
8. lang#xml....................................|SpaceVim-layer-lang-xml|
|
||||
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.
|
||||
|
||||
|
||||
==============================================================================
|
||||
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*
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user