;; Custom keymappings. (module settings.keymaps {autoload {nvim aniseed.nvim}}) (def- opts {:noremap true :silent true}) (defn- map [mode lhs rhs opt] (nvim.set_keymap mode lhs rhs opt) ;;Remap space as leader key (map "" "" "" opts) (set nvim.g.mapleader " ") (set nvim.g.maplocalleader " ") ;; Modes ;; normal_mode = "n" ;; insert_mode = "i" ;; visual_mode = "v" ;; visual_block_mode = "x" ;; term_mode = "t" ;; command_mode = "c" ;; Normal ;; ;; Better window navigation (map "n" "" "h" opts) (map "n" "" "j" opts) (map "n" "" "k" opts) (map "n" "" "l" opts) ;; Resize with arrows (map "n" "" ":resize -2" opts) (map "n" "" ":resize +2" opts) (map "n" "" ":vertical resize -2" opts) (map "n" "" ":vertical resize +2" opts) ;; Navigate buffers (map "n" "" ":bnext" opts) (map "n" "" ":bprevious" opts) ;; Visual ;; ;; Stay in indent mode (map "v" "<" "" ">gv" opts) ;; Visual Block ;; ;; Move text up and down (map "x" "J" ":move '>+1gv-gv" opts) (map "x" "K" ":move '<-2gv-gv" opts) (map "x" "" ":move '>+1gv-gv" opts) (map "x" "" ":move '<-2gv-gv" opts) ;; Move text up and down (map "v" "" ":m .+1==" opts) (map "v" "" ":m .-2==" opts) (map "v" "p" "\"_dP" opts)