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:
parent
96127801a7
commit
69654597d2
4 changed files with 22 additions and 6 deletions
|
@ -1,8 +1,4 @@
|
|||
nmap <buffer> gd <Plug>(rust-def)
|
||||
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)
|
||||
colorscheme wombat
|
||||
|
||||
augroup rust_maps
|
||||
au!
|
||||
|
|
9
nvim/.config/nvim/after/plugin/nvim_lsp.vim
Normal file
9
nvim/.config/nvim/after/plugin/nvim_lsp.vim
Normal 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>
|
|
@ -61,6 +61,9 @@ Plug 'christoomey/vim-system-copy'
|
|||
Plug 'dhruvasagar/vim-markify'
|
||||
" Toggle terminal
|
||||
Plug 'caenrique/nvim-toggle-terminal'
|
||||
" LSP
|
||||
Plug 'neovim/nvim-lsp'
|
||||
Plug 'haorenW1025/diagnostic-nvim'
|
||||
" Language support & syntax highlighting
|
||||
" Haskell
|
||||
Plug 'neovimhaskell/haskell-vim'
|
||||
|
@ -69,7 +72,6 @@ Plug 'godlygeek/tabular', { 'for': 'haskell' }
|
|||
Plug 'ndmitchell/ghcid', { 'rtp': 'plugins/nvim' }
|
||||
" Rust
|
||||
Plug 'rust-lang/rust.vim', { 'for': 'rust' }
|
||||
Plug 'racer-rust/vim-racer', { 'for': 'rust' }
|
||||
" Purescript
|
||||
Plug 'purescript-contrib/purescript-vim'
|
||||
Plug 'frigoeu/psc-ide-vim'
|
||||
|
|
|
@ -61,3 +61,12 @@ let g:cpp_concepts_highlight = 1
|
|||
let g:markify_error_text = 'E'
|
||||
let g:markify_warning_text = 'W'
|
||||
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}
|
||||
|
|
Loading…
Reference in a new issue