aboutsummaryrefslogtreecommitdiff
path: root/settings
diff options
context:
space:
mode:
authorYasuhiro Matsumoto <mattn.jp@gmail.com>2020-02-13 02:05:39 +0900
committerYasuhiro Matsumoto <mattn.jp@gmail.com>2020-02-13 02:05:39 +0900
commit9d8dcb25d85fa75b4944d76ea61d5fff42760cb5 (patch)
tree3b0dd8d7f45059f91853c1f133094af7da1637ab /settings
parent4e6441f09c86f42a01ccf3b4f3a0a147d9bf9331 (diff)
downloadvim-lsp-settings-9d8dcb25d85fa75b4944d76ea61d5fff42760cb5.tar.gz
vim-lsp-settings-9d8dcb25d85fa75b4944d76ea61d5fff42760cb5.tar.bz2
vim-lsp-settings-9d8dcb25d85fa75b4944d76ea61d5fff42760cb5.zip
Enable when LSP is enabled
Diffstat (limited to 'settings')
-rw-r--r--settings/clangd.vim11
1 files changed, 9 insertions, 2 deletions
diff --git a/settings/clangd.vim b/settings/clangd.vim
index 3f114a7..3b8674a 100644
--- a/settings/clangd.vim
+++ b/settings/clangd.vim
@@ -81,5 +81,12 @@ function! s:switch_source_header() abort
echo 'Switching between source/header ...'
endfunction
-command! LspSwitchSourceHeader call <SID>switch_source_header()
-nnoremap <plug>(lsp-switch-source-header) :<c-u>call <SID>switch_source_header()<cr>
+function! s:on_lsp_buffer_enabled() abort
+ command! LspSwitchSourceHeader call <SID>switch_source_header()
+ nnoremap <plug>(lsp-switch-source-header) :<c-u>call <SID>switch_source_header()<cr>
+endfunction
+
+augroup lsp_install_clangd
+ au!
+ autocmd User lsp_buffer_enabled call s:on_lsp_buffer_enabled()
+augroup END