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";
command =
''
@ -128,17 +128,17 @@
'';
}
{
name = "nixos-switch";
name = "apply";
help = "wrapper for nixos-rebuild switch";
command = "sudo nixos-rebuild switch --flake . $@";
}
{
name = "nixos-test";
name = "test";
help = "wrapper for nixos-rebuild switch";
command = "sudo nixos-rebuild test --flake . $@";
}
{
name = "nixos-boot";
name = "boot";
help = "wrapper for nixos-rebuild switch";
command = "sudo nixos-rebuild boot --flake . $@";
}

View File

@ -31,13 +31,12 @@ with builtins;
}
{
plugin = trouble-nvim;
cmd = [ "TodoTelescope" ];
keys = [
{ key = "<leader>xx"; 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>xl"; cmd = "<cmd>TroubleToggle loclist<cr>"; desc = "Location List (Trouble)"; }
{ key = "<leader>xq"; 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>cD"; cmd = "<cmd>TroubleToggle document_diagnostics<cr>"; desc = "Document Diagnostics (Trouble)"; }
{ key = "<leader>cW"; cmd = "<cmd>TroubleToggle workspace_diagnostics<cr>"; desc = "Workspace Diagnostics (Trouble)"; }
{ key = "<leader>cl"; cmd = "<cmd>TroubleToggle loclist<cr>"; desc = "Location List (Trouble)"; }
{ key = "<leader>cq"; cmd = "<cmd>TroubleToggle quickfix<cr>"; desc = "Quickfix List (Trouble)"; }
{ key = "<leader>ft"; cmd = "<cmd>TodoTelescope<cr>"; desc = "Todo"; }
{
key = "[q";
@ -223,7 +222,7 @@ with builtins;
];
cmd = [ "Telekasten" ];
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;
}
@ -268,26 +267,18 @@ with builtins;
{
plugin = refactoring-nvim;
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>rv"; cmd = ": Refactor extract_var "; desc = "Extract variable"; mode = [ "x" ]; }
{ key = "<leader>ri"; cmd = ": Refactor inline_var"; desc = "Inline variable"; mode = [ "n" "x" ]; }
{ key = "<leader>rI"; cmd = ": Refactor inline_func"; desc = "Inline function"; mode = [ "n" "x" ]; }
{ 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" ]; }
{
key = "<leader>cR";
cmd = "<cmd>lua require('telescope').extensions.refactoring.refactors()<cr>";
desc = "Refactor";
mode = [ "x" "n" ];
}
];
dependencies = [
{ plugin = which-key-nvim; }
{ plugin = plenary-nvim; }
{ plugin = nvim-lspconfig; }
];
init = /* lua */ ''
require("which-key").register({
["<leader>r"] = {
name = "refactoring",
},
})
'';
opts = { };
}
{
@ -295,12 +286,22 @@ with builtins;
keys = [
{ 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>h1"; 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>h3"; 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>1"; cmd = "<cmd>lua require('harpoon.ui').nav_file(1)<cr>"; desc = "Harpoon file 1"; }
{ key = "<leader>2"; cmd = "<cmd>lua require('harpoon.ui').nav_file(2)<cr>"; desc = "Harpoon file 2"; }
{ key = "<leader>3"; cmd = "<cmd>lua require('harpoon.ui').nav_file(3)<cr>"; desc = "Harpoon file 3"; }
{ key = "<leader>4"; cmd = "<cmd>lua require('harpoon.ui').nav_file(4)<cr>"; desc = "Harpoon file 4"; }
];
opts = { };
init = /* lua */ ''
require("which-key").register({
["<leader>h"] = {
name = "harpoon",
},
})
'';
dependencies = [
{ plugin = which-key-nvim; }
];
}
{
plugin = nvim-puppeteer;
@ -308,7 +309,6 @@ with builtins;
}
{
plugin = neotest;
lazy = false;
keys = [
{ key = "<leader>ct"; cmd = "<cmd>lua require('neotest').summary.toggle()<cr>"; desc = "Test"; }
];
@ -317,12 +317,7 @@ with builtins;
{ plugin = FixCursorHold-nvim; }
# adapters
{
plugin = neotest-python;
conf = /* lua */ ''
vim.opt.runtimepath:append("${neotest-python}")
'';
}
{ plugin = neotest-python; }
];
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
null_ls.builtins.code_actions.shellcheck,
null_ls.builtins.code_actions.statix,
-- Completion
null_ls.builtins.completion.spell,
-- Diagnostics
null_ls.builtins.diagnostics.checkmake,
null_ls.builtins.diagnostics.deadnix,
@ -19,19 +17,3 @@ null_ls.setup({
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",
},
["<leader>"] = {
l = {
name = "lsp",
d = { vim.diagnostic.open_float, "Open diagnostic window" },
c = {
name = "code",
c = { require("actions-preview").code_actions, "Code action", mode = { "v", "n" } },
r = {
function()

View File

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

View File

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