(import-macros {: map!} :nvrc.macro.keymap) (import-macros {: setv!} :nvrc.macro.set) (map! [nv :silent] : "") (setv! mapleader " ") (setv! maplocalleader ",") (map! [n] ";" ":") (map! [n :silent] :q ":bprev ") (map! [n :silent] :w ":bd ") (map! [n :silent] :e ":bnext ") (map! [n :silent] :r ":enew ") (map! [n :silent] :a ":tabnew ") (map! [n :silent] :u ":tabprev ") (map! [n :silent] :o ":tabnext ") (map! [n :silent] :s ":set nu! | :set rnu! ") (map! [n] :d ":b ") (map! [n :silent] :ya ":%y+ ") (map! [n] :c ":SwitchPalette ") (map! [n :silent] :/ ((. (. (. (require :Comment.api) :toggle) :linewise) :current))) (map! [v :silent] :/ ":lua require('Comment.api').toggle.linewise(vim.fn.visualmode()) ") (map! [n :silent] :ff ((. (require :fzf-lua) :files))) (map! [n :silent] :fd ((. (require :fzf-lua) :grep))) (map! [n :silent] :fl ((. (require :fzf-lua) :live_grep))) (map! [n :silent] :fb ((. (require :fzf-lua) :buffer))) (map! [n :silent] :fg ((. (require :fzf-lua) :git_commits))) (map! [n :silent] :fh ((. (require :fzf-lua) :git_status))) (map! [n :silent] :t ":Dirvish") (map! [n :silent] :ga ":Git add %") (map! [n :silent] :gs ":Git") (map! [n :silent] :gc ":Git commit -v -q") (map! [n :silent] :gt ":Git commit -v -q %") (map! [n :silent] :gd ":Gdiff") (map! [n :silent] :ge ":Gedit") (map! [n :silent] :gr ":Gread") (map! [n :silent] :gw ":Gwrite") (map! [n :silent] :gg ":Ggrep") (map! [n :silent] :gl ":silent! Gclog:bot copen") (map! [n :silent] :gm ":GMove") (map! [n :silent] :go ":Git checkout") (map! [n :silent] :gp ":Git! push") (map! [n :silent] :go ":Git! pull") (map! [n :silent] :gb ":Git blame") (map! [n] :gf ":diffget //2") (map! [n] :gj ":diffget //3") (map! [n :silent] :po ":copen") (map! [n :silent] :pq ":cclose") (map! [n :silent] :Po ":lopen") (map! [n :silent] :Pq ":lclose") ;; Work with word wrap (map! [n :expr :silent] :k "v:count == 0 ? 'gk' : 'k'") (map! [n :expr :silent] :j "v:count == 0 ? 'gj' : 'j'") (map! [n] : ":m .+1==") (map! [n] : ":m .-2==") (map! [i] : ":m .+1==gi") (map! [i] : ":m .-2==gi") (map! [v] : ":m '>+1gv=gv") (map! [v] : ":m '<-2gv=gv") (map! [n] :k (vim.lsp.buf.hover)) (map! [n] :b ((. (require :dap) :toggle_breakpoint)))