From 54e55f4b6d1e8094b221a6221e892b0351bc9406 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Moritz=20B=C3=B6hme?= Date: Sun, 21 Apr 2024 11:21:46 +0200 Subject: [PATCH] feat: cleanup --- modules/programs/nvim/plugins/coding.nix | 104 ++---------------- .../programs/nvim/plugins/lua/mini-nvim.lua | 46 -------- modules/programs/nvim/plugins/treesitter.nix | 10 -- modules/programs/nvim/plugins/ui.nix | 20 ---- 4 files changed, 7 insertions(+), 173 deletions(-) diff --git a/modules/programs/nvim/plugins/coding.nix b/modules/programs/nvim/plugins/coding.nix index 8f43ca2..7f40237 100644 --- a/modules/programs/nvim/plugins/coding.nix +++ b/modules/programs/nvim/plugins/coding.nix @@ -7,65 +7,18 @@ with builtins; plugin = oil-nvim; lazy = false; opts = { }; - dependencies = [ - { plugin = which-key-nvim; } - { plugin = nvim-web-devicons; } - ]; + dependencies = [{ plugin = nvim-web-devicons; }]; + } + { + plugin = lualine-nvim; + opts = { }; + dependencies = [{ plugin = nvim-web-devicons; }]; } { plugin = mini-nvim; lazy = false; conf = readFile ./lua/mini-nvim.lua; } - { - plugin = trouble-nvim; - cmd = [ "TodoTelescope" ]; - keys = [ - { - key = "cD"; - cmd = "TroubleToggle document_diagnostics"; - desc = "Document Diagnostics (Trouble)"; - } - { - key = "cW"; - cmd = "TroubleToggle workspace_diagnostics"; - desc = "Workspace Diagnostics (Trouble)"; - } - { key = "cl"; cmd = "TroubleToggle loclist"; desc = "Location List (Trouble)"; } - { key = "cq"; cmd = "TroubleToggle quickfix"; desc = "Quickfix List (Trouble)"; } - { key = "ft"; cmd = "TodoTelescope"; desc = "Todo"; } - { - key = "[q"; - func = /* lua */ '' - function() - if require("trouble").is_open() then - require("trouble").previous({ skip_groups = true, jump = true }) - else - vim.cmd.cprev() - end - end - ''; - desc = "Previous trouble/quickfix item"; - } - { - key = "]q"; - func = /* lua */ '' - function() - if require("trouble").is_open() then - require("trouble").next({ skip_groups = true, jump = true }) - else - vim.cmd.cnext() - end - end - ''; - desc = "Next trouble/quickfix item"; - } - ]; - opts = { }; - dependencies = [ - { plugin = nvim-web-devicons; } - ]; - } { plugin = nvim-cmp; keys = [ @@ -106,6 +59,7 @@ with builtins; conf = readFile ./lua/nvim-lspconfig.lua; dependencies = [ { + # TODO: add all required tools to neovim or silence warnings plugin = pkgs.vimPlugins.null-ls-nvim.overrideAttrs (_: { version = lib.my.mkVersionInput inputs.none-ls-nvim; src = inputs.none-ls-nvim; @@ -118,17 +72,6 @@ with builtins; } { plugin = which-key-nvim; } { plugin = lsp_lines-nvim; } - { - plugin = nvim-ufo; - conf = readFile ./lua/nvim-ufo.lua; - dependencies = [ - { plugin = promise-async; } - ]; - } - { - plugin = neodev-nvim; - conf = readFile ./lua/neodev-nvim.lua; - } { plugin = inc-rename-nvim; opts = { @@ -236,39 +179,6 @@ with builtins; event = [ "BufReadPost" "BufNewFile" ]; opts = { }; } - { - plugin = zen-mode-nvim; - keys = [ - { key = "tz"; cmd = "ZenMode"; desc = "Zen mode"; } - ]; - conf = /* lua */ '' - require("zen-mode").setup({ - plugins = { - tmux = { - enabled = true, - }, - }, - }) - ''; - dependencies = [ - { - plugin = twilight-nvim; - conf = /* lua */ '' - require("twilight").setup({ - context = 20, - expand = { -- for treesitter, we we always try to expand to the top-most ancestor with these types - "function", - "function_definition", - "if_statement", - "method", - "method_definition", - "table", - }, - }) - ''; - } - ]; - } { plugin = conform-nvim; keys = [ diff --git a/modules/programs/nvim/plugins/lua/mini-nvim.lua b/modules/programs/nvim/plugins/lua/mini-nvim.lua index 2a33821..9cbe157 100644 --- a/modules/programs/nvim/plugins/lua/mini-nvim.lua +++ b/modules/programs/nvim/plugins/lua/mini-nvim.lua @@ -1,47 +1 @@ require("mini.align").setup() -require("mini.move").setup() - -require("mini.statusline").setup({ - content = { - active = function() - local mode, mode_hl = MiniStatusline.section_mode({ trunc_width = 120 }) - local git = MiniStatusline.section_git({ trunc_width = 75 }) - local diagnostics = MiniStatusline.section_diagnostics({ trunc_width = 75 }) - local filename = MiniStatusline.section_filename({ trunc_width = 140 }) - local fileinfo = MiniStatusline.section_fileinfo({ trunc_width = 120 }) - local location = MiniStatusline.section_location({ trunc_width = 75 }) - local mode_hl_inverse = mode_hl .. "Inverse" - -- Usage of `MiniStatusline.combine_groups()` ensures highlighting and - -- correct padding with spaces between groups (accounts for 'missing' - -- sections, etc.) - return MiniStatusline.combine_groups({ - { hl = mode_hl_inverse, strings = {} }, - "", - { hl = mode_hl, strings = { mode } }, - { hl = "MiniStatuslineDevinfo", strings = { git, diagnostics } }, - "%<", -- Mark general truncate point - { hl = "MiniStatuslineFilename", strings = { filename } }, - "%=", -- End left alignment - { hl = "MiniStatuslineFileinfo", strings = { fileinfo } }, - { hl = mode_hl, strings = { location } }, - { hl = mode_hl_inverse, strings = {} }, - "", - }) - end, - }, -}) -local MiniStatuslineModes = { - "MiniStatuslineModeInsert", - "MiniStatuslineModeNormal", - "MiniStatuslineModeReplace", - "MiniStatuslineModeVisual", - "MiniStatuslineModeCommand", - "MiniStatuslineModeOther", -} -for _, mode_hl in ipairs(MiniStatuslineModes) do - local hl_table = vim.api.nvim_get_hl(0, { name = mode_hl }) - local fg = hl_table.fg - hl_table.fg = hl_table.bg - hl_table.bg = fg - vim.api.nvim_set_hl(0, mode_hl .. "Inverse", hl_table) -end diff --git a/modules/programs/nvim/plugins/treesitter.nix b/modules/programs/nvim/plugins/treesitter.nix index 8401f9f..2ba777c 100644 --- a/modules/programs/nvim/plugins/treesitter.nix +++ b/modules/programs/nvim/plugins/treesitter.nix @@ -65,15 +65,5 @@ with builtins; ]; } ) - { - plugin = nvim-treesitter-textsubjects; - event = [ "BufReadPost" "BufNewFile" ]; - conf = readFile ./lua/nvim-treesitter-textsubjects.lua; - } - { - plugin = nvim-treesitter-context; - event = [ "BufReadPost" "BufNewFile" ]; - opts = { }; - } ]; } diff --git a/modules/programs/nvim/plugins/ui.nix b/modules/programs/nvim/plugins/ui.nix index c44ce9b..ccfcb3b 100644 --- a/modules/programs/nvim/plugins/ui.nix +++ b/modules/programs/nvim/plugins/ui.nix @@ -20,26 +20,6 @@ with builtins; dependencies = [{ plugin = plenary-nvim; }]; opts = { }; } - { - plugin = pkgs.vimPlugins.statuscol-nvim.overrideAttrs (_: { - version = lib.my.mkVersionInput inputs.statuscol-nvim; - src = inputs.statuscol-nvim; - }); - event = [ "VeryLazy" ]; - conf = readFile ./lua/statuscol-nvim.lua; - } - { - plugin = pkgs.vimUtils.buildVimPlugin { - pname = "smartcolumn-nvim"; - version = lib.my.mkVersionInput inputs.smartcolumn-nvim; - src = inputs.smartcolumn-nvim; - }; - event = [ "BufReadPost" "BufNewFile" ]; - opts = { - colorcolumn = "120"; - disabled_filetypes = [ "help" "text" "markdown" "dashboard" ]; - }; - } { plugin = dressing-nvim; event = [ "VeryLazy" ];