diff --git a/vim/vimrc.local b/vim/vimrc.local index d0bfd10..4374903 100644 --- a/vim/vimrc.local +++ b/vim/vimrc.local @@ -1,12 +1,15 @@ -set ts=2 -set sw=2 +set ts=4 +set sw=4 set showcmd set nofsync -set swapsync= set incsearch set hlsearch set cursorline +if !has('nvim') + set swapsync= +endif + " Set up visible whitespace by default set list set listchars=tab:ยป-,trail:~,extends:>,precedes:< diff --git a/vim/vimrc.user b/vim/vimrc.user index e0c753c..de6eb6a 100644 --- a/vim/vimrc.user +++ b/vim/vimrc.user @@ -1,33 +1,45 @@ " configure tags - add additional tags here or comment out not-used ones set tags+=~/.vim/tags/cpp -set tags+=~/.vim/tags/gl -set tags+=~/.vim/tags/sdl -set tags+=~/.vim/tags/qt4 -set tags+=~/.vim/tags/irrlicht " build tags of your own project with F11 map :!ctags -R --sort=yes --c++-kinds=+p --fields=+iaS --extra=+q . map :mksession! Session.vim \| wviminfo! viminfo -" OmniCppComplete -let OmniCpp_NamespaceSearch = 1 -let OmniCpp_GlobalScopeSearch = 1 -let OmniCpp_ShowAccess = 1 -let OmniCpp_ShowPrototypeInAbbr = 1 " show function parameters -let OmniCpp_MayCompleteDot = 1 " autocomplete after . -let OmniCpp_MayCompleteArrow = 1 " autocomplete after -> -let OmniCpp_MayCompleteScope = 1 " autocomplete after :: -let OmniCpp_DefaultNamespaces = ["std", "_GLIBCXX_STD"] -" automatically open and close the popup menu / preview window -au CursorMovedI,InsertLeave * if pumvisible() == 0|silent! pclose|endif -set completeopt=menuone,menu,longest,preview - -" for latex-suite -filetype plugin on -set grepprg=grep\ -nH\ $* -let g:tex_flavor='latex' -let g:Tex_ViewRule_dvi = 'okular' -let g:Tex_ViewRule_pdf = 'okular' - set modeline -set expandtab +set noexpandtab set listchars+=precedes:<,extends:> + +" Language Server + +let g:lsp_signs_enabled = 1 " enable signs +let g:lsp_diagnostics_echo_cursor = 1 " enable echo under cursor when in normal mode + +"if executable('pyls') +" " pip install python-language-server +" au User lsp_setup call lsp#register_server({ +" \ 'name': 'pyls', +" \ 'cmd': {server_info->['pyls']}, +" \ 'whitelist': ['python'], +" \ }) +"endif + +if executable('ghdl-ls') + au User lsp_setup call lsp#register_server({ + \ 'name': 'ghdl-ls', + \ 'cmd': {server_info->['ghdl-ls']}, + \ 'whitelist': ['vhdl'], + \ }) +endif + +function! s:on_lsp_buffer_enabled() abort + setlocal omnifunc=lsp#complete + setlocal signcolumn=yes + nmap gd (lsp-definition) + nmap (lsp-rename) + " refer to doc to add more commands +endfunction + +augroup lsp_install + au! + " call s:on_lsp_buffer_enabled only for languages that has the server registered. + autocmd User lsp_buffer_enabled call s:on_lsp_buffer_enabled() +augroup END