From a48ba3f7dfe35c7ca622e63a72574134788d68c7 Mon Sep 17 00:00:00 2001 From: Gustaf Rydholm Date: Tue, 17 Jan 2023 00:08:43 +0100 Subject: Update key mappings --- fnl/plugins/editor/which-key.fnl | 144 +++------------------------------------ 1 file changed, 9 insertions(+), 135 deletions(-) (limited to 'fnl/plugins/editor/which-key.fnl') diff --git a/fnl/plugins/editor/which-key.fnl b/fnl/plugins/editor/which-key.fnl index 0b6389c..9ea8ff8 100644 --- a/fnl/plugins/editor/which-key.fnl +++ b/fnl/plugins/editor/which-key.fnl @@ -10,157 +10,31 @@ :nav true :z true :g true}} - :icons {:breadcrumb "»" :separator "" :group "+"} + :icons {:breadcrumb "»" :separator " " :group "+"} :popup_mappings {:scroll_down : :scroll_up :} :window {:border :rounded :position :bottom :winblend 0} :layout {:height {:min 4 :max 25} :width {:min 20 :max 50} :spacing 3 :align :left} - :ignore_missing true :hidden [: : : : :call :lua "^:" "^ "] :show_help true :triggers :auto :disable {:filetypes [:netrw]} :triggers_blacklist {:i [:j :k] :v [:j :k]}}) -(local mopts {:mode :n - :prefix :m - :buffer nil - :silent true - :noremap true - :nowait true}) - -(local mmappings {:a [:HarpoonAdd :Harpoon] - :d [:DiffviewFileHistory :DiffviewFileHistory] - :f [:FindFiles "Find files"] - :g ["Telescope live_grep theme=dropdown" - "Find text"] - :n [:Neogit :Neogit] - :q ["Gitsigns diffthis HEAD" "Gitsigns diff"] - :r [:HarpoonUI "Harpoon UI"] - :s [:HarpoonPrev "Harpoon Prev"] - :t [:HarpoonNext "Harpoon Next"] - :v ["lua vim.lsp.buf.rename()" :Rename] - :x ["DiffviewOpen -uno" :DiffviewOpen] - :z [:DiffviewClose :DiffviewClose]}) - -(local nopts {:mode :n - :prefix : - :buffer nil - :silent true - :noremap true - :nowait true}) - -(local find - {:name :find - :C ["Telescope commands theme=dropdown" :Commands] - :H ["Telescope highlights" :Highlights] - :R ["Telescope registers theme=dropdown" :Registers] - :S ["Telescope grep_string theme=dropdown" "Find String"] - :b ["Telescope git_branches theme=dropdown" "Checkout branch"] - :c ["Telescope colorscheme theme=dropdown" :Colorscheme] - :f [:FindFiles "Find files"] - :h ["Telescope help_tags theme=dropdown" :Help] - :k ["Telescope keymaps theme=dropdown" :Keymaps] - :l ["Telescope resume theme=dropdown" "Last Search"] - :p ["Telescope projects theme=dropdown" "Find project"] - :r ["Telescope oldfiles theme=dropdown" "Recent File"] - :t ["Telescope live_grep theme=dropdown" "Find text"]}) - -(local diagnostics {:name :diagnostics - :t [:TroubleToggle :Trouble] - :g ["Telescope diagnostics theme=dropdown" - "Telescope diagnostics"]}) - -(local git {:name :git - :R ["lua require 'gitsigns'.reset_buffer()" - "Reset Buffer"] - :b ["Telescope git_branches theme=dropdown" - "Checkout branch"] - :c ["Telescope git_commits theme=dropdown" - "Checkout commit"] - :d ["Gitsigns diffthis HEAD" :Diff] - :j ["lua require 'gitsigns'.next_hunk()" "Next Hunk"] - :k ["lua require 'gitsigns'.prev_hunk()" "Prev Hunk"] - :l ["lua require 'gitsigns'.blame_line()" :Blame] - :o ["Telescope git_status theme=dropdown" - "Open changed file"] - :p ["lua require 'gitsigns'.preview_hunk()" - "Preview Hunk"] - :r ["lua require 'gitsigns'.reset_hunk()" "Reset Hunk"] - :s ["lua require 'gitsigns'.stage_hunk()" "Stage Hunk"] - :u ["lua require 'gitsigns'.undo_stage_hunk()" - "Undo Stage Hunk"]}) - -(local lsp - {:name :lsp - :S ["Telescope lsp_dynamic_workspace_symbols" - "Workspace Symbols"] - :a ["lua vim.lsp.buf.code_action()" "Code Action"] - :f ["lua vim.lsp.buf.format { async = true }" :Format] - :i [:LspInfo :Info] - :l ["lua vim.lsp.codelens.run()" "CodeLens Action"] - :r ["lua vim.lsp.buf.rename()" :Rename] - :s ["Telescope lsp_document_symbols" "Document Symbols"]}) - -(local replace {:name :replace - :m [:ReplaceInBuf "Replace in Buffer"] - :n [:Replace :Replace] - :e [:ReplaceWord "Replace Word"]}) - -(local session - {:name :session - :m [:RestoreSession "Restore session"] - :n [:RestoreLastSession "Restore last session"] - :e [:IgnoreSession "Ignore current session"]}) - -(local treesitter - {:name :Treesitter :p [:TSPlaygroundToggle :Playground]}) - -(local nmappings {:a ["Telescope lsp_document_symbols theme=dropdown" - "Document Symbols"] - :T treesitter - : [:BufDel "Close Buffer"] - :j diagnostics - :f find - :g git - :h [:ColorizerToggle :Colorizer] - :l lsp - :m [:Mason :Mason] - :n [:SymbolsOutline "Symbols outline"] - :r replace - :s session - :t [:ToggleTerm :Terminal] - :u [:UndotreeToggle :Undotree] - :y ["Lazy home" :Home] - :z [:ZenMode "Zen Mode"]}) - -(local vopts {:mode :v - :prefix : - :buffer nil - :silent true - :noremap true - :nowait true}) - -(local gopts {:mode :n - :prefix :g - :buffer nil - :silent true - :noremap true - :nowait true}) - -(local gmappings {:a [:OrgAgendaPrompt "Open agenda prompt"] - :c [:OrgCapturePrompt "Open capture prompt"] - :m ["Telescope orgmode search_headings theme=dropdown" - "Search headings"]}) +(local groups {:mode [:n :v] + :g {:name :+git} + :j {:name :+diagnostics} + :f {:name :+find} + :l {:name :+lsp} + :r {:name :+replace} + :s {:name :+session}}) (fn setup [] (let [which-key (require :which-key)] (which-key.setup opts) - (which-key.register mmappings mopts) - (which-key.register nmappings nopts) - (which-key.register gmappings gopts))) + (which-key.register groups))) {1 :folke/which-key.nvim :event :VeryLazy -- cgit v1.2.3-70-g09d2