Plug 'fatih/vim-go', { 'do': ':GoUpdateBinaries' }" run :GoInstallBinaries if setting up first time" this will also install the languager server for go (gopls) automatically
The following boilerplate config can be used as it is
set completeopt=menuone,noselect" Use <Tab> and <S-Tab> to navigate through popup menuinoremap <expr> <Tab> pumvisible() ?"\<C-n>" : "\<Tab>"inoremap <expr> <S-Tab> pumvisible() ?"\<C-p>" : "\<S-Tab>"nnoremap <silent> gd <cmd>lua vim.lsp.buf.definition()<CR>nnoremap <silent> gD <cmd>lua vim.lsp.buf.declaration()<CR>nnoremap <silent> gr <cmd>lua vim.lsp.buf.references()<CR>nnoremap <silent> gi <cmd>lua vim.lsp.buf.implementation()<CR>nnoremap <silent> gh <cmd>lua vim.lsp.buf.hover()<CR>nnoremap <silent> <C-k> <cmd>lua vim.lsp.buf.signature_help()<CR>nnoremap <silent> <C-n> <cmd>lua vim.lsp.diagnostic.goto_prev()<CR>nnoremap <silent> <C-p> <cmd>lua vim.lsp.diagnostic.goto_next()<CR>" Auto format using LSP on saveautocmd BufWritePre *go,*.py lua vim.lsp.buf.formatting_sync(nil, 100)
Setup nvim-lspconfig
" Initialise server packslua <<EOFrequire'lspconfig'.gopls.setup{}require'lspconfig'.pyls.setup{}# or require'lspconfig'.pyright.setup{}require'lspconfig'.bashls.setup{}EOF
Highlighting other uses of the current word under the cursor
Plug 'RRethy/vim-illuminate'
After installing make sure you have a language server running, it should work out of the box You can manually enable what files to use illuminate on as well
let g:Illuminate_ftwhitelist = ['vim', 'sh', 'python']