summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMatthias P. Braendli <matthias.braendli@mpb.li>2020-10-27 11:10:29 +0100
committerMatthias P. Braendli <matthias.braendli@mpb.li>2020-10-27 11:11:04 +0100
commit3837596e546ec321565628ce2fb5a4cddc529ecd (patch)
tree7b1ebd61eaf0e11ae0ab8cfbac13e333bde39214
parent8af69345adef52b55a282247e31197ffb05dacef (diff)
downloadvimrc-3837596e546ec321565628ce2fb5a4cddc529ecd.tar.gz
vimrc-3837596e546ec321565628ce2fb5a4cddc529ecd.tar.bz2
vimrc-3837596e546ec321565628ce2fb5a4cddc529ecd.zip
Add LanguageServer
-rw-r--r--dotvimrc24
-rw-r--r--init-dependencies.sh3
2 files changed, 26 insertions, 1 deletions
diff --git a/dotvimrc b/dotvimrc
index a00edf6..1533b88 100644
--- a/dotvimrc
+++ b/dotvimrc
@@ -14,7 +14,7 @@ set wildmode=longest:full
set wildmenu
set hlsearch
set pastetoggle=<F10>
-set tw=0
+set textwidth=120
set backspace=eol,indent,start
set number
"set mouse=a "Disabled
@@ -59,6 +59,24 @@ let mapleader="\<Space>"
"nnoremap <leader>sr :SourcetrailRefresh<CR>
"nnoremap <leader>sa :SourcetrailActivateToken<CR>
+set runtimepath+=~/.vim/LanguageClient-neovim
+" Required for operations modifying multiple buffers like rename.
+
+let g:LanguageClient_serverCommands = {
+ \ 'rust': ['rust-analyzer'],
+ \ 'python': ['pyls'],
+ \ 'cpp': ['clangd'],
+ \ 'c': ['clangd'] }
+
+let g:LanguageClient_useVirtualText = "No"
+let g:LanguageClient_autoStart = 0
+
+nnoremap <F8> :call LanguageClient_contextMenu()<CR>
+nnoremap <silent> gd :call LanguageClient#textDocument_definition()<CR>
+nnoremap <silent> <F2> :call LanguageClient#textDocument_rename()<CR>
+
+set completefunc=LanguageClient#complete
+
if executable('rg')
let g:ackprg = "rg -i --vimgrep"
let g:ack_default_options = " -i --vimgrep"
@@ -97,6 +115,7 @@ noremap <Leader>F :YcmCompleter FixIt<CR>:ccl<CR>
"rust-lang/rust.vim
let g:rust_recommended_style = 0
au FileType rust nmap <Leader>m :make build<CR>
+au FileType rust nmap <Leader>c :Cargo check<CR>
"tpope/vim-surround.git
"taglist.vim
@@ -190,6 +209,9 @@ autocmd BufNewFile,BufRead *.s set filetype=armasm
"Markdown, not modula2
autocmd BufNewFile,BufRead *.md set filetype=markdown
+autocmd BufNewFile,BufRead *.toml set filetype=dosini
+autocmd BufNewFile,BufRead *.j2 set filetype=jinja
+
set nostartofline
"Leader-f switches from C source .c to header .h file
diff --git a/init-dependencies.sh b/init-dependencies.sh
new file mode 100644
index 0000000..008d4aa
--- /dev/null
+++ b/init-dependencies.sh
@@ -0,0 +1,3 @@
+#!/bin/sh
+
+git clone https://github.com/autozimu/LanguageClient-neovim.git