Compare commits

..

4 Commits

7 changed files with 84 additions and 61 deletions

View File

@ -120,7 +120,7 @@
''; '';
} }
{ {
name = "nixos-build"; name = "build";
help = "use nom to build system"; help = "use nom to build system";
command = command =
'' ''
@ -128,17 +128,17 @@
''; '';
} }
{ {
name = "nixos-switch"; name = "apply";
help = "wrapper for nixos-rebuild switch"; help = "wrapper for nixos-rebuild switch";
command = "sudo nixos-rebuild switch --flake . $@"; command = "sudo nixos-rebuild switch --flake . $@";
} }
{ {
name = "nixos-test"; name = "test";
help = "wrapper for nixos-rebuild switch"; help = "wrapper for nixos-rebuild switch";
command = "sudo nixos-rebuild test --flake . $@"; command = "sudo nixos-rebuild test --flake . $@";
} }
{ {
name = "nixos-boot"; name = "boot";
help = "wrapper for nixos-rebuild switch"; help = "wrapper for nixos-rebuild switch";
command = "sudo nixos-rebuild boot --flake . $@"; command = "sudo nixos-rebuild boot --flake . $@";
} }

View File

@ -31,13 +31,12 @@ with builtins;
} }
{ {
plugin = trouble-nvim; plugin = trouble-nvim;
cmd = [ "TodoTelescope" ];
keys = [ keys = [
{ key = "<leader>xx"; cmd = "<cmd>TroubleToggle document_diagnostics<cr>"; desc = "Document Diagnostics (Trouble)"; } { key = "<leader>cD"; cmd = "<cmd>TroubleToggle document_diagnostics<cr>"; desc = "Document Diagnostics (Trouble)"; }
{ key = "<leader>xX"; cmd = "<cmd>TroubleToggle workspace_diagnostics<cr>"; desc = "Workspace Diagnostics (Troule)"; } { key = "<leader>cW"; cmd = "<cmd>TroubleToggle workspace_diagnostics<cr>"; desc = "Workspace Diagnostics (Trouble)"; }
{ key = "<leader>xl"; cmd = "<cmd>TroubleToggle loclist<cr>"; desc = "Location List (Trouble)"; } { key = "<leader>cl"; cmd = "<cmd>TroubleToggle loclist<cr>"; desc = "Location List (Trouble)"; }
{ key = "<leader>xq"; cmd = "<cmd>TroubleToggle quickfix<cr>"; desc = "Quickfix List (Trouble)"; } { key = "<leader>cq"; cmd = "<cmd>TroubleToggle quickfix<cr>"; desc = "Quickfix List (Trouble)"; }
{ key = "<leader>xt"; cmd = "<cmd>TodoTrouble<cr>"; desc = "Todo (Trouble)"; }
{ key = "<leader>xT"; cmd = "<cmd>TodoTrouble keywords=TODO,FIX,FIXME<cr>"; desc = "Todo/Fix/Fixme (Trouble)"; }
{ key = "<leader>ft"; cmd = "<cmd>TodoTelescope<cr>"; desc = "Todo"; } { key = "<leader>ft"; cmd = "<cmd>TodoTelescope<cr>"; desc = "Todo"; }
{ {
key = "[q"; key = "[q";
@ -223,7 +222,7 @@ with builtins;
]; ];
cmd = [ "Telekasten" ]; cmd = [ "Telekasten" ];
keys = [ keys = [
{ key = "<leader>z"; cmd = "<cmd>Telekasten<cr>"; desc = "zettelkasten"; } { key = "<leader>fz"; cmd = "<cmd>Telekasten<cr>"; desc = "Zettelkasten"; }
]; ];
conf = builtins.readFile ./lua/zettelkasten-nvim.lua; conf = builtins.readFile ./lua/zettelkasten-nvim.lua;
} }
@ -268,26 +267,18 @@ with builtins;
{ {
plugin = refactoring-nvim; plugin = refactoring-nvim;
keys = [ keys = [
{ key = "<leader>re"; cmd = ": Refactor eextract "; desc = "Extract"; mode = [ "x" ]; } {
{ key = "<leader>rf"; cmd = ": Refactor extract_to_file "; desc = "Extract to file"; mode = [ "x" ]; } key = "<leader>cR";
{ key = "<leader>rv"; cmd = ": Refactor extract_var "; desc = "Extract variable"; mode = [ "x" ]; } cmd = "<cmd>lua require('telescope').extensions.refactoring.refactors()<cr>";
{ key = "<leader>ri"; cmd = ": Refactor inline_var"; desc = "Inline variable"; mode = [ "n" "x" ]; } desc = "Refactor";
{ key = "<leader>rI"; cmd = ": Refactor inline_func"; desc = "Inline function"; mode = [ "n" "x" ]; } mode = [ "x" "n" ];
{ key = "<leader>rb"; cmd = ": Refactor extract_block"; desc = "Extract block"; mode = [ "n" ]; } }
{ key = "<leader>rbf"; cmd = ": Refactor extract_block_to_file"; desc = "Extract block to file"; mode = [ "n" ]; }
]; ];
dependencies = [ dependencies = [
{ plugin = which-key-nvim; } { plugin = which-key-nvim; }
{ plugin = plenary-nvim; } { plugin = plenary-nvim; }
{ plugin = nvim-lspconfig; } { plugin = nvim-lspconfig; }
]; ];
init = /* lua */ ''
require("which-key").register({
["<leader>r"] = {
name = "refactoring",
},
})
'';
opts = { }; opts = { };
} }
{ {
@ -295,12 +286,22 @@ with builtins;
keys = [ keys = [
{ key = "<leader>ha"; cmd = "<cmd>lua require('harpoon.mark').add_file()<cr>"; desc = "Add file"; } { key = "<leader>ha"; cmd = "<cmd>lua require('harpoon.mark').add_file()<cr>"; desc = "Add file"; }
{ key = "<leader>hh"; cmd = "<cmd>lua require('harpoon.ui').toggle_quick_menu()<cr>"; desc = "Harpoon"; } { key = "<leader>hh"; cmd = "<cmd>lua require('harpoon.ui').toggle_quick_menu()<cr>"; desc = "Harpoon"; }
{ key = "<leader>h1"; cmd = "<cmd>lua require('harpoon.ui').nav_file(1)<cr>"; desc = "Harpoon file 1"; } { key = "<leader>1"; cmd = "<cmd>lua require('harpoon.ui').nav_file(1)<cr>"; desc = "Harpoon file 1"; }
{ key = "<leader>h2"; cmd = "<cmd>lua require('harpoon.ui').nav_file(2)<cr>"; desc = "Harpoon file 2"; } { key = "<leader>2"; cmd = "<cmd>lua require('harpoon.ui').nav_file(2)<cr>"; desc = "Harpoon file 2"; }
{ key = "<leader>h3"; cmd = "<cmd>lua require('harpoon.ui').nav_file(3)<cr>"; desc = "Harpoon file 3"; } { key = "<leader>3"; cmd = "<cmd>lua require('harpoon.ui').nav_file(3)<cr>"; desc = "Harpoon file 3"; }
{ key = "<leader>h4"; cmd = "<cmd>lua require('harpoon.ui').nav_file(4)<cr>"; desc = "Harpoon file 4"; } { key = "<leader>4"; cmd = "<cmd>lua require('harpoon.ui').nav_file(4)<cr>"; desc = "Harpoon file 4"; }
]; ];
opts = { }; opts = { };
init = /* lua */ ''
require("which-key").register({
["<leader>h"] = {
name = "harpoon",
},
})
'';
dependencies = [
{ plugin = which-key-nvim; }
];
} }
{ {
plugin = nvim-puppeteer; plugin = nvim-puppeteer;
@ -308,7 +309,6 @@ with builtins;
} }
{ {
plugin = neotest; plugin = neotest;
lazy = false;
keys = [ keys = [
{ key = "<leader>ct"; cmd = "<cmd>lua require('neotest').summary.toggle()<cr>"; desc = "Test"; } { key = "<leader>ct"; cmd = "<cmd>lua require('neotest').summary.toggle()<cr>"; desc = "Test"; }
]; ];
@ -317,12 +317,7 @@ with builtins;
{ plugin = FixCursorHold-nvim; } { plugin = FixCursorHold-nvim; }
# adapters # adapters
{ { plugin = neotest-python; }
plugin = neotest-python;
conf = /* lua */ ''
vim.opt.runtimepath:append("${neotest-python}")
'';
}
]; ];
conf = readFile ./lua/neotest.lua; conf = readFile ./lua/neotest.lua;
} }

