_: let map = mode: key: action: { inherit mode key action; }; luamap = mode: key: action: map mode key "lua ${action}"; telescope = "require('telescope.builtin')"; in { programs.nixvim.keymaps = [ (map "" "" "Lspsaga rename") (map "" "o" "Lspsaga outline") (map "" "." "Lspsaga code_action") # splitting (map "n" "s" "vertical sb") # closing (map "n" "w" "BufferClose") # single buffer (map "n" "cb" "BufferClose") # single buffer (map "n" "ct" "CloseBuffer") # buffer or extra tab (map "n" "q" "CloseBuffer") # buffer or extra tab (map "n" "co" "silent! BufferCloseAllButVisible") # other buffers (map "n" "cl" "silent! BufferCloseBuffersLeft") # other buffers (left) (map "n" "cr" "silent! BufferCloseBuffersRight") # other buffers (right) # moving (map "n" "mL" "BufferMovePrevious") # left (map "n" "mr" "BufferMoveNext") # right (map "n" "m0" "BufferMoveStart") # start (map "n" "m$" "BufferMoveEnd") # end (map "n" "jb" "BufferPick") # jump to tab # jumplist # (map "n" "" "") # (map "n" "" "") (luamap "n" "r" "${telescope}.jumplist()") # pickers (luamap "n" "" "${telescope}.find_files()") (luamap "n" "f" "${telescope}.live_grep()") (luamap "n" "t" "${telescope}.lsp_document_symbols()") (luamap "n" "T" "${telescope}.lsp_dynamic_workspace_symbols()") # last used pickers/searches (luamap "n" "h" "${telescope}.pickers()") # open buffers (luamap "n" "b" "${telescope}.buffers({sort_mru = true})") # diagnostics (map "n" "d" "Trouble diagnostics toggle filter.buf=0") (map "n" "ad" "Trouble diagnostics toggle") (luamap "n" "]d" "vim.diagnostic.goto_next({ severity = vim.diagnostic.severity.ERROR, wrap=true })" ) (luamap "n" "[d" "vim.diagnostic.goto_prev({ severity = vim.diagnostic.severity.ERROR, wrap=true })" ) (luamap "n" "]w" "vim.diagnostic.goto_next({ wrap=true })") (luamap "n" "[w" "vim.diagnostic.goto_prev({ wrap=true })") # docs with control-d just like in autocomplete (map "n" "" "K") # expand macro (map "n" "em" "RustLsp expandMacro") # easier quitting etc (map "ca" "W" "w") (map "ca" "X" "x") (map "ca" "Q" "CloseBuffer") (map "ca" "q" "CloseBuffer") # navigation (map "" "" "") (map "" "" "") (map "" "" "") (map "" "" "") (map "" "" "") # { # key = "/"; # action = "lua require('spectre').open_file_search({select_word=true})"; # } (map "n" "t" "Neotree toggle") # tab for indent/dedent (map "n" "" ">>_") (map "n" "" "<<_") (map "i" "" "") (map "v" "" ">gv") (map "v" "" "