Compare commits

..

No commits in common. "a92ca84142d7d73e1352c4745c9ed14c05a9d809" and "abaa7119e7ba773045e66be0884796b323919346" have entirely different histories.

10 changed files with 216 additions and 234 deletions

View file

@ -14,11 +14,11 @@
] ]
}, },
"locked": { "locked": {
"lastModified": 1720546205, "lastModified": 1718371084,
"narHash": "sha256-boCXsjYVxDviyzoEyAk624600f3ZBo/DKtUdvMTpbGY=", "narHash": "sha256-abpBi61mg0g+lFFU0zY4C6oP6fBwPzbHPKBGw676xsA=",
"owner": "ryantm", "owner": "ryantm",
"repo": "agenix", "repo": "agenix",
"rev": "de96bd907d5fbc3b14fc33ad37d1b9a3cb15edc6", "rev": "3a56735779db467538fb2e577eda28a9daacaca6",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -73,11 +73,11 @@
] ]
}, },
"locked": { "locked": {
"lastModified": 1719994518, "lastModified": 1717285511,
"narHash": "sha256-pQMhCCHyQGRzdfAkdJ4cIWiw+JNuWsTX7f0ZYSyz0VY=", "narHash": "sha256-iKzJcpdXih14qYVcZ9QC9XuZYnPc6T8YImb6dX166kw=",
"owner": "hercules-ci", "owner": "hercules-ci",
"repo": "flake-parts", "repo": "flake-parts",
"rev": "9227223f6d922fee3c7b190b2cc238a99527bbb7", "rev": "2a55567fcf15b1b1c7ed712a2c6fadaec7412ea8",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -136,11 +136,11 @@
] ]
}, },
"locked": { "locked": {
"lastModified": 1721135958, "lastModified": 1719438532,
"narHash": "sha256-H548rpPMsn25LDKn1PCFmPxmWlClJJGnvdzImHkqjuY=", "narHash": "sha256-/Vmso2ZMoFE3M7d1MRsQ2K5sR8CVKnrM6t1ys9Xjpz4=",
"owner": "nix-community", "owner": "nix-community",
"repo": "home-manager", "repo": "home-manager",
"rev": "afd2021bedff2de92dfce0e257a3d03ae65c603d", "rev": "1a4f12ae0bda877ec4099b429cf439aad897d7e9",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -152,11 +152,11 @@
}, },
"nixpkgs": { "nixpkgs": {
"locked": { "locked": {
"lastModified": 1721379653, "lastModified": 1719254875,
"narHash": "sha256-8MUgifkJ7lkZs3u99UDZMB4kbOxvMEXQZ31FO3SopZ0=", "narHash": "sha256-ECni+IkwXjusHsm9Sexdtq8weAq/yUyt1TWIemXt3Ko=",
"owner": "NixOS", "owner": "NixOS",
"repo": "nixpkgs", "repo": "nixpkgs",
"rev": "1d9c2c9b3e71b9ee663d11c5d298727dace8d374", "rev": "2893f56de08021cffd9b6b6dfc70fd9ccd51eb60",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -168,11 +168,11 @@
}, },
"nur": { "nur": {
"locked": { "locked": {
"lastModified": 1721501106, "lastModified": 1719564461,
"narHash": "sha256-l07m6qFbYIIPJ9NXdojW/3Fiqt5Lvf5SpGHxjf9iNcA=", "narHash": "sha256-wCFs1sf1tPoV3nCG5N5KaakAKm88FyzN6pRdOsOqNZg=",
"owner": "nix-community", "owner": "nix-community",
"repo": "NUR", "repo": "NUR",
"rev": "db1971dfc68be28c8facb357738f7133ef275c4f", "rev": "7369862c4a8f293f6fde79044369dad7dfc04798",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -194,11 +194,11 @@
] ]
}, },
"locked": { "locked": {
"lastModified": 1721042469, "lastModified": 1719259945,
"narHash": "sha256-6FPUl7HVtvRHCCBQne7Ylp4p+dpP3P/OYuzjztZ4s70=", "narHash": "sha256-F1h+XIsGKT9TkGO3omxDLEb/9jOOsI6NnzsXFsZhry4=",
"owner": "cachix", "owner": "cachix",
"repo": "pre-commit-hooks.nix", "repo": "pre-commit-hooks.nix",
"rev": "f451c19376071a90d8c58ab1a953c6e9840527fd", "rev": "0ff4381bbb8f7a52ca4a851660fc7a437a4c6e07",
"type": "github" "type": "github"
}, },
"original": { "original": {

View file

@ -21,12 +21,12 @@ in
}; };
iconTheme = { iconTheme = {
package = pkgs.gnome-themes-extra; package = pkgs.gnome.gnome-themes-extra;
name = "Adwaita"; name = "Adwaita";
}; };
theme = { theme = {
package = pkgs.gnome-themes-extra; package = pkgs.gnome.gnome-themes-extra;
name = "Adwaita"; name = "Adwaita";
}; };
}; };

