(local nvim (require :lib/nvim)) (local wk (require :which-key)) ;; Convenient way to indent stuff in visual mode (nvim.keymap [:v] "<" "" ">gv" {:noremap true}) (nvim.keymap [:n] "" "" {:noremap true :silent true}) (vim.api.nvim_create_user_command "FTermToggle" (fn [_] ((-> (require :FTerm) (. :toggle)))) {:bang true}) (nvim.keymap [:t] "" ":FTermToggle") (nvim.keymap [:n] "" ":FTermToggle" {:nnoremap true}) (local normal-map-leader {"t" [":Neotree toggle" "Toggle neo-tree"] "w" [":w" "Write file"] "q" [":q" "Quit"] "r" [":RainbowParenthesesToggleAll" "Toggle Rainbow Parens"] ; Telescope "f" {:name "Files" :f ["Telescope find_files" "Find Files (in Telescope)"] :g ["Telescope live_grep" "Find Grep (in Telescope)"] :b ["Telescope buffers" "Find Buffers"] :h ["Telescope help_tags" "Find Help"] :t ["Telescope tags" "Find Tags"] :r ["Telescope oldfiles" "Recent files"]} ; Git "g" {:name "Git" "s" [":G" "Git Status"] "f" [":G fetch --all" "Git Fetch"] "b" [":GBranches" "Git Branch"] "p" [":Git! push" "Git Push"] "d" [":GDiff" "Git Diff"] "h" ["" "Commit Hunk under Cursor"]} ; nmap gl :diffget //3 ; nmap gh :diffget //2 ; nnoremap gc :G commit -v -q %:p ; Buffers "b" {:name "Buffer" :a ["" "Buffer Add"] :q ["" "Buffer Quit"] :n ["" "Buffer Next"] :N [":tabp" "Buffer Previous"] :p [":tabp" "Buffer Previous"]} ; Search "s" {:name "Search" :b ["Telescope current_buffer_fuzzy_find" "Search in current buffer"] :s ["Telescope live_grep" "Search in project"] :t ["TodoTelescope" "Search TODOs in project"] :c ["let @/ = \"\":echo 'Search highlight cleared'" "Clear search"]} ; Code "c" {:name "Code" :d [":lua vim.lsp.buf.definition()" "Go to Definition"] :i [":lua require('telescope.builtin').lsp_implementation()" "Implementation"] :s [":lua vim.lsp.buf.signature_help()" "Signature Help"] :r [":Lspsaga rename" "Rename Symbol"] :h [":Lspsaga hover_doc" "Hover doc"] :o [":LSoutlineToggle" "Outline"]} ; Kitaab "z" {:name "Kitaab"}}) (wk.register normal-map-leader {:prefix ""})