![]()
Some of these commands and shortcuts are based off my own .vimrc file, so it may not work for your setup when you try performing some of the below commands.
:Gblame:Ag count app/controllers:%s/word/love/gc:Ag #navigation-wrapper app/assets/stylesheetsspace + nspace + tq w (then do the commands you'd like repeated)q again to stop recording@w (to initiate most recent macro)99 @w (repeats said action 99 times)g + U to upper case all letters in the wordg + u to lower case all letters in the wordg + U + rg + u + rshift + gjnumber + jwbWB$0shift + hshift + l5w5l5hfy (case sensitive).uctrl + riIshift + ayy or Yp5cwAf + chard<leftArrow> will delete current and left characterd$ will delete from current position to end of lined^ will delete from current backward to first non-white-space characterd0 will delete from current backward to beginning of linedw deletes current to end of current word (including trailing space)db deletes current to beginning of current wordddshift + jcwshift + Cd + number of lines + enterd<line number>G:g/< search term>/d:g/^\s*$/dc + i + Wd + i + wc + i + '. Will delete everything within two single quotes.Vvcontrol + vgvggVGv + i + W:w:wq:q!space + w with dotfiles:sp filename:vsp filenamecontrol + w + jcontrol + w + lcontrol + w + jcontrol + w + hf + <queried item>/word + enternNggnGN:noh:e filename - Edit a file in a new buffer:bnext (or :bn) - go to next buffer:bprev (of :bp) - go to previous buffer:bd - delete a buffer (close a file):sp filename - Open a file in a new buffer and split windowctrl + ws - Split windowsctrl + ww - switch between windowsctrl + wq - Quit a windowctrl + wv - Split windows verticallyset paste in .vimrc filevisual mode + > or <shift + <<shift + >>CTRL-V then I# (insert # in the begining)CTRL-V then X (delete the first symbol on the line)gccontrol + v then select lines then I + # then hit esccontrol + v + shift + i + action + escv + / + content:set nu:syntax oncd
mv .vimrc .vimrc-old
mv .vim .vim-old
touch .vimrc; mkdir .vim
:h <topic>:bdc + i + t will remove the code between HTML tags, such as: <div>Some content</div>c + i + } will remove the code inside of a JavaScript functionClone Github dotfiles.
ciw # cut and paste word
csw X # surround with with ( " ' or anything desired character
dt shift+$ # delete to end of line
:reg" + 6 + y" + 6 + p" + + yPaste from system buffer: " + + p
Blog photo credit from http://www.nathael.org/Data/vi-vim-cheat-sheet.svg