" Custom Commands "---------------- command! Vimrc edit $MYVIMRC " Edit .vimrc (this file) command! Refresh source $MYVIMRC " Refresh from .vimrc (this file) " Custom Keybinds "---------------- " Map the leader key map "This unsets the `last search pattern` register by hitting return nnoremap :noh " Replace all nnoremap S :%s//g " Jump to text in this directory nnoremap / :Rg " Quit vim nnoremap q :quit nnoremap Q :quitall " Save file nnoremap fs :write " Make file executable nnoremap fe :!chmod 755 % " Make file normal permissions nnoremap fn :!chmod 644 % " Open file in this directory nnoremap ff :Files " Change directory to this file nnoremap fd :lcd %:p:h " Back up directory nnoremap fu :lcd .. " Open a recent file nnoremap fr :History " Switch between multiple open files nnoremap b :Buffers " Switch between two open files nnoremap :b# " Jump to text in this file nnoremap s :BLines " Start Magit buffer nnoremap gs :Magit " Toggle Git gutter (by line numbers) nnoremap ` :GitGutterToggle " Git push nnoremap gp :Git push " Split window nnoremap ws :vsplit " Close all other splits nnoremap wm :only " Exit terminal mode (requires Alacritty escape) tnoremap " Reload Vimrc settings nnoremap rr :Refresh nnoremap rp :Refresh :PlugInstall " Open file tree noremap ft :Fern . -drawer -width=35 -toggle= " Tabularize nnoremap ta :Tabularize / nnoremap t# :Tabularize /# nnoremap t" :Tabularize /" " Read todo comments nnoremap td /# \?TODO:\?