dots-of-war/nvim/fnl/keybinds.fnl

83 lines
3.4 KiB
Text
Raw Normal View History

2021-04-02 17:54:14 +00:00
(module keybinds
{require {a aniseed.core
nvim aniseed.nvim
2021-04-03 14:14:56 +00:00
utils utils
fennel aniseed.fennel}
2021-04-02 17:54:14 +00:00
require-macros [macros]})
2021-04-03 19:21:12 +00:00
2021-04-03 14:14:56 +00:00
(utils.noremap :n :<leader> ":<c-u>WhichKey '<Space>'<CR>")
(utils.noremap :v :<leader> ":<c-u>WhichKeyVisual '<Space>'<CR>")
2021-04-02 17:54:14 +00:00
2021-04-18 10:03:50 +00:00
;(utils.mapexpr :i :<CR> "compe#confirm(lexima#expand('<LT>CR>', 'i'))")
2021-04-22 14:00:33 +00:00
(utils.mapexpr :i :<C-Space> "compe#complete()")
2021-04-03 19:21:12 +00:00
(utils.mapexpr :i :<esc> "compe#close('<esc>')")
2021-04-02 17:54:14 +00:00
2021-04-22 14:00:33 +00:00
2021-04-03 14:14:56 +00:00
(fn le [s] (.. ":call luaeval(\"" s "\")"))
2021-04-02 17:54:14 +00:00
(set nvim.g.which_key_map {})
(nvim.command "call which_key#register('<Space>', \"g:which_key_map\")")
(set nvim.g.which_key_map
{ "h" [ ":bprevious" "previous buffer"]
"l" [ ":bnext" "next buffer"]
"f" "which_key_ignore"
"s" "which_key_ignore"
2021-04-18 10:03:50 +00:00
"o" [":Telescope live_grep" "Grep files"]
"p" [":Telescope file_browser" "Open file-browser"]
2021-04-02 17:54:14 +00:00
"[" ["<Plug>(YoinkPostPasteSwapBack)" "Swap last paste backwards"]
"]" ["<Plug>(YoinkPostPasteSwapForward)" "Swap last paste backwards"]
":" [":Commands" "Search command with fzf"]
"c" { :name "+comment_out"}
"e" { :name "+emmet"}
"z" { :name "+folds"
"c" ["foldclose" "close fold"]
"o" ["foldopen" "open fold"]}
"m" { :name "+Code-actions"
"d" [ ":Lspsaga hover_doc" "show documentation"]
"b" [ ":Lspsaga lsp_finder" "find stuff"]
"x" [ ":Lspsaga preview_definition" "Preview definition"]
"o" [ ":Telescope lsp_document_symbols" "symbols in document"]
"s" [ ":Telescope lsp_workspace_symbols" "symbols in workspace"]
"t" [ ":Lspsaga signature_help" "Show signature help"]
"n" [ ":Lspsaga rename" "rename"]
"v" [ ":Lspsaga code_action" "apply codeaction"]
"a" [ ":Lspsaga show_cursor_diagnostics" "Cursor diagnostics"]
"A" [ ":Lspsaga show_line_diagnostics" "Line diagnostics"]
"E" [ ":Telescope lsp_workspace_diagnostics" "List diagnostics"]
"e" [ (le "vim.lsp.diagnostic.goto_next()") "Jump to the next error"]
"g" [ (le "vim.lsp.buf.definition()") "go to definition"]
"i" [ (le "vim.lsp.buf.implementation()") "show implementation"]
2021-04-22 14:00:33 +00:00
;"r" [ (le "vim.lsp.buf.references()") "show references"]
"r" [ ":Telescope lsp_references" "show references"]
2021-04-02 17:54:14 +00:00
"f" [ (le "vim.lsp.buf.formatting()") "format file"]}
"f" { :name "+folds"
"o" [ ":foldopen" "open fold"]
"n" [ ":foldclose" "close fold"]
"j" [ "zj" "jump to next fold"]
"k" [ "zk" "jump to previous fold"]}
"v" { :name "+view-and-layout"
"n" [":set relativenumber!" "toggle relative numbers"]
"m" [":set nonumber! norelativenumber" "toggle numbers"]
"g" [":Goyo | set linebreak" "toggle focus mode"]
2021-04-03 19:21:12 +00:00
"i" [":IndentGuidesToggle" "toggle indent guides"]}
"b" { :name "+buffers"
"b" [":Buffers" "select open buffer"]
"c" [":bdelete!" "close open buffer"]
"w" [":bwipeout!" "wipeout open buffer"]}})
2021-04-02 17:54:14 +00:00
(set nvim.o.timeoutlen 200)
2021-04-04 13:08:59 +00:00
(nvim.command
"autocmd! VimEnter * :unmap <space>ig
autocmd! FileType which_key")