diff options
| author | Ariel D'Alessandro <dalessandro.ariel@gmail.com> | 2023-01-30 09:01:20 +0100 |
|---|---|---|
| committer | Ariel D'Alessandro <dalessandro.ariel@gmail.com> | 2023-01-30 09:01:20 +0100 |
| commit | 75c20b732ab7a154841871c75f7fb54f016d82dc (patch) | |
| tree | d7f83e4a614b9f18ae87cfb64aacac0d0180dd07 /lua | |
| parent | 0f1176e2e4d780aa3ed4e8e4e424ffd7a3e168f6 (diff) | |
| download | nvim-conf-75c20b732ab7a154841871c75f7fb54f016d82dc.tar.gz nvim-conf-75c20b732ab7a154841871c75f7fb54f016d82dc.zip | |
feat: update cargo lsp, add todo, update laravel config
Diffstat (limited to 'lua')
| -rw-r--r-- | lua/alpha/lsp/setups.lua | 120 | ||||
| -rw-r--r-- | lua/plugins/laravel.lua | 5 | ||||
| -rw-r--r-- | lua/plugins/todo-comments.lua | 23 |
3 files changed, 90 insertions, 58 deletions
diff --git a/lua/alpha/lsp/setups.lua b/lua/alpha/lsp/setups.lua index 8744e67..15ef064 100644 --- a/lua/alpha/lsp/setups.lua +++ b/lua/alpha/lsp/setups.lua @@ -1,66 +1,74 @@ local lsp_attach = require("alpha.lsp.attach") local lsp_flags = { - debounce_text_changes = 150, + debounce_text_changes = 150, } return setmetatable({ - rust_analyzer = function() - return { - on_attach = lsp_attach, - flags = lsp_flags, - settings = { - ["rust-analyzer"] = {}, - }, - } - end, - phpactor = function() - return { - on_attach = lsp_attach, - flags = lsp_flags, - filetypes = { "php", "cucumber" }, - } - end, - emmet_ls = function() - local capabilities = require("cmp_nvim_lsp").default_capabilities(vim.lsp.protocol.make_client_capabilities()) + rust_analyzer = function() + return { + on_attach = lsp_attach, + flags = lsp_flags, + settings = { + ["rust-analyzer"] = { + checkOnSave = { + allFeatures = true, + overrideCommand = { + 'cargo', 'clippy', '--workspace', '--message-format=json', + '--all-targets', '--all-features' + } + } + }, + }, + } + end, + phpactor = function() + return { + on_attach = lsp_attach, + flags = lsp_flags, + filetypes = { "php", "cucumber" }, + } + end, + emmet_ls = function() + local capabilities = require("cmp_nvim_lsp").default_capabilities(vim.lsp.protocol.make_client_capabilities()) - return { - on_attach = lsp_attach, - flags = lsp_flags, - capabilities = capabilities, - filetypes = { "html", "typescriptreact", "javascriptreact", "css", "sass", "scss", "less", "blade", "vue" }, - } - end, - sumneko_lua = function() - return { - on_attach = lsp_attach, - flags = lsp_flags, - settings = { - Lua = { - runtime = { - version = "LuaJIT", - }, - diagnostics = { - globals = { "vim" }, - }, - workspace = { - library = vim.api.nvim_get_runtime_file("", true), + return { + on_attach = lsp_attach, + flags = lsp_flags, + capabilities = capabilities, + filetypes = { "html", "typescriptreact", "javascriptreact", "css", "sass", "scss", "less", "blade", "vue" }, + } + end, + sumneko_lua = function() + return { + on_attach = lsp_attach, + flags = lsp_flags, + settings = { + Lua = { + runtime = { + version = "LuaJIT", + }, + diagnostics = { + globals = { "vim" }, + }, + workspace = { + library = vim.api.nvim_get_runtime_file("", true), checkThirdParty = false, - }, - telemetry = { - enable = false, - }, - }, - }, - } - end, + }, + telemetry = { + enable = false, + }, + }, + }, + } + end, }, { - __index = function() - return function () - return { - on_attach = lsp_attach, - flags = lsp_flags, - } - end - end, + __index = function() + return function() + return { + on_attach = lsp_attach, + flags = lsp_flags, + } + end + end, }) diff --git a/lua/plugins/laravel.lua b/lua/plugins/laravel.lua index 60f8ad2..81d276e 100644 --- a/lua/plugins/laravel.lua +++ b/lua/plugins/laravel.lua @@ -4,10 +4,11 @@ return { "rcarriga/nvim-notify", "nvim-telescope/telescope.nvim", }, - cmd = {"Sail", "Artisan", "Composer"}, + cmd = { "Sail", "Artisan", "Composer" }, keys = { - {"<leader>pa", ":Artisan<cr>"}, + { "<leader>pa", ":Artisan<cr>" }, }, + events = { "VeryLazy" }, config = function() require("laravel").setup() require("telescope").load_extension("laravel") diff --git a/lua/plugins/todo-comments.lua b/lua/plugins/todo-comments.lua new file mode 100644 index 0000000..566b45b --- /dev/null +++ b/lua/plugins/todo-comments.lua @@ -0,0 +1,23 @@ +return { + "folke/todo-comments.nvim", + dependencies = { + "nvim-lua/plenary.nvim", + }, + config = true, + lazy = false, + cmds = {"TodoTrouble", "TodoTelescope", "TodoQuickFix"}, + keys = { + { + "]t", + function() + require("todo-comments").jump_next() + end + }, + { + "[t", + function() + require("todo-comments").jump_prev() + end + } + }, +} |