View File

@ -0,0 +1,49 @@
{ pkgs, lib, ... }:
with builtins;
{
config.home-manager.users.moritz.programs.neovim.lazy.plugins = with pkgs.vimPlugins; [
{
plugin = nvim-dap;
keys = [
{ key = "<leader>cb"; cmd = "<cmd>lua require('dap').toggle_breakpoint()<cr>"; desc = "Toggle breakpoint"; }
{ key = "<leader>cd"; cmd = "<cmd>lua require('dap').continue()<cr>"; desc = "Continue"; }
];
dependencies = [
{
plugin = nvim-dap-python;
ft = [ "python" ];
conf =
let
pythonWithDebugpy = pkgs.python3.withPackages (ps: with ps; [ debugpy ]);
in
/* lua */ ''
require("dap-python").setup("${lib.getExe pythonWithDebugpy}")
'';
}
{
plugin = nvim-dap-virtual-text;
opts = { };
}
{
plugin = nvim-dap-ui;
opts = { };
conf = /* lua */ ''
local dap = require("dap")
local dapui = require("dapui")
dapui.setup(opts)
dap.listeners.after.event_initialized["dapui_config"] = function()
dapui.open({})
end
dap.listeners.before.event_terminated["dapui_config"] = function()
dapui.close({})
end
dap.listeners.before.event_exited["dapui_config"] = function()
dapui.close({})
end
'';
}
];
}
];
}

