nvim: Use in built LSP for rust

While at it, use wombat colorscheme for Rust.

Signed-off-by: Sanchayan Maity <maitysanchayan@gmail.com>
This commit is contained in:
Sanchayan Maity 2020-05-24 16:57:26 +05:30
parent 96127801a7
commit 69654597d2
4 changed files with 22 additions and 6 deletions

View file

@ -1,8 +1,4 @@
nmap <buffer> gd <Plug>(rust-def) colorscheme wombat
nmap <buffer> K <Plug>(rust-doc)
nmap <buffer> gv <Plug>(rust-def-vertical)
nmap <buffer> gh <Plug>(rust-def-split)
nmap <buffer> gt <Plug>(rust-def-tab)
augroup rust_maps augroup rust_maps
au! au!

View file

@ -0,0 +1,9 @@
nnoremap <silent> gd <cmd>lua vim.lsp.buf.declaration()<CR>
nnoremap <silent> <c-]> <cmd>lua vim.lsp.buf.definition()<CR>
nnoremap <silent> K <cmd>lua vim.lsp.buf.hover()<CR>
nnoremap <silent> gD <cmd>lua vim.lsp.buf.implementation()<CR>
nnoremap <silent> <c-k> <cmd>lua vim.lsp.buf.signature_help()<CR>
nnoremap <silent> 1gD <cmd>lua vim.lsp.buf.type_definition()<CR>
nnoremap <silent> gr <cmd>lua vim.lsp.buf.references()<CR>
nnoremap <silent> g0 <cmd>lua vim.lsp.buf.document_symbol()<CR>
nnoremap <silent> gW <cmd>lua vim.lsp.buf.workspace_symbol()<CR>

View file

@ -61,6 +61,9 @@ Plug 'christoomey/vim-system-copy'
Plug 'dhruvasagar/vim-markify' Plug 'dhruvasagar/vim-markify'
" Toggle terminal " Toggle terminal
Plug 'caenrique/nvim-toggle-terminal' Plug 'caenrique/nvim-toggle-terminal'
" LSP
Plug 'neovim/nvim-lsp'
Plug 'haorenW1025/diagnostic-nvim'
" Language support & syntax highlighting " Language support & syntax highlighting
" Haskell " Haskell
Plug 'neovimhaskell/haskell-vim' Plug 'neovimhaskell/haskell-vim'
@ -69,7 +72,6 @@ Plug 'godlygeek/tabular', { 'for': 'haskell' }
Plug 'ndmitchell/ghcid', { 'rtp': 'plugins/nvim' } Plug 'ndmitchell/ghcid', { 'rtp': 'plugins/nvim' }
" Rust " Rust
Plug 'rust-lang/rust.vim', { 'for': 'rust' } Plug 'rust-lang/rust.vim', { 'for': 'rust' }
Plug 'racer-rust/vim-racer', { 'for': 'rust' }
" Purescript " Purescript
Plug 'purescript-contrib/purescript-vim' Plug 'purescript-contrib/purescript-vim'
Plug 'frigoeu/psc-ide-vim' Plug 'frigoeu/psc-ide-vim'

View file

@ -61,3 +61,12 @@ let g:cpp_concepts_highlight = 1
let g:markify_error_text = 'E' let g:markify_error_text = 'E'
let g:markify_warning_text = 'W' let g:markify_warning_text = 'W'
let g:markify_info_text = 'I' let g:markify_info_text = 'I'
" Neovim LSP Diagnostics
let g:diagnostic_enable_virtual_text = 1
let g:diagnostic_show_sign = 1
let g:diagnostic_auto_popup_while_jump = 1
let g:diagnostic_insert_delay = 1
lua require'nvim_lsp'.rust_analyzer.setup{}
lua require'nvim_lsp'.rust_analyzer.setup{on_attach=require'diagnostic'.on_attach}