From 68c0f6bab06ea587b9b258d1ad3b0c9870bc163f Mon Sep 17 00:00:00 2001 From: Gustaf Rydholm Date: Fri, 14 Oct 2022 01:51:07 +0200 Subject: Update which key with diff and diagnostics --- fnl/config/which-key.fnl | 32 +++++++++++++++++++++++--------- 1 file changed, 23 insertions(+), 9 deletions(-) (limited to 'fnl/config') diff --git a/fnl/config/which-key.fnl b/fnl/config/which-key.fnl index 148ee29..68a8e97 100644 --- a/fnl/config/which-key.fnl +++ b/fnl/config/which-key.fnl @@ -35,12 +35,17 @@ :noremap true :nowait true}) +(def- diff {:name :Diff + :m ["Gitsigns diffthis HEAD" "Gitsigns diff"] + :n [:DiffviewFileHistory :DiffviewFileHistory] + :e ["DiffviewOpen -uno" :DiffviewOpen] + :i [:DiffviewClose :DiffviewClose]}) + (def- mmappings {:a ["lua require('harpoon.mark').add_file()" :Harpoon] :b ["lua require('telescope.builtin').buffers(require('telescope.themes').get_dropdown{sort_lastused = true, initial_mode = 'normal', previewer = false})" "Switch buffers"] - :d [:TroubleToggle :Trouble] - :D ["Telescope diagnostics theme=dropdown" "Telescope diagnostics"] + :d diff :f ["lua require('telescope.builtin').find_files(require('telescope.themes').get_dropdown{previewer = false})" "Find files"] :g ["Telescope live_grep theme=ivy" "Find text"] @@ -48,7 +53,8 @@ "Harpoon Next"] :h ["lua require('harpoon.ui').nav_prev()" "Harpoon Prev"] - :t ["Telescope harpoon marks theme=dropdown" "Search Files"] + :t ["Telescope harpoon marks theme=dropdown" + "Search Files"] :v ["lua vim.lsp.buf.rename()" :Rename] :p [:SaveSession "Save Session"] :r ["lua require('harpoon.ui').toggle_quick_menu()" @@ -63,7 +69,8 @@ :nowait true}) (def- find {:name :Find - :b ["Telescope git_branches theme=dropdown" "Checkout branch"] + :b ["Telescope git_branches theme=dropdown" + "Checkout branch"] :c ["Telescope colorscheme theme=dropdown" :Colorscheme] :f ["lua require('telescope.builtin').find_files(require('telescope.themes').get_dropdown{previewer = false})" "Find files"] @@ -78,9 +85,12 @@ :k ["Telescope keymaps" :Keymaps] :C ["Telescope commands" :Commands]}) +(def- diagnostics {:name :Diagnostics + :d [:TroubleToggle :Trouble] + :D ["Telescope diagnostics theme=dropdown" + "Telescope diagnostics"]}) + (def- git {:name :Git - :d ["Gitsigns diffthis HEAD" :Diff] - :D [:DiffviewFileHistory :DiffviewFileHistory] :j ["lua require 'gitsigns'.next_hunk()" "Next Hunk"] :k ["lua require 'gitsigns'.prev_hunk()" "Prev Hunk"] :l ["lua require 'gitsigns'.blame_line()" :Blame] @@ -90,9 +100,12 @@ :s ["lua require 'gitsigns'.stage_hunk()" "Stage Hunk"] :u ["lua require 'gitsigns'.undo_stage_hunk()" "Undo Stage Hunk"] - :o ["Telescope git_status theme=dropdown" "Open changed file"] - :b ["Telescope git_branches theme=dropdown" "Checkout branch"] - :c ["Telescope git_commits theme=dropdown" "Checkout commit"] + :o ["Telescope git_status theme=dropdown" + "Open changed file"] + :b ["Telescope git_branches theme=dropdown" + "Checkout branch"] + :c ["Telescope git_commits theme=dropdown" + "Checkout commit"] :d ["Gitsigns diffthis HEAD" :Diff]}) (def- lsp {:name :LSP @@ -137,6 +150,7 @@ (def- nmappings {:a ["Telescope lsp_document_symbols theme=dropdown" "Document Symbols"] :c [:Bdelete! "Close Buffer"] + :d diagnostics :f find :g git :h [:Alpha :Alpha] -- cgit v1.2.3-70-g09d2