From d822cd7b6d1ff721350dbaac32915f85355c7734 Mon Sep 17 00:00:00 2001 From: "RingOfStorms (Josh)" Date: Mon, 20 May 2024 01:40:45 -0500 Subject: [PATCH] remove noice, it is not nice... | remove rustacean, just use rust_analyzer by itself it is fine as is | add fidget for lsp progress --- flake.lock | 19 +++++----- flake.nix | 9 ++--- lua/options.lua | 9 ++--- lua/plugins/cmp_autocompletion.lua | 27 ++++---------- lua/plugins/editor_lua_line.lua | 2 +- lua/plugins/editor_noice.lua | 55 ---------------------------- lua/plugins/editor_notify.lua | 33 ++++++++++++----- lua/plugins/fidget_notificaitons.lua | 7 ++++ lua/plugins/lsp.lua | 9 +++-- 9 files changed, 60 insertions(+), 110 deletions(-) delete mode 100644 lua/plugins/editor_noice.lua create mode 100644 lua/plugins/fidget_notificaitons.lua diff --git a/flake.lock b/flake.lock index 32e643f..bc88f9d 100644 --- a/flake.lock +++ b/flake.lock @@ -50,20 +50,19 @@ "type": "github" } }, - "nvim_plugin-folke/noice.nvim": { + "nvim_plugin-j-hui/fidget.nvim": { "flake": false, "locked": { - "lastModified": 1715761625, - "narHash": "sha256-m3vRKLuWrNkhHMgnpfRodTqBScaQlsIYnShsrpjKa+E=", - "owner": "folke", - "repo": "noice.nvim", - "rev": "8389ff59ec6eab87d7328a83e3f28ca96111d7b1", + "lastModified": 1712242924, + "narHash": "sha256-fZhK5opGXRRryhNpdaEPLpBq4tTibZREelXmasMLHzw=", + "owner": "j-hui", + "repo": "fidget.nvim", + "rev": "1ba38e4cbb24683973e00c2e36f53ae64da38ef5", "type": "github" }, "original": { - "owner": "folke", - "ref": "v2.0.3", - "repo": "noice.nvim", + "owner": "j-hui", + "repo": "fidget.nvim", "type": "github" } }, @@ -71,7 +70,7 @@ "inputs": { "nixpkgs": "nixpkgs", "nvim_plugin-chrisgrieser/nvim-early-retirement": "nvim_plugin-chrisgrieser/nvim-early-retirement", - "nvim_plugin-folke/noice.nvim": "nvim_plugin-folke/noice.nvim", + "nvim_plugin-j-hui/fidget.nvim": "nvim_plugin-j-hui/fidget.nvim", "rust-overlay": "rust-overlay" } }, diff --git a/flake.nix b/flake.nix index 29fbf64..869233b 100644 --- a/flake.nix +++ b/flake.nix @@ -17,10 +17,11 @@ url = "github:chrisgrieser/nvim-early-retirement"; flake = false; }; - "nvim_plugin-folke/noice.nvim" = { - url = "github:folke/noice.nvim/v2.0.3"; + "nvim_plugin-j-hui/fidget.nvim" = { + url = "github:j-hui/fidget.nvim"; flake = false; }; + }; outputs = { self, nixpkgs, ... }@inputs: @@ -61,7 +62,6 @@ "nvim_plugin-catppuccin/nvim" = catppuccin-nvim; "nvim_plugin-MunifTanjim/nui.nvim" = nui-nvim; "nvim_plugin-rcarriga/nvim-notify" = nvim-notify; - # "nvim_plugin-folke/noice.nvim" = noice-nvim; "nvim_plugin-nvim-lualine/lualine.nvim" = lualine-nvim; "nvim_plugin-folke/which-key.nvim" = which-key-nvim; "nvim_plugin-nvim-telescope/telescope.nvim" = telescope-nvim; @@ -97,7 +97,6 @@ "nvim_plugin-zbirenbaum/copilot-cmp" = copilot-cmp; "nvim_plugin-zbirenbaum/copilot.lua" = copilot-lua; "nvim_plugin-folke/neodev.nvim" = neodev-nvim; - "nvim_plugin-mrcjkb/rustaceanvim" = rustaceanvim; "nvim_plugin-Saecki/crates.nvim" = crates-nvim; "nvim_plugin-lvimuser/lsp-inlayhints.nvim" = lsp-inlayhints-nvim; "nvim_plugin-rafamadriz/friendly-snippets" = friendly-snippets; @@ -126,7 +125,7 @@ fzf # search fuzzy tree-sitter glow # markdown renderer - # curl # http requests TODO + curl # http requests # nodePackages.cspell TODO ]; diff --git a/lua/options.lua b/lua/options.lua index a741c43..6aa7fbd 100644 --- a/lua/options.lua +++ b/lua/options.lua @@ -18,8 +18,7 @@ vim.opt.timeoutlen = 300 -- line numbering, relative vim.opt.number = true -vim.wo.number = true -vim.wo.relativenumber = true +vim.opt.relativenumber = true -- Highlights the results of previous search, which is annoying when we are done searching vim.opt.hlsearch = false @@ -69,9 +68,9 @@ vim.opt.splitbelow = true vim.opt.splitright = true -- Set completeopt to have a better completion experience -vim.opt.completeopt = "menuone,noselect" +vim.opt.completeopt = "menu,menuone,noinsert,noselect" vim.diagnostic.config({ - float = { border = "single" }, + float = { border = "single" }, }) -- Minimal number of screen lines to keep above and below the cursor. @@ -85,5 +84,3 @@ vim.opt.equalalways = false -- enable colors for opacity changes vim.opt.termguicolors = true - - diff --git a/lua/plugins/cmp_autocompletion.lua b/lua/plugins/cmp_autocompletion.lua index 4e1b7d4..45c1690 100644 --- a/lua/plugins/cmp_autocompletion.lua +++ b/lua/plugins/cmp_autocompletion.lua @@ -46,8 +46,7 @@ return { luasnip.lsp_expand(args.body) end, }, - completion = { completeopt = "menu,menuone,noinsert" }, - + completion = { completeopt = "menu,menuone,noinsert,noselect" }, mapping = cmp.mapping.preset.insert({ -- Scroll the documentation window [b]ack / [f]orward [""] = cmp.mapping.scroll_docs(-4), @@ -55,17 +54,20 @@ return { [""] = cmp.mapping(function(fallback) if cmp.visible() then cmp.abort() - fallback() + if cmp.get_active_entry() == nil then + -- TODO this is still being weird... if I go into active entry then back up and press esc it causes havoc + fallback() + end else fallback() end end), + -- [""] = cmp.mapping.abort(), -- Select the [n]ext item [""] = cmp.mapping(function(fallback) if cmp.visible() then cmp.select_next_item() - -- elseif luasnip.expand_or_jumpable() then elseif luasnip.expand_or_locally_jumpable() then luasnip.expand_or_jump() else @@ -83,7 +85,7 @@ return { end end, { "i", "s" }), [""] = cmp.mapping.confirm({ select = true }), - [""] = cmp.mapping.complete({}), + [""] = cmp.mapping.complete({}), }), sources = { { @@ -107,21 +109,6 @@ return { -- Rust crates.io integration { name = "crates" }, }, - -- TODO revisit if I want these or not - -- sorting = { - -- priority_weight = 1, - -- comparators = { - -- cmp.config.compare.locality, - -- cmp.config.compare.recently_used, - -- cmp.config.compare.score, - -- cmp.config.compare.offset, - -- cmp.config.compare.order, - -- }, - -- }, - -- window = { -- also? https://github.com/RingOfStorms/nvim/blob/master/lua/plugins/lsp.lua#L330-L347 - -- completion = cmp.config.window.bordered(), - -- documentation = cmp.config.window.bordered(), - -- }, }) end, } diff --git a/lua/plugins/editor_lua_line.lua b/lua/plugins/editor_lua_line.lua index 551d6d0..0851246 100644 --- a/lua/plugins/editor_lua_line.lua +++ b/lua/plugins/editor_lua_line.lua @@ -46,7 +46,7 @@ end return { "nvim-lualine/lualine.nvim", - dependencies = { { "folke/noice.nvim", optional = true } }, + -- dependencies = { { "folke/noice.nvim", optional = true } }, lazy = false, opts = function() return { diff --git a/lua/plugins/editor_noice.lua b/lua/plugins/editor_noice.lua deleted file mode 100644 index 1a22d9d..0000000 --- a/lua/plugins/editor_noice.lua +++ /dev/null @@ -1,55 +0,0 @@ -return { - "folke/noice.nvim", - dependencies = { - "MunifTanjim/nui.nvim", - "rcarriga/nvim-notify", - { "nvim-telescope/telescope.nvim", optional = true }, - }, - event = "VeryLazy", - opts = { - route = { - routes = { - { filter = { event = "lsp" }, opts = { skip = true } }, - -- { opts = { skip = true } }, - }, - }, - -- cmdline = { - -- enabled = false, - -- }, - -- popupmenu = { - -- enabled = false, -- enables the Noice popupmenu - -- }, - -- notify = { - -- enabled = false, - -- }, - -- smart_move = { - -- enabled = false, - -- }, - messages = { - -- enabled = false, - view = "mini", -- default view for messages - view_error = "notify", -- view for errors - view_warn = "mini", -- view for warnings - view_history = "messages", -- view for :messages - view_search = false, -- view for search count messages. Set to `false` to disable - }, - lsp = { - -- override markdown rendering so that **cmp** and other plugins use **Treesitter** - override = { - ["vim.lsp.util.convert_input_to_markdown_lines"] = true, - ["vim.lsp.util.stylize_markdown"] = true, - ["cmp.entry.get_documentation"] = true, -- requires hrsh7th/nvim-cmp - }, - -- I had an issue with auto_open kicking me out of insert mode when entering insert mode - signature = { enabled = false, auto_open = { trigger = false } }, - -- hover = { enabled = false }, - -- message = { enabled = false }, - }, - }, - config = function(_, opts) - require("noice").setup(opts) - U.safeRequire("telescope", function(t) - t.load_extension("noice") - end) - end, -} diff --git a/lua/plugins/editor_notify.lua b/lua/plugins/editor_notify.lua index 624e533..9e97474 100644 --- a/lua/plugins/editor_notify.lua +++ b/lua/plugins/editor_notify.lua @@ -1,12 +1,25 @@ return { - "rcarriga/nvim-notify", - lazy = false, - priority = 150, - opts = { - top_down = false, - timeout = 5000, - }, - config = function(_, opts) - require("notify").setup(opts) - end, + "rcarriga/nvim-notify", + lazy = false, + priority = 150, + opts = { + top_down = false, + timeout = 5000, + }, + config = function(_, opts) + require("notify").setup(opts) + vim.notify = require("notify") + + U.safeRequire("telescope", function(t) + t.load_extension("notify") + end) + end, + keys = { + { + "fn", + "Telescope notify", + desc = "Telescope search notifications", + mode = { "n", "v", "x" }, + }, + }, } diff --git a/lua/plugins/fidget_notificaitons.lua b/lua/plugins/fidget_notificaitons.lua new file mode 100644 index 0000000..6bd3d5c --- /dev/null +++ b/lua/plugins/fidget_notificaitons.lua @@ -0,0 +1,7 @@ +return { + "j-hui/fidget.nvim", + event = "VeryLazy", + opts = { + }, + main = "fidget", +} diff --git a/lua/plugins/lsp.lua b/lua/plugins/lsp.lua index d19ff0b..4fe44ef 100644 --- a/lua/plugins/lsp.lua +++ b/lua/plugins/lsp.lua @@ -1,7 +1,11 @@ return { -- LSP helper plugins for various languages { "folke/neodev.nvim", event = { "BufRead *.lua", "BufRead *.vim" }, opts = {}, main = "neodev" }, - { "mrcjkb/rustaceanvim", lazy = false }, -- uses ftplugins to enable itself lazily already + -- { TODO come back to this, do I actually use any features provided here? I was losing out on rust-analyzer stuff when this was on and it was added below... + -- "mrcjkb/rustaceanvim", + -- -- uses ftplugins to enable itself lazily already + -- lazy = false, + -- }, -- TODO add some hotkeys for opening the popup menus on crates { "Saecki/crates.nvim", event = "BufRead Cargo.toml", tag = "stable", opts = {}, main = "crates" }, { @@ -106,9 +110,8 @@ return { }, }, }, + rust_analyzer = {}, nil_ls = {}, - -- TODO probably remove V - v_analyzer = { filetypes = { "vlang", "v", "vsh", "vv" } }, tsserver = { -- typescript/javascript implicitProjectConfiguration = {