diff options
| author | Ariel D'Alessandro <dalessandro.ariel@gmail.com> | 2022-02-21 08:50:09 +0100 |
|---|---|---|
| committer | Ariel D'Alessandro <dalessandro.ariel@gmail.com> | 2022-02-21 08:50:09 +0100 |
| commit | 5b30253665ea60ff81ba5f858d0e4b2d4cab7f76 (patch) | |
| tree | 99890cc0769e079eeae2df5452d86a090b39a1f8 /after/plugin | |
| parent | 578f32ce066907fbb7f39b00318abc5ed710c702 (diff) | |
| download | nvim-conf-5b30253665ea60ff81ba5f858d0e4b2d4cab7f76.tar.gz nvim-conf-5b30253665ea60ff81ba5f858d0e4b2d4cab7f76.zip | |
move some files, add trouble and efm
Diffstat (limited to 'after/plugin')
| -rw-r--r-- | after/plugin/lsp.lua | 54 |
1 files changed, 0 insertions, 54 deletions
diff --git a/after/plugin/lsp.lua b/after/plugin/lsp.lua deleted file mode 100644 index 53d9746..0000000 --- a/after/plugin/lsp.lua +++ /dev/null @@ -1,54 +0,0 @@ -local telescope_mapper = require "alpha.telescope.mappings" - -local filetype_attach = setmetatable({ - go = function(_) - vim.cmd [[ - augroup lsp_buf_format - au! BufWritePre <buffer> - autocmd BufWritePre <buffer> :lua vim.lsp.buf.formatting_sync() - augroup END - ]] - end, -}, { - __index = function() - return function() end - end, -}) - -local function on_attach(client) - local filetype = vim.api.nvim_buf_get_option(0, "filetype") - -- keymaps for lsp - vim.keymap.set("n", "K", vim.lsp.buf.hover, { buffer = 0 }) - vim.keymap.set("n", "<c-]>", vim.lsp.buf.definition, { buffer = 0 }) - vim.keymap.set("n", "<leader>vrn", vim.lsp.buf.rename, { buffer = 0 }) - vim.keymap.set("n", "<leader>vf", vim.lsp.buf.formatting, { buffer = 0 }) - vim.keymap.set("n", "<leader>vn", vim.lsp.diagnostic.goto_next, { buffer = 0 }) - vim.keymap.set("n", "<leader>vp", vim.lsp.diagnostic.goto_prev, { buffer = 0 }) - - telescope_mapper("gr", "lsp_references", nil, true) - telescope_mapper("<leader>pv", "find_symbol", nil, true) - - vim.api.nvim_set_keymap('n', '<leader>vo', ':LspRestart<cr>', {noremap = true}) - - require "lsp_signature".on_attach() - - vim.bo.omnifunc = "v:lua.vim.lsp.omnifunc" - -- Attach any filetype specific options to the client - filetype_attach[filetype](client) -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) |