XCR34YPGC3GY7CKQTQX4WUEKLRLAZKNSUPWOKGD5HUHK2RN7RKGAC
6HKEOUTCAMUWZBFKHKSTWI2QMWQPTF6ZP5LLHHDO6PKXB5H7CSNQC
HWLVSY6UL5VDMK7NLQB2LJYEHV6KNKP4QIUWJKYTKKYW3L5ZLQBAC
UNMO22GQRCYHMIXPFTZTQVVPCOFSBVU2YV5CKLO72ZRDZ2AJ46WQC
QWJ5FBQ7ZL75GTXLYEVPTLK7AEMBMBEYE7536WFLGINTG332LAIAC
JTTWOADMNTGEUL5TBJSC5PEXSW6GMBZLY6TWLN2DHV26REVMZOZAC
ULKBUZEBFCZOZ5BTUW6262LG5DK6BUOVN6STTKCFLZFG3EE6PFPAC
5U2BEZGMRUSG3OQM3VGNF3XINPCKRLGU7CJJDUVRHHORN3IED2HQC
Plug 'liuchengxu/vista.vim'
Plug 'tjdevries/lsp_extensions.nvim'
Plug 'nvim-lua/completion-nvim'
Plug 'nvim-lua/diagnostic-nvim'
Plug 'nvim-lua/telescope.nvim'
Plug 'nvim-lua/plenary.nvim' " dependency for telescope
Plug 'nvim-lua/popup.nvim' " dependency for telescope
" netrw configuration
" keeping just in case I need to use netrw for some particular purpose
let g:netrw_liststyle = 3 " use tree view by default
let g:netrw_banner = 0 " turn off the help banner
let g:netrw_winsize = 25 " default window size
let g:netrw_bufsettings = 'noma nomod nu nobl nowrap ro' " add line numbers to netrw
inoremap <expr><tab> pumvisible() ? "\<c-n>" : "\<tab>"
inoremap <expr><s-tab> pumvisible() ? "\<c-p>" : "\<s-tab>"
" inoremap <expr><tab> pumvisible() ? "\<c-n>" : "\<tab>"
" inoremap <expr><s-tab> pumvisible() ? "\<c-p>" : "\<s-tab>"
" Trigger completion with <Tab>
inoremap <silent><expr> <tab>
\ pumvisible() ? "\<c-n>" :
\ <sid>check_back_space() ? "\<tab>" :
\ completion#trigger_completion()
inoremap <silent><expr> <s-tab>
\ pumvisible() ? "\<c-p>" :
\ <sid>check_back_space() ? "\<s-tab>" :
\ completion#trigger_completion()
function! s:check_back_space() abort
let col = col('.') - 1
return !col || getline('.')[col - 1] =~ '\s'
endfunction
:lua <<EOF
local nvim_lsp = require'nvim_lsp'
local capabilities = {
textDocument = {
completion = {
completionItem = {
snippetSupport = false
}
}
}
}
lua require'nvim_lsp'.rust_analyzer.setup({on_init = require'ncm2'.register_lsp_source})
" lua require'nvim_lsp'.rls.setup{on_init = require'ncm2'.register_lsp_source}
lua require'nvim_lsp'.pyls.setup{on_init = require'ncm2'.register_lsp_source}
lua require'nvim_lsp'.clangd.setup{on_init = require'ncm2'.register_lsp_source}
lua require'nvim_lsp'.gopls.setup{on_init = require'ncm2'.register_lsp_source}
lua require'nvim_lsp'.tsserver.setup{on_init = require'ncm2'.register_lsp_source}
local on_attach = function(client)
require'completion'.on_attach(client)
require'diagnostic'.on_attach(client)
end
local servers = {"rust_analyzer", "pyls", "clangd", "gopls", "tsserver", "texlab"}
for _, server in ipairs(servers) do
nvim_lsp[server].setup{
on_attach = on_attach,
capabilities = capabilities,
}
end
EOF
nnoremap <buffer> <silent> <c-]> <cmd>lua vim.lsp.buf.declaration()<cr>
nnoremap <buffer> <silent> gd <cmd>lua vim.lsp.buf.definition()<cr>
nnoremap <buffer> <silent> K <cmd>lua vim.lsp.buf.hover()<cr>
nnoremap <buffer> <silent> gD <cmd>lua vim.lsp.buf.implementation()<cr>
" nnoremap <buffer> <silent> <c-k> <cmd>lua vim.lsp.buf.signature_help()<cr>
nnoremap <buffer> <silent> 1gD <cmd>lua vim.lsp.buf.type_definition()<cr>
nnoremap <buffer> <silent> gr <cmd>lua vim.lsp.buf.references()<cr>
nnoremap <buffer> <silent> <localleader>r <cmd>lua vim.lsp.buf.rename()<cr>
nnoremap <buffer> <silent> <c-]> <cmd>lua vim.lsp.buf.definition()<cr>
nnoremap <buffer> <silent> K <cmd>lua vim.lsp.buf.hover()<cr>
nnoremap <buffer> <silent> gD <cmd>lua vim.lsp.buf.implementation()<cr>
nnoremap <buffer> <silent> <c-k> <cmd>lua vim.lsp.buf.signature_help()<cr>
nnoremap <buffer> <silent> 1gD <cmd>lua vim.lsp.buf.type_definition()<cr>
nnoremap <buffer> <silent> gr <cmd>lua vim.lsp.buf.references()<cr>
nnoremap <buffer> <silent> g0 <cmd>lua vim.lsp.buf.document_symbol()<cr>
nnoremap <buffer> <silent> gW <cmd>lua vim.lsp.buf.workspace_symbol()<cr>
nnoremap <buffer> <silent> gd <cmd>lua vim.lsp.buf.declaration()<cr>
nnoremap <buffer> <silent> <leader>r <cmd>lua vim.lsp.buf.rename()<cr>
" Set updatetime for CursorHold
" 300ms of no cursor movement to trigger CursorHold
set updatetime=300
" Show diagnostic popup on cursor hold
autocmd CursorHold * lua vim.lsp.util.show_line_diagnostics()
" Goto previous/next diagnostic warning/error
nnoremap <silent> g[ <cmd>PrevDiagnosticCycle<cr>
nnoremap <silent> g] <cmd>NextDiagnosticCycle<cr>
" Enable type inlay hints
autocmd CursorMoved,InsertLeave,BufEnter,BufWinEnter,TabEnter,BufWritePost *
\ lua require'lsp_extensions'.inlay_hints{prefix = '', highlight = "Comment"}