helm/home/profiles/nvim/config/conf/mappingns.fnl

85 lines
2.4 KiB
Plaintext
Raw Normal View History

2024-08-24 03:51:29 -07:00
(local nvim (require :lib/nvim))
(local wk (require :which-key))
(local
normal-map-leader
{"t" [""
"Toggle neo-tree"]
"w" ["<cmd>:w<cr>"
"Write file"]
"q" ["<cmd>:q<cr>"
"Quit"]
"r" [":RainbowParenthesesToggleAll<CR>"
"Toggle Rainbow Parens"]
; Telescope
"f" {:Name "Files"
: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
"g" {:Name "Git"
"s" [":G<CR>"
"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 <leader>gl :diffget //3<CR>
; nmap <leader>gh :diffget //2<CR>
; nnoremap <leader>gc :G commit -v -q %:p<CR>
; Buffers
"b" {:Name "Buffer"
:a [""
"Buffer Add"]
:q [""
"Buffer Quit"]
:n [""
"Buffer Next"]
:N ["<cmd>:tabp<CR>"
"Buffer Previous"]
:p ["<cmd>:tabp<CR>"
"Buffer Previous"]}
; Search
"s" {:Name "Search"
: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
"c" {:Name "Code"
: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
"z" {:Name "Kitaab"}})
(wk.register normal-map-leader {:prefix "<leader>"})