fun! LspLocationList() lua vim.lsp.diagnostic.set_loclist({open_loclist = false}) endfun augroup alpha_lsp autocmd! autocmd! BufWrite,BufEnter,InsertLeave * :call LspLocationList() augroup END nnoremap vd :lua vim.lsp.buf.definition() nnoremap vsh :lua vim.lsp.buf.signature_help() nnoremap vh :lua vim.lsp.buf.hover() " to test nnoremap vi :lua vim.lsp.buf.implementation() nnoremap vf :lua vim.lsp.buf.formatting() nnoremap vrn :lua vim.lsp.buf.rename() nnoremap vca :lua vim.lsp.buf.code_action() nnoremap vsd :lua vim.lsp.util.show_line_diagnostics(); vim.lsp.util.show_line_diagnostics() nnoremap vn :lua vim.lsp.diagnostic.goto_next() nnoremap vo :LspRestart au Filetype php setl omnifunc=v:lua.vim.lsp.omnifunc autocmd FileType go setlocal omnifunc=v:lua.vim.lsp.omnifunc let g:completion_matching_strategy_list = ['exact', 'substring', 'fuzzy'] lua << EOF local function on_attach() vim.api.nvim_set_keymap('n', 'K', ':lua vim.lsp.buf.hover()', {noremap = true}) end local lsp_installer = require("nvim-lsp-installer") lsp_installer.on_server_ready(function(server) local opts = {} -- (optional) Customize the options passed to the server if server.name == "emmet_ls" then opts.filetypes = {"html", "css", "blade"} end opts.on_attach = on_attach -- This setup() function is exactly the same as lspconfig's setup function (:help lspconfig-quickstart) server:setup(opts) vim.cmd [[ do User LspAttachBuffers ]] end)