From e347c1f5c7fecd618e6b7d184734883f67dfa3ca Mon Sep 17 00:00:00 2001 From: Andy Teijelo Date: Thu, 20 Oct 2022 01:06:20 -0400 Subject: [PATCH] Add j-hui/fidget.nvim & other configs --- init.lua | 2 +- lua/user/fidget.lua | 6 ++++++ lua/user/keymaps.lua | 8 -------- lua/user/lsp/handlers.lua | 4 ++++ lua/user/lsp/init.lua | 4 ++-- lua/user/lsp/mason.lua | 2 +- lua/user/plugins.lua | 2 ++ 7 files changed, 16 insertions(+), 12 deletions(-) create mode 100644 lua/user/fidget.lua diff --git a/init.lua b/init.lua index 281b26f..ed0afa1 100644 --- a/init.lua +++ b/init.lua @@ -24,5 +24,5 @@ require "user.lsp" --require "user.dap" require "user.exrc" ---require "user.rust-tools" require "user.vimspector" +require "user.fidget" diff --git a/lua/user/fidget.lua b/lua/user/fidget.lua new file mode 100644 index 0000000..afc4a78 --- /dev/null +++ b/lua/user/fidget.lua @@ -0,0 +1,6 @@ +local ok, fidget = pcall(require, "fidget") +if not ok then + return +end + +fidget.setup() diff --git a/lua/user/keymaps.lua b/lua/user/keymaps.lua index b8621fa..28b4ff5 100644 --- a/lua/user/keymaps.lua +++ b/lua/user/keymaps.lua @@ -97,11 +97,3 @@ keymap("n", "", "VimspectorStepOut", opts) keymap("n", "", "VimspectorReset", opts) -- Shift+F5 keymap("n", "", "VimspectorRestart", opts) -- Ctrl+Shift+F5 keymap("n", "di", "VimspectorBalloonEval", opts) ---keymap("n", "dl", "lua require'dap'.run_last()", opts) ---keymap("n", "du", "lua require'dapui'.toggle()", opts) ---keymap("n", "", "lua require'dap'.terminate()", opts) - - -keymap("n", "lf", vim.lsp.buf.format, opts) -- Shift+F5 -keymap("v", "lf", "'<,'>lua vim.lsp.buf.format()", opts) -- Shift+F5 -keymap("x", "lf", "'<,'>lua vim.lsp.buf.format()", opts) -- Shift+F5 diff --git a/lua/user/lsp/handlers.lua b/lua/user/lsp/handlers.lua index 7605d34..a4101fc 100644 --- a/lua/user/lsp/handlers.lua +++ b/lua/user/lsp/handlers.lua @@ -60,7 +60,11 @@ local function lsp_keymaps(bufnr) keymap(bufnr, "n", "gI", "lua vim.lsp.buf.implementation()", opts) keymap(bufnr, "n", "gr", "lua vim.lsp.buf.references()", opts) keymap(bufnr, "n", "gl", "lua vim.diagnostic.open_float()", opts) + keymap(bufnr, "n", "lf", "lua vim.lsp.buf.format{ async = true }", opts) + keymap(bufnr, "v", "lf", "'<,'>lua vim.lsp.buf.format()", opts) + keymap(bufnr, "x", "lf", "'<,'>lua vim.lsp.buf.format()", opts) + keymap(bufnr, "n", "li", "LspInfo", opts) keymap(bufnr, "n", "lI", "LspInstallInfo", opts) keymap(bufnr, "n", "la", "lua vim.lsp.buf.code_action()", opts) diff --git a/lua/user/lsp/init.lua b/lua/user/lsp/init.lua index c8eef0f..6eb3f5f 100644 --- a/lua/user/lsp/init.lua +++ b/lua/user/lsp/init.lua @@ -3,6 +3,6 @@ if not status_ok then return end -require "user.lsp.mason" +require("user.lsp.mason") require("user.lsp.handlers").setup() -require "user.lsp.null-ls" +require("user.lsp.null-ls") diff --git a/lua/user/lsp/mason.lua b/lua/user/lsp/mason.lua index c3b9d5d..9320ceb 100644 --- a/lua/user/lsp/mason.lua +++ b/lua/user/lsp/mason.lua @@ -27,7 +27,7 @@ local settings = { require("mason").setup(settings) require("mason-lspconfig").setup({ ensure_installed = servers, - automatic_installation = true, + automatic_installation = false, }) local lspconfig_status_ok, lspconfig = pcall(require, "lspconfig") diff --git a/lua/user/plugins.lua b/lua/user/plugins.lua index 7d394f6..8a41818 100644 --- a/lua/user/plugins.lua +++ b/lua/user/plugins.lua @@ -112,6 +112,8 @@ return packer.startup(function(use) -- VimSpector use { "puremourning/vimspector" } + use { "j-hui/fidget.nvim", commit = "1097a86db8ba38e390850dc4035a03ed234a4673" } + -- Automatically set up your configuration after cloning packer.nvim -- Put this at the end after all plugins if PACKER_BOOTSTRAP then