title: Vim Motions video by Henry Misc
tags: vim
Notes from [this youtube video by Henry Misc](https://www.youtube.com/watch?v=RdyfT2dbt78).
+ exit: `ZZ` and `ZQ`
+ select braces and parens: `vib` select inside parens, `viB` select inside braces. Also `va` for around, which includes the delimiters.
* These are easier to type than `vi(` and `vi{`, which both require the shift key and a key distant from the home position. Square brackets don't require shift, so `vi[` is fine for that, so they don't need their version of this.
* A more complete list: `i<` `i'` `i"` `i[` `i(`=`ib` `i{`=`iB`, and `a...` for around.
+ wrap in e.g. `
...`:
* One method is `:s`: viz `:s@.*@&`
* Select with `C-v` and then insert with `I`. also `A` for append.
+ toggle case: `~` for char; `g~w` or `g~ib`
+ format file: `gg=G` (`=` formats selection)
+ jumping with %: `%` jumps between e.g. braces or parens or brackets
+ storing session: `:mksession filename.vim` gives a `.vim` script that, when sourced, reloads the session
+ open URL in browser: `gx` which on Linux basically passes what's under the cursor to `xdg-open`
+ mark and jump: `ma` to mark and then `'a` to jump back to where the mark was set. `mb`, `mc` so you have a mark for each letter.
+ jump to line: `:40`, but there is a quicker way: `40G`.
+ join lines: `J`, or `gJ`. The former joins with a space, the latter joins without a space.