Cleanup plugins
Signed-off-by: Oliver Davies <oliver@oliverdavies.uk>
This commit is contained in:
parent
dda5a99605
commit
bf80ead171
10 changed files with 1 additions and 253 deletions
|
@ -4,10 +4,7 @@
|
||||||
|
|
||||||
settings.condition = ''
|
settings.condition = ''
|
||||||
function(buf)
|
function(buf)
|
||||||
local excluded_filetypes = {
|
local excluded_filetypes = {}
|
||||||
"harpoon",
|
|
||||||
"oil",
|
|
||||||
}
|
|
||||||
|
|
||||||
local excluded_filenames = {}
|
local excluded_filenames = {}
|
||||||
|
|
||||||
|
|
|
@ -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
|
|
||||||
'';
|
|
||||||
}
|
|
|
@ -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";
|
|
||||||
})
|
|
||||||
];
|
|
||||||
};
|
|
||||||
}
|
|
|
@ -1,9 +0,0 @@
|
||||||
{
|
|
||||||
flake.modules.nixvim.custom.keymaps = [
|
|
||||||
{
|
|
||||||
action = "<cmd>EditAlternate<CR>";
|
|
||||||
key = "<leader>ea";
|
|
||||||
mode = "n";
|
|
||||||
}
|
|
||||||
];
|
|
||||||
}
|
|
|
@ -1,18 +0,0 @@
|
||||||
{
|
|
||||||
flake.modules.nixvim.custom = {
|
|
||||||
plugins.fugitive.enable = true;
|
|
||||||
|
|
||||||
keymaps = [
|
|
||||||
{
|
|
||||||
key = "<leader>gc";
|
|
||||||
action = "<cmd>Git commit<CR><C-w>K";
|
|
||||||
}
|
|
||||||
|
|
||||||
{
|
|
||||||
# Open the ":Git" window in its own buffer, not a split.
|
|
||||||
key = "<leader>gs";
|
|
||||||
action = "<cmd>0Git<CR>";
|
|
||||||
}
|
|
||||||
];
|
|
||||||
};
|
|
||||||
}
|
|
|
@ -1,45 +0,0 @@
|
||||||
let
|
|
||||||
leaderBinding = key: command: {
|
|
||||||
key = "<leader>${key}";
|
|
||||||
action = "<cmd>${command}<CR>";
|
|
||||||
options.silent = true;
|
|
||||||
};
|
|
||||||
in
|
|
||||||
{
|
|
||||||
flake.modules.nixvim.custom = {
|
|
||||||
plugins.harpoon = {
|
|
||||||
enable = true;
|
|
||||||
enableTelescope = true;
|
|
||||||
};
|
|
||||||
|
|
||||||
keymaps = [
|
|
||||||
{
|
|
||||||
key = "<leader>a";
|
|
||||||
action.__raw = "function() require'harpoon':list():add() end";
|
|
||||||
}
|
|
||||||
|
|
||||||
{
|
|
||||||
key = "<C-e>";
|
|
||||||
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
|
|
||||||
]
|
|
||||||
);
|
|
||||||
};
|
|
||||||
}
|
|
|
@ -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 = "<cmd>Oil<CR>";
|
|
||||||
key = "-";
|
|
||||||
}
|
|
||||||
];
|
|
||||||
};
|
|
||||||
}
|
|
|
@ -1,7 +0,0 @@
|
||||||
{
|
|
||||||
flake.modules.nixvim.custom.plugins = {
|
|
||||||
vim-dadbod.enable = true;
|
|
||||||
vim-dadbod-completion.enable = true;
|
|
||||||
vim-dadbod-ui.enable = true;
|
|
||||||
};
|
|
||||||
}
|
|
|
@ -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/<cfile><cr>";
|
|
||||||
key = "gf";
|
|
||||||
mode = "n";
|
|
||||||
options.silent = true;
|
|
||||||
}
|
|
||||||
];
|
|
||||||
};
|
|
||||||
}
|
|
|
@ -1,20 +0,0 @@
|
||||||
{
|
|
||||||
flake.modules.nixvim.custom = {
|
|
||||||
plugins.vim-test.enable = true;
|
|
||||||
|
|
||||||
keymaps = [
|
|
||||||
{
|
|
||||||
key = "<leader>tf";
|
|
||||||
action = "<cmd>TestFile<CR>";
|
|
||||||
}
|
|
||||||
{
|
|
||||||
key = "<leader>tl";
|
|
||||||
action = "<cmd>TestLast<CR>";
|
|
||||||
}
|
|
||||||
{
|
|
||||||
key = "<leader>tn";
|
|
||||||
action = "<cmd>TestNearest<CR>";
|
|
||||||
}
|
|
||||||
];
|
|
||||||
};
|
|
||||||
}
|
|
Loading…
Add table
Add a link
Reference in a new issue