diff --git a/config/default.nix b/config/default.nix index fe71607..23e898e 100644 --- a/config/default.nix +++ b/config/default.nix @@ -28,6 +28,7 @@ ./plugins/lsp/lsp.nix # Git + ./plugins/git/fugitive.nix ./plugins/git/gitsigns.nix ./plugins/git/lazygit.nix diff --git a/config/plugins/git/fugitive.nix b/config/plugins/git/fugitive.nix new file mode 100644 index 0000000..2e07407 --- /dev/null +++ b/config/plugins/git/fugitive.nix @@ -0,0 +1,8 @@ +{ ... }: + +{ + plugins.fugitive = { + enable = true; + }; +} + diff --git a/config/plugins/git/lazygit.nix b/config/plugins/git/lazygit.nix index d3e31d4..8add97d 100644 --- a/config/plugins/git/lazygit.nix +++ b/config/plugins/git/lazygit.nix @@ -8,10 +8,25 @@ keymaps = [ { mode = "n"; - key = "lg"; + key = "gg"; action = "LazyGit"; - options.desc = "LazyGit"; + options = { + desc = "Open LazyGit"; + }; + } + + { + mode = "n"; + key = "lr"; + action = "lua require(\"telescope\").extensions.lazygit.lazygit()"; + options = { + desc = "List repositories"; + }; } ]; + + extraConfigLua = '' + require("telescope").load_extension("lazygit") + ''; } diff --git a/config/plugins/utils/telescope.nix b/config/plugins/utils/telescope.nix index f261d60..2f90d2a 100644 --- a/config/plugins/utils/telescope.nix +++ b/config/plugins/utils/telescope.nix @@ -19,40 +19,77 @@ # Configure our telescope keymaps. keymaps = { + # File Pickers "ff" = { action = "find_files"; options = { desc = "Find project files"; }; }; - "fb" = { - action = "buffers"; - options = { - desc = "Find open buffers"; - }; - }; "/" = { action = "live_grep"; options = { desc = "Grep (root dir)"; }; }; + + # Vim Pickers + "fb" = { + action = "buffers"; + options = { + desc = "Find open buffers"; + }; + }; ":" = { action = "command_history"; options = { desc = "Command History"; }; }; - "p" = { - action = "neoclip"; - options.desc = "Persistent Clipboard"; - }; "sc" = { action = "commands"; options = { desc = "Search Commands"; }; }; + + # Git Pickers + "lc" = { + action = "git_bcommits"; + options = { + desc = "List buffers commits"; + }; + }; + "lC" = { + action = "git_commits"; + options = { + desc = "List git commits"; + }; + }; + "lb" = { + action = "git_branches"; + options = { + desc = "List git branches"; + }; + }; + "ld" = { + action = "git_status"; + options = { + desc = "List git diff"; + }; + }; + "ls" = { + action = "git_stash"; + options = { + desc = "List git stash"; + }; + }; + + # Extensions + "p" = { + action = "neoclip"; + options.desc = "Persistent Clipboard"; + }; "sl" = { action = "software-licenses find"; options = { diff --git a/config/plugins/utils/whichkey.nix b/config/plugins/utils/whichkey.nix index f21af21..5013e50 100644 --- a/config/plugins/utils/whichkey.nix +++ b/config/plugins/utils/whichkey.nix @@ -4,5 +4,80 @@ plugins.which-key = { enable = true; }; + + # Prefixes, No operation. + keymaps = [ + { + mode = "n"; + key = "f"; + action = ""; + options = { + desc = "+find/files"; + }; + } + + { + mode = "n"; + key = "s"; + action = ""; + options = { + desc = "+search"; + }; + } + + { + mode = "n"; + key = "h"; + action = ""; + options = { + desc = "+hunks"; + }; + } + + { + mode = "n"; + key = "t"; + action = ""; + options = { + desc = "+toggle"; + }; + } + + { + mode = "n"; + key = "b"; + action = ""; + options = { + desc = "+buffer"; + }; + } + + { + mode = [ "n" "v" ]; + key = "c"; + action = ""; + options = { + desc = "+comment"; + }; + } + + { + mode = "n"; + key = "g"; + action = ""; + options = { + desc = "+git"; + }; + } + + { + mode = "n"; + key = "l"; + action = ""; + options = { + desc = "+list"; + }; + } + ]; }