From af967647582a7b888318a0471fd3872f8ff286b7 Mon Sep 17 00:00:00 2001 From: James Dixon Date: Tue, 2 Feb 2021 18:13:53 -0500 Subject: [PATCH] update keybinds --- _vimrc | 82 +++++++++++++++++++++++++++++++++++++++++++++------------- 1 file changed, 64 insertions(+), 18 deletions(-) diff --git a/_vimrc b/_vimrc index 102ca77..7df32ec 100644 --- a/_vimrc +++ b/_vimrc @@ -234,14 +234,16 @@ let g:user_emmet_install_global = 0 " colorscheme monokai-phoenix colorscheme solarized8_dark +" keybinds +"---------- "leader key let mapleader=' ' -"normal/visual mode keybinds -"--------------------------- +"normal mode keybinds +"--------------- "paste and search -nnoremap :let @/ = "" -nnoremap p :set invpaste +nnoremap :noh :let @/ = "" +nnoremap i :set invpaste "toggles nnoremap lb :call ToggleLineBreak() @@ -254,29 +256,73 @@ nnoremap dt :r !date "rc files nnoremap rc :vsplit $MYVIMRC +nnoremap rcs :vsplit ~/.vim/settings.vim +nnoremap rcf :vsplit ~/.vim/functions.vim +nnoremap rcc :vsplit ~/.vim/commands.vim +nnoremap rck :vsplit ~/.vim/keybinds.vim +nnoremap rcp :vsplit ~/.vim/plugins.vim +nnoremap rca :vsplit ~/.vim/autocmds.vim +nnoremap rcft :vsplit $HOME/.vim/after/ftplugin/ +nnoremap rcl :vsplit ~/.config/vimrc nnoremap so :source $MYVIMRC +"windows +nnoremap cl :close + "formatting tools nnoremap =j :%!python -m json.tool -"plugin keybinds -nnoremap e :call ToggleNetrw() -nnoremap at :ALEToggle - - -"insert mode keybinds/abbreviations +"insert mode keybinds "-------------------- +"abbrevations inoreabbrev #!! "#!/usr/bin/env" -"custom commands +"plugin keybinds "--------------- -"common typos and abbreviations -cnoremap w!! w !sudo tee % > /dev/null -command! W w !sudo tee % > /dev/null -command! Trim %s/\s\+$// -command! Q q -command! WQ wq -command! Q1 q! +"netrw +nnoremap e :call ToggleNetrw() + +"vim-plug +nnoremap pi :source $MYVIMRC :PlugInstall +nnoremap pu :source $MYVIMRC :PlugUpdate +nnoremap pc :source $MYVIMRC :PlugClean + +"openbrowser +nnoremap ob :OpenBrowser +nnoremap obs :OpenBrowserSearch +nmap gx (openbrowser-smart-search) +vmap gx (openbrowser-smart-search) + +"ale +nnoremap at :ALEToggle +nmap af (ale_fix) +nmap aK (ale_hover) +nmap agd (ale_go_to_definition) +nmap agd (ale_go_to_definition) + +"vim-emmet +let g:user_emmet_leader_key = ',' + +"git-gutter +nnoremap ggt :GitGutterToggle + +"vim-fugitive +nnoremap gw :Gwrite +nnoremap gl :Glog +nnoremap gs :Gstatus +nnoremap gd :Gdiffsplit +nnoremap gp :Gpush +nnoremap ga :Git add % +nnoremap ga. :Git add . +nnoremap gcm :Gcommit + +"fzf +nnoremap gf :GitFiles +nnoremap f :Files +nnoremap b :Buffers +nnoremap h :Helptags +nnoremap m :Maps +nnoremap rg :Rg "general functions "-----------------