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