;; 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 " ") ;; 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) ;; 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) ;; Splits (map :n : :split opts) (map :n : :split opts) (map :n : :vsplit opts) (map :n : :nohlsearch opts) (map :n :Q ":q" opts)