From 373e4c4bc85547253ae68866f1459f68dea549e7 Mon Sep 17 00:00:00 2001 From: Julian T Date: Tue, 21 Apr 2020 21:57:54 +0200 Subject: Back on lsp and trying vimwiki --- vim/.vimrc | 33 +++++++++++++++++++++++++++++---- 1 file changed, 29 insertions(+), 4 deletions(-) (limited to 'vim/.vimrc') diff --git a/vim/.vimrc b/vim/.vimrc index f1818a9..2cead46 100644 --- a/vim/.vimrc +++ b/vim/.vimrc @@ -16,7 +16,7 @@ set shellslash " Completion Plugin 'prabirshrestha/async.vim' Plugin 'prabirshrestha/vim-lsp' - " Plugin 'fatih/vim-go' + Plugin 'fatih/vim-go' Plugin 'ajh17/VimCompletesMe' " Plugin 'ludovicchabant/vim-gutentags' @@ -51,6 +51,8 @@ set shellslash " Plugin 'rust-lang/rust.vim' " Plugin 'racer-rust/vim-racer' + Plugin 'vimwiki/vimwiki' + " Snippets are separated from the engine. Add this if you want them: " Plugin 'honza/vim-snippets' @@ -65,10 +67,21 @@ set shellslash " let g:rustfmt_autosave = 1 autocmd FileType c let b:vcm_tab_complete = 'omni' + autocmd FileType py let b:vcm_tab_complete = 'omni' autocmd FileType go let b:vcm_tab_complete = 'omni' autocmd FileType vim let b:vcm_tab_complete = 'vim' " Setup lsp servers + let g:lsp_diagnostics_echo_cursor = 0 + let g:lsp_signature_help_enabled = 0 + let g:lsp_insert_text_enabled = 0 + if executable('pyls') + au User lsp_setup call lsp#register_server({ + \ 'name': 'python', + \ 'cmd': {server_info->['pyls']}, + \ 'whitelist': ['python'], + \ }) + endif if executable('clangd') au User lsp_setup call lsp#register_server({ \ 'name': 'clangd', @@ -76,6 +89,13 @@ set shellslash \ 'whitelist': ['c', 'cpp'], \ }) endif + if executable('gopls') + au User lsp_setup call lsp#register_server({ + \ 'name': 'golang', + \ 'cmd': {server_info->['gopls']}, + \ 'whitelist': ['go'], + \ }) + endif " Enable csp if available, stolen from lsp github function! s:on_lsp_buffer_enabled() abort @@ -93,9 +113,6 @@ set shellslash autocmd User lsp_buffer_enabled call s:on_lsp_buffer_enabled() augroup END - let g:lsp_log_verbose = 1 - let g:lsp_log_file = expand('/tmp/vim-lsp.log') - " General vim settings syntax enable set number @@ -105,6 +122,7 @@ set shellslash set shiftwidth=4 set softtabstop=4 set noexpandtab + set colorcolumn=80 " Remove statusline set laststatus=1 @@ -125,6 +143,12 @@ set shellslash " Persistent undo set undofile + " Exit insert mode on inactivity + " au CursorHoldI * stopinsert + +" Vimwiki stuff + let g:vimwiki_list = [{'path': '~/Documents/vimwiki', 'path_html': '~/Documents/vimwiki/export'}] + " Latex stuff let g:tex_flavor='latex' @@ -164,6 +188,7 @@ set shellslash map mm :make V=1 map mf :make flash V=1 map t :terminali + map s :!echo > jtle_build_it " Enforcing filetypes autocmd BufRead,BufNewFile *.ino set filetype=c -- cgit v1.2.3