mirror of
https://github.com/SpaceVim/SpaceVim.git
synced 2025-03-13 18:25:42 +08:00
feat(lang#vim
): add workspace related key bindings
Add three key bindings: 1. SPC l w l: list workspace folder 2. SPC l w a: add workspace folder 3. SPC l w r: remove workspace folder
This commit is contained in:
parent
e8a75bc7e2
commit
c6156bf766
@ -43,6 +43,9 @@
|
|||||||
" SPC l s show line diagnostics
|
" SPC l s show line diagnostics
|
||||||
" SPC l d show document
|
" SPC l d show document
|
||||||
" K show document
|
" K show document
|
||||||
|
" SPC l w l list workspace folder
|
||||||
|
" SPC l w a add workspace folder
|
||||||
|
" SPC l w r remove workspace folder
|
||||||
" <
|
" <
|
||||||
|
|
||||||
if exists('s:auto_generate_doc')
|
if exists('s:auto_generate_doc')
|
||||||
@ -157,6 +160,13 @@ function! s:language_specified_mappings() abort
|
|||||||
\ 'call SpaceVim#lsp#rename()', 'rename-symbol', 1)
|
\ 'call SpaceVim#lsp#rename()', 'rename-symbol', 1)
|
||||||
call SpaceVim#mapping#space#langSPC('nnoremap', ['l', 's'],
|
call SpaceVim#mapping#space#langSPC('nnoremap', ['l', 's'],
|
||||||
\ 'call SpaceVim#lsp#show_line_diagnostics()', 'show-line-diagnostics', 1)
|
\ 'call SpaceVim#lsp#show_line_diagnostics()', 'show-line-diagnostics', 1)
|
||||||
|
let g:_spacevim_mappings_space.l.w = {'name' : '+Workspace'}
|
||||||
|
call SpaceVim#mapping#space#langSPC('nnoremap', ['l', 'w', 'l'],
|
||||||
|
\ 'call SpaceVim#lsp#list_workspace_folder()', 'list-workspace-folder', 1)
|
||||||
|
call SpaceVim#mapping#space#langSPC('nnoremap', ['l', 'w', 'a'],
|
||||||
|
\ 'call SpaceVim#lsp#add_workspace_folder()', 'add-workspace-folder', 1)
|
||||||
|
call SpaceVim#mapping#space#langSPC('nnoremap', ['l', 'w', 'r'],
|
||||||
|
\ 'call SpaceVim#lsp#remove_workspace_folder()', 'remove-workspace-folder', 1)
|
||||||
endif
|
endif
|
||||||
|
|
||||||
endfunction
|
endfunction
|
||||||
|
@ -50,6 +50,15 @@ if (has('nvim-0.5.0') && s:NVIM_VERSION.is_release_version()) || has('nvim-0.6.0
|
|||||||
function! SpaceVim#lsp#show_line_diagnostics() abort
|
function! SpaceVim#lsp#show_line_diagnostics() abort
|
||||||
lua vim.lsp.diagnostic.show_line_diagnostics()
|
lua vim.lsp.diagnostic.show_line_diagnostics()
|
||||||
endfunction
|
endfunction
|
||||||
|
function! SpaceVim#lsp#list_workspace_folder() abort
|
||||||
|
lua print(vim.inspect(vim.lsp.buf.list_workspace_folders()))
|
||||||
|
endfunction
|
||||||
|
function! SpaceVim#lsp#add_workspace_folder() abort
|
||||||
|
lua vim.lsp.buf.add_workspace_folder()
|
||||||
|
endfunction
|
||||||
|
function! SpaceVim#lsp#remove_workspace_folder() abort
|
||||||
|
lua vim.lsp.buf.remove_workspace_folder()
|
||||||
|
endfunction
|
||||||
elseif SpaceVim#layers#isLoaded('autocomplete') && get(g:, 'spacevim_autocomplete_method') ==# 'coc'
|
elseif SpaceVim#layers#isLoaded('autocomplete') && get(g:, 'spacevim_autocomplete_method') ==# 'coc'
|
||||||
" use coc.nvim
|
" use coc.nvim
|
||||||
let s:coc_language_servers = {}
|
let s:coc_language_servers = {}
|
||||||
|
@ -4266,6 +4266,9 @@ used:
|
|||||||
SPC l s show line diagnostics
|
SPC l s show line diagnostics
|
||||||
SPC l d show document
|
SPC l d show document
|
||||||
K show document
|
K show document
|
||||||
|
SPC l w l list workspace folder
|
||||||
|
SPC l w a add workspace folder
|
||||||
|
SPC l w r remove workspace folder
|
||||||
<
|
<
|
||||||
|
|
||||||
==============================================================================
|
==============================================================================
|
||||||
|
Loading…
x
Reference in New Issue
Block a user