View file

@ -1,7 +1,7 @@
local wk = require("which-key") local wk = require("which-key")
local keys = { local keys = {
{ "<leader><leader>", "<cmd>nohls<CR>", desc = "Clear search highlight" }, ["<leader>"] = { "<cmd>nohls<CR>", "Clear search highlight" },
} }
wk.add(keys) wk.register(keys, { prefix = "<leader>" })

View file

@ -3,124 +3,126 @@ local wk = require("which-key")
local lsp = require("ambroisie.lsp") local lsp = require("ambroisie.lsp")
local keys = { local keys = {
-- Previous -- Edition and navigation mappins
{ "[", group = "Previous" }, ["["] = {
-- Edition and navigation mappings name = "Previous",
{ "[<space>", desc = "Insert blank line above" }, ["<space>"] = "Insert blank line above",
{ "[<C-L>", desc = "Previous location list file" }, ["<C-L>"] = "Previous location list file",
{ "[<C-Q>", desc = "Previous quickfix list file" }, ["<C-Q>"] = "Previous quickfix list file",
{ "[<C-T>", desc = "Previous tag in preview window" }, ["<C-T>"] = "Previous tag in preview window",
{ "[a", desc = "Previous argument" }, a = "Previous argument",
{ "[A", desc = "First argument" }, A = "First argument",
{ "[b", desc = "Previous buffer" }, b = "Previous buffer",
{ "[B", desc = "First buffer" }, B = "First buffer",
{ "[e", desc = "Exchange previous line" }, e = "Exchange previous line",
{ "[f", desc = "Previous file in directory" }, f = "Previous file in directory",
{ "[l", desc = "Previous location list entry" }, l = "Previous location list entry",
{ "[L", desc = "First Location list entry" }, L = "First Location list entry",
{ "[n", desc = "Previous conflict marker/diff hunk" }, n = "Previous conflict marker/diff hunk",
{ "[p", desc = "Paste line above" }, p = "Paste line above",
{ "[P", desc = "Paste line above" }, P = "Paste line above",
{ "[q", desc = "Previous quickfix list entry" }, q = "Previous quickfix list entry",
{ "[Q", desc = "First quickfix list entry" }, Q = "First quickfix list entry",
{ "[t", desc = "Previous matching tag" }, t = "Previous matching tag",
{ "[T", desc = "First matching tag" }, T = "First matching tag",
{ "[z", desc = "Previous fold" }, z = "Previous fold",
-- Encoding -- Encoding
{ "[C", desc = "C string encode" }, C = "C string encode",
{ "[u", desc = "URL encode" }, u = "URL encode",
{ "[x", desc = "XML encode" }, x = "XML encode",
{ "[y", desc = "C string encode" }, y = "C string encode",
-- Custom -- Custom
{ "[d", lsp.goto_prev_diagnostic, desc = "Previous diagnostic" }, d = { lsp.goto_prev_diagnostic, "Previous diagnostic" },
},
-- Next ["]"] = {
{ "]", group = "Next" }, name = "Next",
-- Edition and navigation mappings ["<space>"] = "Insert blank line below",
{ "]<space>", desc = "Insert blank line below" }, ["<C-L>"] = "Next location list file",
{ "]<C-L>", desc = "Next location list file" }, ["<C-Q>"] = "Next quickfix list file",
{ "]<C-Q>", desc = "Next quickfix list file" }, ["<C-T>"] = "Next tag in preview window",
{ "]<C-T>", desc = "Next tag in preview window" }, a = "Next argument",
{ "]a", desc = "Next argument" }, A = "Last argument",
{ "]A", desc = "Last argument" }, b = "Next buffer",
{ "]b", desc = "Next buffer" }, B = "Last buffer",
{ "]B", desc = "Last buffer" }, e = "Exchange next line",
{ "]e", desc = "Exchange next line" }, f = "Next file in directory",
{ "]f", desc = "Next file in directory" }, l = "Next location list entry",
{ "]l", desc = "Next location list entry" }, L = "Last Location list entry",
{ "]L", desc = "Last Location list entry" }, n = "Next conflict marker/diff hunk",
{ "]n", desc = "Next conflict marker/diff hunk" }, p = "Paste line below",
{ "]p", desc = "Paste line below" }, P = "Paste line below",
{ "]P", desc = "Paste line below" }, q = "Next quickfix list entry",
{ "]q", desc = "Next quickfix list entry" }, Q = "Last quickfix list entry",
{ "]Q", desc = "Last quickfix list entry" }, t = "Next matching tag",
{ "]t", desc = "Next matching tag" }, T = "Last matching tag",
{ "]T", desc = "Last matching tag" }, z = "Next fold",
{ "]z", desc = "Next fold" },
-- Decoding -- Decoding
{ "]C", desc = "C string decode" }, C = "C string decode",
{ "]u", desc = "URL decode" }, u = "URL decode",
{ "]x", desc = "XML decode" }, x = "XML decode",
{ "]y", desc = "C string decode" }, y = "C string decode",
-- Custom -- Custom
{ "]d", lsp.goto_next_diagnostic, desc = "Next diagnostic" }, d = { lsp.goto_next_diagnostic, "Next diagnostic" },
},
-- Enable option -- Option mappings
{ "[o", desc = "Enable option" }, ["[o"] = {
{ "[ob", desc = "Light background" }, name = "Enable option",
{ "[oc", desc = "Cursor line" }, b = "Light background",
{ "[od", desc = "Diff" }, c = "Cursor line",
{ "[of", "<cmd>FormatEnable<CR>", desc = "LSP Formatting" }, d = "Diff",
{ "[oh", desc = "Search high-lighting" }, f = { "<cmd>FormatEnable<CR>", "LSP Formatting" },
{ "[oi", desc = "Case insensitive search" }, h = "Search high-lighting",
{ "[ol", desc = "List mode" }, i = "Case insensitive search",
{ "[on", desc = "Line numbers" }, l = "List mode",
{ "[or", desc = "Relative line numbers" }, n = "Line numbers",
{ "[op", "<cmd>lwindow<CR>", desc = "Location list" }, r = "Relative line numbers",
{ "[oq", "<cmd>cwindow<CR>", desc = "Quickfix list" }, p = { "<cmd>lwindow<CR>", "Location list" },
{ "[ou", desc = "Cursor column" }, q = { "<cmd>cwindow<CR>", "Quickfix list" },
{ "[ov", desc = "Virtual editing" }, u = "Cursor column",
{ "[ow", desc = "Text wrapping" }, v = "Virtual editing",
{ "[ox", desc = "Cursor line and column" }, w = "Text wrapping",
{ "[oz", desc = "Spell checking" }, x = "Cursor line and column",
z = "Spell checking",
-- Disable option },
{ "]o", desc = "Disable option" }, ["]o"] = {
{ "]ob", desc = "Light background" }, name = "Disable option",
{ "]oc", desc = "Cursor line" }, b = "Light background",
{ "]od", desc = "Diff" }, c = "Cursor line",
{ "]of", "<cmd>FormatDisable<CR>", desc = "LSP Formatting" }, d = "Diff",
{ "]oh", desc = "Search high-lighting" }, f = { "<cmd>FormatDisable<CR>", "LSP Formatting" },
{ "]oi", desc = "Case insensitive search" }, h = "Search high-lighting",
{ "]ol", desc = "List mode" }, i = "Case insensitive search",
{ "]on", desc = "Line numbers" }, l = "List mode",
{ "]op", "<cmd>lclose<CR>", desc = "Location list" }, n = "Line numbers",
{ "]oq", "<cmd>cclose<CR>", desc = "Quickfix list" }, p = { "<cmd>lclose<CR>", "Location list" },
{ "]or", desc = "Relative line numbers" }, q = { "<cmd>cclose<CR>", "Quickfix list" },
{ "]ou", desc = "Cursor column" }, r = "Relative line numbers",
{ "]ov", desc = "Virtual editing" }, u = "Cursor column",
{ "]ow", desc = "Text wrapping" }, v = "Virtual editing",
{ "]ox", desc = "Cursor line and column" }, w = "Text wrapping",
{ "]oz", desc = "Spell checking" }, x = "Cursor line and column",
z = "Spell checking",
-- Toggle option },
{ "yo", group = "Toggle option" }, ["yo"] = {
{ "yob", desc = "Light background" }, name = "Toggle option",
{ "yoc", desc = "Cursor line" }, b = "Light background",
{ "yod", desc = "Diff" }, c = "Cursor line",
{ "yof", "<cmd>FormatToggle<CR>", desc = "LSP Formatting" }, d = "Diff",
{ "yoh", desc = "Search high-lighting" }, f = { "<cmd>FormatToggle<CR>", "LSP Formatting" },
{ "yoi", desc = "Case insensitive search" }, h = "Search high-lighting",
{ "yol", desc = "List mode" }, i = "Case insensitive search",
{ "yon", desc = "Line numbers" }, l = "List mode",
{ "yop", "<Plug>(qf_loc_toggle)", desc = "Location list" }, n = "Line numbers",
{ "yoq", "<Plug>(qf_qf_toggle)", desc = "Quickfix list" }, p = { "<Plug>(qf_loc_toggle)", "Location list" },
{ "yor", desc = "Relative line numbers" }, q = { "<Plug>(qf_qf_toggle)", "Quickfix list" },
{ "you", desc = "Cursor column" }, r = "Relative line numbers",
{ "yov", desc = "Virtual editing" }, u = "Cursor column",
{ "yow", desc = "Text wrapping" }, v = "Virtual editing",
{ "yox", desc = "Cursor line and column" }, w = "Text wrapping",
{ "yoz", desc = "Spell checking" }, x = "Cursor line and column",
z = "Spell checking",
},
} }
wk.add(keys) wk.register(keys)

