nvim: Switch to using Language Client Server Protocol
Signed-off-by: Sanchayan Maity <maitysanchayan@gmail.com>
This commit is contained in:
parent
04ded4c85b
commit
27ecc9d20e
1 changed files with 24 additions and 9 deletions
|
@ -33,13 +33,13 @@ Plug 'universal-ctags/ctags'
|
||||||
Plug 'scrooloose/nerdcommenter'
|
Plug 'scrooloose/nerdcommenter'
|
||||||
" Theme
|
" Theme
|
||||||
Plug 'sickill/vim-monokai'
|
Plug 'sickill/vim-monokai'
|
||||||
|
" Language Client
|
||||||
|
Plug 'autozimu/LanguageClient-neovim', {
|
||||||
|
\ 'branch': 'next',
|
||||||
|
\ 'do': 'fish install.sh',
|
||||||
|
\ }
|
||||||
" Auto Completion with Deoplete
|
" Auto Completion with Deoplete
|
||||||
Plug 'Shougo/deoplete.nvim', { 'do': ':UpdateRemotePlugins' }
|
Plug 'Shougo/deoplete.nvim', { 'do': ':UpdateRemotePlugins' }
|
||||||
" Autocomplete for Python
|
|
||||||
Plug 'zchee/deoplete-jedi'
|
|
||||||
" Autocomplete for Rust
|
|
||||||
Plug 'sebastianmarkow/deoplete-rust'
|
|
||||||
Plug 'rust-lang/rust.vim'
|
|
||||||
" Autoload and read from dish if file changes
|
" Autoload and read from dish if file changes
|
||||||
Plug 'tmux-plugins/vim-tmux-focus-events'
|
Plug 'tmux-plugins/vim-tmux-focus-events'
|
||||||
" For LaTeX support
|
" For LaTeX support
|
||||||
|
@ -112,7 +112,9 @@ set smartcase " ... unless the query has capital letters.
|
||||||
set gdefault " Use 'g' flag by default with :s/foo/bar/.
|
set gdefault " Use 'g' flag by default with :s/foo/bar/.
|
||||||
set magic " Use 'magic' patterns (extended regular expressions).
|
set magic " Use 'magic' patterns (extended regular expressions).
|
||||||
set autoread " Autoload file if it changes on disk
|
set autoread " Autoload file if it changes on disk
|
||||||
|
|
||||||
set rtp+=/usr/bin/fzf
|
set rtp+=/usr/bin/fzf
|
||||||
|
set rtp+=~/.config/nvim/plugged/LanguageClient-neovim
|
||||||
|
|
||||||
set completeopt-=preview
|
set completeopt-=preview
|
||||||
|
|
||||||
|
@ -185,10 +187,6 @@ let g:haskell_indent_guard = 2
|
||||||
let g:haskell_indent_case_alternative = 1
|
let g:haskell_indent_case_alternative = 1
|
||||||
let g:cabal_indent_section = 2
|
let g:cabal_indent_section = 2
|
||||||
|
|
||||||
" For Rust
|
|
||||||
let g:deoplete#sources#rust#racer_binary='/home/sanchayan/.cargo/bin/racer'
|
|
||||||
let g:deoplete#sources#rust#rust_source_path='/home/sanchayan/GitSources/rust/src'
|
|
||||||
|
|
||||||
" Use deoplete.
|
" Use deoplete.
|
||||||
let g:deoplete#enable_at_startup = 1
|
let g:deoplete#enable_at_startup = 1
|
||||||
let g:deoplete#enable_smart_case = 1
|
let g:deoplete#enable_smart_case = 1
|
||||||
|
@ -203,3 +201,20 @@ let g:airline_left_sep = ' '
|
||||||
let g:airline_left_alt_sep = '|'
|
let g:airline_left_alt_sep = '|'
|
||||||
let g:airline_right_sep = ' '
|
let g:airline_right_sep = ' '
|
||||||
let g:airline_right_alt_sep = '|'
|
let g:airline_right_alt_sep = '|'
|
||||||
|
|
||||||
|
" For Language Client
|
||||||
|
set hidden
|
||||||
|
let g:LanguageClient_serverCommands = {
|
||||||
|
\ 'haskell': ['hie-wrapper'],
|
||||||
|
\ 'rust': ['/usr/bin/rustup', 'run', 'stable', 'rls'],
|
||||||
|
\ 'python': ['/usr/bin/pyls'],
|
||||||
|
\ }
|
||||||
|
|
||||||
|
nnoremap <Leader>lc :call LanguageClient_contextMenu()<CR>
|
||||||
|
nnoremap <Leader>lh :call LanguageClient#textDocument_hover()<CR>
|
||||||
|
nnoremap <Leader>ld :call LanguageClient#textDocument_definition()<CR>
|
||||||
|
nnoremap <Leader>ln :call LanguageClient#textDocument_rename()<CR>
|
||||||
|
nnoremap <Leader>lf :call LanguageClient#textDocument_formatting()<CR>
|
||||||
|
nnoremap <Leader>lr :call LanguageClient#textDocument_references()<CR>
|
||||||
|
nnoremap <Leader>la :call LanguageClient#textDocument_codeAction()<CR>
|
||||||
|
nnoremap <Leader>ls :call LanguageClient#textDocument_documentSymbol()<CR>
|
||||||
|
|
Loading…
Reference in a new issue