View File

@ -5,8 +5,6 @@ null_ls.setup({
-- Code actions -- Code actions
null_ls.builtins.code_actions.shellcheck, null_ls.builtins.code_actions.shellcheck,
null_ls.builtins.code_actions.statix, null_ls.builtins.code_actions.statix,
-- Completion
null_ls.builtins.completion.spell,
-- Diagnostics -- Diagnostics
null_ls.builtins.diagnostics.checkmake, null_ls.builtins.diagnostics.checkmake,
null_ls.builtins.diagnostics.deadnix, null_ls.builtins.diagnostics.deadnix,
@ -19,19 +17,3 @@ null_ls.setup({
null_ls.builtins.diagnostics.yamllint, null_ls.builtins.diagnostics.yamllint,
}, },
}) })
-- disable (c)spell initially
null_ls.disable("spell")
-- make sources toggle able
require("which-key").register({
n = {
name = "null-ls",
s = {
function()
null_ls.toggle("spell")
end,
"spell",
},
},
}, { prefix = "<leader>t" })

View File

@ -32,9 +32,8 @@ local on_attach_def = function(client, bufnr)
"Hover", "Hover",
}, },
["<leader>"] = { ["<leader>"] = {
l = { c = {
name = "lsp", name = "code",
d = { vim.diagnostic.open_float, "Open diagnostic window" },
c = { require("actions-preview").code_actions, "Code action", mode = { "v", "n" } }, c = { require("actions-preview").code_actions, "Code action", mode = { "v", "n" } },
r = { r = {
function() function()

View File

@ -11,7 +11,7 @@ require("statuscol").setup({
click = "v:lua.ScLa", click = "v:lua.ScLa",
}, },
{ {
sign = { name = { "GitSigns" }, auto = true }, sign = { namespace = { "gitsigns*" }, auto = true },
click = "v:lua.ScSa", click = "v:lua.ScSa",
}, },
{ {

View File

@ -35,11 +35,9 @@ require("which-key").register({
["<leader>"] = { ["<leader>"] = {
f = { name = "file/find" }, f = { name = "file/find" },
g = { name = "git" }, g = { name = "git" },
l = { name = "lsp" }, c = { name = "code" },
o = { name = "org" },
s = { name = "search" }, s = { name = "search" },
t = { name = "toggle" }, t = { name = "toggle" },
x = { name = "diagnostics/quickfix" },
}, },
["["] = { name = "prev" }, ["["] = { name = "prev" },
["]"] = { name = "next" }, ["]"] = { name = "next" },