View file

@ -87,30 +87,31 @@ M.on_attach = function(client, bufnr)
end end
local keys = { local keys = {
buffer = bufnr, K = { vim.lsp.buf.hover, "Show symbol information" },
-- LSP navigation ["<C-k>"] = { vim.lsp.buf.signature_help, "Show signature information" },
{ "K", vim.lsp.buf.hover, desc = "Show symbol information" }, ["gd"] = { vim.lsp.buf.definition, "Go to definition" },
{ "<C-k>", vim.lsp.buf.signature_help, desc = "Show signature information" }, ["gD"] = { vim.lsp.buf.declaration, "Go to declaration" },
{ "gd", vim.lsp.buf.definition, desc = "Go to definition" }, ["gi"] = { vim.lsp.buf.implementation, "Go to implementation" },
{ "gD", vim.lsp.buf.declaration, desc = "Go to declaration" }, ["gr"] = { vim.lsp.buf.references, "List all references" },
{ "gi", vim.lsp.buf.implementation, desc = "Go to implementation" },
{ "gr", vim.lsp.buf.references, desc = "List all references" }, ["<leader>c"] = {
-- Code name = "Code",
{ "<leader>c", group = "Code" }, a = { vim.lsp.buf.code_action, "Code actions" },
{ "<leader>ca", vim.lsp.buf.code_action, desc = "Code actions" }, d = { cycle_diagnostics_display, "Cycle diagnostics display" },
{ "<leader>cd", cycle_diagnostics_display, desc = "Cycle diagnostics display" }, D = { show_buffer_diagnostics, "Show buffer diagnostics" },
{ "<leader>cD", show_buffer_diagnostics, desc = "Show buffer diagnostics" }, r = { vim.lsp.buf.rename, "Rename symbol" },
{ "<leader>cr", vim.lsp.buf.rename, desc = "Rename symbol" }, s = { vim.lsp.buf.signature_help, "Show signature" },
{ "<leader>cs", vim.lsp.buf.signature_help, desc = "Show signature" }, t = { vim.lsp.buf.type_definition, "Go to type definition" },
{ "<leader>ct", vim.lsp.buf.type_definition, desc = "Go to type definition" }, w = {
-- Workspace name = "Workspace",
{ "<leader>cw", group = "Workspace" }, a = { vim.lsp.buf.add_workspace_folder, "Add folder to workspace" },
{ "<leader>cwa", vim.lsp.buf.add_workspace_folder, desc = "Add folder to workspace" }, l = { list_workspace_folders, "List folders in workspace" },
{ "<leader>cwl", list_workspace_folders, desc = "List folders in workspace" }, r = { vim.lsp.buf.remove_workspace_folder, "Remove folder from workspace" },
{ "<leader>cwr", vim.lsp.buf.remove_workspace_folder, desc = "Remove folder from workspace" }, },
},
} }
wk.add(keys) wk.register(keys, { buffer = bufnr })
end end
return M return M

