diff --git a/modules/nixvim/auto-save.nix b/modules/nixvim/auto-save.nix index 0844ec58..732944ba 100644 --- a/modules/nixvim/auto-save.nix +++ b/modules/nixvim/auto-save.nix @@ -4,10 +4,7 @@ settings.condition = '' function(buf) - local excluded_filetypes = { - "harpoon", - "oil", - } + local excluded_filetypes = {} local excluded_filenames = {} diff --git a/modules/nixvim/edit-alternate/config.nix b/modules/nixvim/edit-alternate/config.nix deleted file mode 100644 index 7adefaa0..00000000 --- a/modules/nixvim/edit-alternate/config.nix +++ /dev/null @@ -1,71 +0,0 @@ -{ - flake.modules.nixvim.custom.extraConfigLua = '' - local add_rule = function(ft, fn) - vim.fn["edit_alternate#rule#add"](ft, fn) - end - - add_rule("go", function(filename) - return filename:find "_test%.go$" - and filename:gsub("_test%.go$", ".go") - or filename:gsub("%.go$", "_test.go") - end) - - add_rule("php", function(filename) - if filename:find "Test.php$" then - filename = filename:gsub("Test.php$", ".php") - - return filename:find "tests/src/" - and filename:gsub("tests/src/(.-)/", "src/") - or filename:gsub("tests/", "src/") - else - local test_filename = filename:gsub("%.php$", "Test.php") - - if test_filename:find "modules/custom" then - local test_types = { "Functional", "FunctionalJavaScript", "Kernel", "Unit" } - - for _, test_type in ipairs(test_types) do - local candidate = test_filename:gsub("src/", string.format("tests/src/%s/", test_type)) - - if vim.fn.filereadable(candidate) == 1 then - return candidate - end - end - end - - return test_filename - end - end) - - add_rule("ts", function(filename) - return filename:gsub("%.stories.ts$", ".tsx") - end) - - add_rule("tsx", function(filename) - if filename:find("%.stories.tsx$") then - return filename:gsub("%.stories.tsx$", ".tsx") - end - - return filename:gsub("%.tsx$", ".stories.tsx") - end) - - if vim.fn.filereadable "composer.json" == 1 then - add_rule("json", function(filename) - return filename:find "composer.json" and filename:gsub("%.json$", ".lock") or nil - end) - - add_rule("lock", function(filename) - return filename:find "composer.lock" and filename:gsub("%.lock$", ".json") or nil - end) - end - - if vim.fn.filereadable "fractal.config.js" == 1 then - add_rule("twig", function(filename) - return filename:gsub("%.twig$", ".config.yml") - end) - - add_rule("yml", function(filename) - return filename:gsub("%.config.yml$", ".twig") - end) - end - ''; -} diff --git a/modules/nixvim/edit-alternate/extra-plugins.nix b/modules/nixvim/edit-alternate/extra-plugins.nix deleted file mode 100644 index ca795f18..00000000 --- a/modules/nixvim/edit-alternate/extra-plugins.nix +++ /dev/null @@ -1,31 +0,0 @@ -{ inputs, ... }: - -{ - flake.modules.nixvim.custom = - { pkgs, ... }: - { - extraPlugins = - let - inherit (pkgs.vimUtils) buildVimPlugin; - in - [ - (buildVimPlugin { - pname = "conf-vim"; - src = inputs.conf-vim; - version = "unstable"; - }) - - (buildVimPlugin { - pname = "edit-alternate-vim"; - src = inputs.edit-alternate-vim; - version = "unstable"; - }) - - (buildVimPlugin { - pname = "standard-vim"; - src = inputs.standard-vim; - version = "unstable"; - }) - ]; - }; -} diff --git a/modules/nixvim/edit-alternate/keymaps.nix b/modules/nixvim/edit-alternate/keymaps.nix deleted file mode 100644 index fa375bab..00000000 --- a/modules/nixvim/edit-alternate/keymaps.nix +++ /dev/null @@ -1,9 +0,0 @@ -{ - flake.modules.nixvim.custom.keymaps = [ - { - action = "EditAlternate"; - key = "ea"; - mode = "n"; - } - ]; -} diff --git a/modules/nixvim/fugitive.nix b/modules/nixvim/fugitive.nix deleted file mode 100644 index ac800972..00000000 --- a/modules/nixvim/fugitive.nix +++ /dev/null @@ -1,18 +0,0 @@ -{ - flake.modules.nixvim.custom = { - plugins.fugitive.enable = true; - - keymaps = [ - { - key = "gc"; - action = "Git commitK"; - } - - { - # Open the ":Git" window in its own buffer, not a split. - key = "gs"; - action = "0Git"; - } - ]; - }; -} diff --git a/modules/nixvim/harpoon.nix b/modules/nixvim/harpoon.nix deleted file mode 100644 index 830b1f42..00000000 --- a/modules/nixvim/harpoon.nix +++ /dev/null @@ -1,45 +0,0 @@ -let - leaderBinding = key: command: { - key = "${key}"; - action = "${command}"; - options.silent = true; - }; -in -{ - flake.modules.nixvim.custom = { - plugins.harpoon = { - enable = true; - enableTelescope = true; - }; - - keymaps = [ - { - key = "a"; - action.__raw = "function() require'harpoon':list():add() end"; - } - - { - key = ""; - action.__raw = '' - function() - require 'harpoon'.ui:toggle_quick_menu(require'harpoon':list()) - end - ''; - } - ] - ++ (map - (num: leaderBinding "${toString num}" "lua require(\"harpoon\"):list():select(${toString num})") - [ - 1 - 2 - 3 - 4 - 5 - 6 - 7 - 8 - 9 - ] - ); - }; -} diff --git a/modules/nixvim/oil.nix b/modules/nixvim/oil.nix deleted file mode 100644 index 2a022eea..00000000 --- a/modules/nixvim/oil.nix +++ /dev/null @@ -1,23 +0,0 @@ -{ - flake.modules.nixvim.custom = { - plugins.oil = { - enable = true; - - settings = { - delete_to_trash = true; - - keymaps."-" = "actions.parent"; - - skip_confirm_for_simple_edits = true; - view_options.show_hidden = true; - }; - }; - - keymaps = [ - { - action = "Oil"; - key = "-"; - } - ]; - }; -} diff --git a/modules/nixvim/vim-dadbod.nix b/modules/nixvim/vim-dadbod.nix deleted file mode 100644 index 1ef2050d..00000000 --- a/modules/nixvim/vim-dadbod.nix +++ /dev/null @@ -1,7 +0,0 @@ -{ - flake.modules.nixvim.custom.plugins = { - vim-dadbod.enable = true; - vim-dadbod-completion.enable = true; - vim-dadbod-ui.enable = true; - }; -} diff --git a/modules/nixvim/vim-heritage.nix b/modules/nixvim/vim-heritage.nix deleted file mode 100644 index 2ff64c26..00000000 --- a/modules/nixvim/vim-heritage.nix +++ /dev/null @@ -1,25 +0,0 @@ -{ inputs, ... }: - -{ - flake.modules.nixvim.custom = - { pkgs, ... }: - { - extraPlugins = [ - (pkgs.vimUtils.buildVimPlugin { - src = inputs.vim-heritage; - pname = "vim-heritage"; - version = "unstable"; - }) - ]; - - keymaps = [ - # https://github.com/jessarcher/vim-heritage/blob/574baeb0679681a710adce5110a0d8b2ae1c2637/README.md#L28-L33 - { - action = ":edit %:h/"; - key = "gf"; - mode = "n"; - options.silent = true; - } - ]; - }; -} diff --git a/modules/nixvim/vim-test.nix b/modules/nixvim/vim-test.nix deleted file mode 100644 index 5ec7a29c..00000000 --- a/modules/nixvim/vim-test.nix +++ /dev/null @@ -1,20 +0,0 @@ -{ - flake.modules.nixvim.custom = { - plugins.vim-test.enable = true; - - keymaps = [ - { - key = "tf"; - action = "TestFile"; - } - { - key = "tl"; - action = "TestLast"; - } - { - key = "tn"; - action = "TestNearest"; - } - ]; - }; -}