summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authoryushyin <yushyin@saga>2018-09-29 14:29:24 +0200
committeryushyin <yushyin@saga>2018-09-29 14:47:21 +0200
commit34a5318c14117335f53004be724b6b7a0cc0b3f5 (patch)
tree0de5d2e66df282a52d8e6dc33b56082187270d9b
parent8b7d61e5413a7b04f01f317320f48ce67a74a46f (diff)
downloaddotfiles-34a5318c14117335f53004be724b6b7a0cc0b3f5.tar.gz
dotfiles-34a5318c14117335f53004be724b6b7a0cc0b3f5.tar.xz
Vim: Add vim-lsp
Replace language specific autocompletion for Haskell, Rust and C/C++ with vim-lsp's omnifunc.
-rw-r--r--vim/after/ftplugin/haskell.vim1
-rw-r--r--vim/dein.toml29
-rw-r--r--vim/ftplugin/haskell.vim1
-rw-r--r--vim/ftplugin/rust.vim1
-rw-r--r--vim/plugrc/clang_complete.rc.vim4
-rw-r--r--vim/vimrc32
6 files changed, 35 insertions, 33 deletions
diff --git a/vim/after/ftplugin/haskell.vim b/vim/after/ftplugin/haskell.vim
new file mode 100644
index 0000000..aebbe1a
--- /dev/null
+++ b/vim/after/ftplugin/haskell.vim
@@ -0,0 +1 @@
+setlocal omnifunc=lsp#complete
diff --git a/vim/dein.toml b/vim/dein.toml
index 6ddebb3..54e7fe1 100644
--- a/vim/dein.toml
+++ b/vim/dein.toml
@@ -26,29 +26,12 @@ lazy = 1
on_ft = ['c', 'cpp']
[[plugins]]
-repo = 'Rip-Rip/clang_complete.git'
-lazy = 1
-on_ft = ['c', 'cpp']
-
-[[plugins]]
repo = 'Twinside/vim-hoogle'
lazy = 1
external_commands = 'hoogle'
on_ft = ['haskell', 'lhaskell', 'chaskell']
[[plugins]]
-repo = 'eagletmt/ghcmod-vim'
-lazy = 1
-external_commands = 'ghc-mod'
-on_ft = ['haskell', 'lhaskell', 'chaskell']
-
-[[plugins]]
-repo = 'eagletmt/neco-ghc'
-lazy = 1
-external_commands = 'ghc-mod'
-on_ft = ['haskell', 'lhaskell', 'chaskell']
-
-[[plugins]]
repo = 'ujihisa/unite-haskellimport'
lazy = 1
external_commands = 'hoogle'
@@ -59,10 +42,6 @@ lazy = 1
on_ft = 'rust'
[[plugins]]
-repo = 'racer-rust/vim-racer'
-on_ft = 'rust'
-
-[[plugins]]
repo = 'MarcWeber/vim-addon-local-vimrc'
[[plugins]]
@@ -116,3 +95,11 @@ repo = 'kana/vim-textobj-indent'
lazy = 1
on_map = { xo = '<Plug>' }
depends = ['vim-textobj-user']
+
+[[plugins]]
+repo = 'prabirshrestha/async.vim'
+
+[[plugins]]
+repo = 'prabirshrestha/vim-lsp'
+lazy = 0
+depends = ['async.vim']
diff --git a/vim/ftplugin/haskell.vim b/vim/ftplugin/haskell.vim
index a3ed140..23a4130 100644
--- a/vim/ftplugin/haskell.vim
+++ b/vim/ftplugin/haskell.vim
@@ -1,3 +1,2 @@
setl tags+=codex.tags
-setl omnifunc=necoghc#omnifunc
setl ts=8 sts=4 sw=4 et sr
diff --git a/vim/ftplugin/rust.vim b/vim/ftplugin/rust.vim
new file mode 100644
index 0000000..aebbe1a
--- /dev/null
+++ b/vim/ftplugin/rust.vim
@@ -0,0 +1 @@
+setlocal omnifunc=lsp#complete
diff --git a/vim/plugrc/clang_complete.rc.vim b/vim/plugrc/clang_complete.rc.vim
deleted file mode 100644
index 8b776b6..0000000
--- a/vim/plugrc/clang_complete.rc.vim
+++ /dev/null
@@ -1,4 +0,0 @@
-let g:clang_auto_select = 1
-let g:clang_snippets = 1
-let g:clang_complete_macros = 1
-let g:clang_complete_patterns = 1
diff --git a/vim/vimrc b/vim/vimrc
index fda8fa4..959d790 100644
--- a/vim/vimrc
+++ b/vim/vimrc
@@ -65,13 +65,6 @@ if dein#tap('neosnippet.vim')
smap <C-k> <Plug>(neosnippet_expand_or_jump)
xmap <C-k> <Plug>(neosnippet_expand_or_jump)
endif
-if dein#tap('clang_complete')
- call s:hook_source()
-endif
-if dein#tap('vim-racer')
- let g:dein#plugin.hook_source =
- \ "let $RUST_SRC_PATH= $XDG_DATA_HOME . '/rustc_src_latest/src/'"
-endif
if dein#tap('vim-easy-align')
nmap ga <Plug>(EasyAlign)
endif
@@ -102,6 +95,31 @@ endif
if dein#tap('vim-addon-local-vimrc')
let g:local_vimrc = {'names':['.lvimrc'],'hash_fun':'LVRHashOfFile'}
endif
+if dein#tap('vim-lsp')
+ if executable('cquery')
+ au User lsp_setup call lsp#register_server({
+ \ 'name': 'cquery',
+ \ 'cmd': {server_info->['cquery']},
+ \ 'root_uri': {server_info->lsp#utils#path_to_uri(lsp#utils#find_nearest_parent_file_directory(lsp#utils#get_buffer_path(), 'compile_commands.json'))},
+ \ 'initialization_options': { 'cacheDirectory': '/tmp/cquery/cache' },
+ \ 'whitelist': ['c', 'cpp', 'objc', 'objcpp'],
+ \ })
+ endif
+ if executable('rls')
+ au User lsp_setup call lsp#register_server({
+ \ 'name': 'rls',
+ \ 'cmd': {server_info->['rustup', 'run', 'nightly', 'rls']},
+ \ 'whitelist': ['rust'],
+ \ })
+ endif
+ if executable('hie-wrapper')
+ au User lsp_setup call lsp#register_server({
+ \ 'name': 'hie',
+ \ 'cmd': {server_info->['hie-wrapper']},
+ \ 'whitelist': ['haskell'],
+ \ })
+ endif
+endif
if dein#tap('base16-vim')
set bg=dark
let base16colorspace=256