View file

@ -34,42 +34,47 @@ gitsigns.setup({
local keys = { local keys = {
-- Navigation -- Navigation
{ "[c", utils.partial(nav_hunk, "prev"), desc = "Previous hunk/diff" }, ["[c"] = { utils.partial(nav_hunk, "prev"), "Previous hunk/diff" },
{ "]c", utils.partial(nav_hunk, "next"), desc = "Next hunk/diff" }, ["]c"] = { utils.partial(nav_hunk, "next"), "Next hunk/diff" },
-- Commands -- Commands
{ "<leader>g", group = "Git" }, ["<leader>g"] = {
{ "<leader>gb", gitsigns.toggle_current_line_blame, desc = "Toggle blame virtual text" }, name = "Git",
{ "<leader>gd", gitsigns.diffthis, desc = "Diff buffer" }, -- Actions
{ "<leader>gD", utils.partial(gitsigns.diffthis, "~"), desc = "Diff buffer against last commit" }, b = { gitsigns.toggle_current_line_blame, "Toggle blame virtual text" },
{ "<leader>gg", "<cmd>Git<CR>", desc = "Git status" }, d = { gitsigns.diffthis, "Diff buffer" },
{ "<leader>gh", gitsigns.toggle_deleted, desc = "Show deleted hunks" }, D = { utils.partial(gitsigns.diffthis, "~"), "Diff buffer against last commit" },
{ "<leader>gL", "<cmd>:sp<CR><C-w>T:Gllog --follow -- %:p<CR>", desc = "Current buffer log" }, g = { "<cmd>Git<CR>", "Git status" },
{ "<leader>gm", "<Plug>(git-messenger)", desc = "Current line blame" }, h = { gitsigns.toggle_deleted, "Show deleted hunks" },
{ "<leader>gp", gitsigns.preview_hunk, desc = "Preview hunk" }, L = { "<cmd>:sp<CR><C-w>T:Gllog --follow -- %:p<CR>", "Current buffer log" },
{ "<leader>gr", gitsigns.reset_hunk, desc = "Restore hunk" }, m = { "<Plug>(git-messenger)", "Current line blame" },
{ "<leader>gR", gitsigns.reset_buffer, desc = "Restore buffer" }, p = { gitsigns.preview_hunk, "Preview hunk" },
{ "<leader>gs", gitsigns.stage_hunk, desc = "Stage hunk" }, r = { gitsigns.reset_hunk, "Restore hunk" },
{ "<leader>gS", gitsigns.stage_buffer, desc = "Stage buffer" }, R = { gitsigns.reset_buffer, "Restore buffer" },
{ "<leader>gu", gitsigns.undo_stage_hunk, desc = "Undo stage hunk" }, s = { gitsigns.stage_hunk, "Stage hunk" },
{ "<leader>g[", gitsigns.prev_hunk, desc = "Previous hunk" }, S = { gitsigns.stage_buffer, "Stage buffer" },
{ "<leader>g]", gitsigns.next_hunk, desc = "Next hunk" }, u = { gitsigns.undo_stage_hunk, "Undo stage hunk" },
["["] = { gitsigns.prev_hunk, "Previous hunk" },
["]"] = { gitsigns.next_hunk, "Next hunk" },
},
} }
local objects = { local objects = {
mode = "o", ["ih"] = { gitsigns.select_hunk, "Git hunk" },
{ "ih", gitsigns.select_hunk, desc = "Git hunk" },
}
-- Visual
local visual = {
mode = { "x" },
{ "ih", gitsigns.select_hunk, desc = "Git hunk" },
{ "<leader>g", group = "Git" },
{ "<leader>gp", gitsigns.preview_hunk, desc = "Preview selection" },
{ "<leader>gr", make_visual(gitsigns.reset_hunk), desc = "Restore selection" },
{ "<leader>gs", make_visual(gitsigns.stage_hunk), desc = "Stage selection" },
{ "<leader>gu", gitsigns.undo_stage_hunk, desc = "Undo stage selection" },
} }
wk.add(keys) local visual = {
wk.add(objects) ["ih"] = { gitsigns.select_hunk, "Git hunk" },
wk.add(visual)
["<leader>g"] = {
name = "Git",
p = { gitsigns.preview_hunk, "Preview selection" },
r = { make_visual(gitsigns.reset_hunk), "Restore selection" },
s = { make_visual(gitsigns.stage_hunk), "Stage selection" },
u = { gitsigns.undo_stage_hunk, "Undo stage selection" },
},
}
wk.register(keys, { buffer = bufnr })
wk.register(objects, { buffer = bufnr, mode = "o" })
wk.register(visual, { buffer = bufnr, mode = "x" })

View file

@ -28,7 +28,7 @@ oil.setup({
}) })
local keys = { local keys = {
{ "-", oil.open, desc = "Open parent directory" }, ["-"] = { oil.open, "Open parent directory" },
} }
wk.add(keys) wk.register(keys)

