Vim - my personal cheatsheet and other cool things
Am going to just dump all my personal vim tips in here; I'm realizing that Vim (and all good software) is good because you can grow with it and customize it as you like; feel free to ignore ANYTHING ANYWHERE that says "This is how you are supposed to use it" — just do what you need to do.
Personal example — I'm actually using gVim most of the time, and I've enabled the regular copy/paste shortcuts. Similarly, I still don't use hjkl to move around, really. Maybe someday.
Here's my stuff:
Word count: g, ctrl-g. Insert date: :r !date Open URL: gx Path Completion - Ctrl-X Ctrl-F -- then Ctrl-N,Ctrl-P Search and replace: :%s/SEARCH/REPLACE/g (add c for confirmation) Copy to clipboard "*y (or "*dd) Paste from Clipboard "*p MOVING IN VIM Zoom cursor zt, zb (delete yank work with these?) Move within word b e Move within line 0 $ Move within screen H M L Move within FILE gg G Word Jump w b Sentence Jump ( ) Paragraph Jump { } Bracketything Jump % Page Up/Down ctrl B F Half Page Up/Down ctrl U D INSERT/APPEND: i a ..start/end of line I A Copy and paste in vim - USE hjkl go to visual v delete=cut d yank=copy y change=serious cut c examples to consider diw - delete (while) in word das - delete around sentence STUFF I ADDED in ~/.vimrc ,o - opens file according to xdg-open (EXECPT GX DOES THIS FINE?) VIM COLON COMMANDS: syntax enable set syntax=mkd set background=light colorscheme buttercream remove blank lines (with whitespace) - g/^\s*$/d remove pure blank lines :g/^$/d
Backlinks: Tech Guides