daw - delete a word (under cursor)
caw - delete a word (under cursor) and put in insert mode
Remove first 5 characters in each line:
:%s/^.\{0,5\}//
Remove last two characters from each line:
%s/..$//
Swap left and right panes with ^WX.
Reader mode:
vim -R
view
vimdff merge all changes from buffer 1 to buffer 2:
:%diffget 1
:%diffput 2
Source: https://stackoverflow.com/a/31686752/3161329
Binary diff
vimdiff <(xxd foo1.bin) <(xxd foo2.bin)
# use xxd -l1000 to limit to 1000 bytes
Source: https://superuser.com/questions/125376/how-do-i-compare-binary-files-in-linux
Check filetype
:set ft?
Undo last change:
git reset --soft HEAD^
git reset --hard HEAD^
Delete a tag:
git push --delete origin tagname
git tag --delete tagname
Squash last n commits:
git reset --soft HEAD~n
git commit -a -S
Rebase last n commits:
git rebase -i -S HEAD~n