View file

@ -26,12 +26,14 @@ telescope.load_extension("fzf")
telescope.load_extension("lsp_handlers") telescope.load_extension("lsp_handlers")
local keys = { local keys = {
{ "<leader>f", group = "Fuzzy finder" }, f = {
{ "<leader>fb", telescope_builtin.buffers, desc = "Open buffers" }, name = "Fuzzy finder",
{ "<leader>ff", telescope_builtin.git_files, desc = "Git tracked files" }, b = { telescope_builtin.buffers, "Open buffers" },
{ "<leader>fF", telescope_builtin.find_files, desc = "Files" }, f = { telescope_builtin.git_files, "Git tracked files" },
{ "<leader>fg", telescope_builtin.live_grep, desc = "Grep string" }, F = { telescope_builtin.find_files, "Files" },
{ "<leader>fG", telescope_builtin.grep_string, desc = "Grep string under cursor" }, g = { telescope_builtin.live_grep, "Grep string" },
G = { telescope_builtin.grep_string, "Grep string under cursor" },
},
} }
wk.add(keys) wk.register(keys, { prefix = "<leader>" })

View file

@ -1,27 +1,2 @@
local wk = require("which-key") local wk = require("which-key")
wk.setup({ wk.setup()
icons = {
-- I don't like icons
mappings = false,
breadcrumb = "»",
separator = "",
group = "+",
ellipsis = "",
keys = {
Up = "",
Down = "",
Left = "",
Right = "",
C = "<C>",
M = "<M>",
D = "<D>",
S = "<S>",
CR = "<CR>",
Esc = "<Esc> ",
NL = "<NL>",
BS = "<BS>",
Space = "<space>",
Tab = "<Tab> ",
},
},
})

View file

@ -19,10 +19,7 @@ in
]; ];
programs = { programs = {
vim = { vim.defaultEditor = true; # Modal editing is life
enable = true;
defaultEditor = true; # Modal editing is life
};
zsh = { zsh = {
enable = true; # Use integrations enable = true; # Use integrations