TalkingQuickly's Today I Learned

3 posts about #vim

Automatic Wrapping of Paragraphs in Vim

It's been driving me crazy for a while then when writing markdown in vim, linebreaks are automatically added to keep all lines a manageable length, but if you subsequently edit a line, you have to manually re-jig the whole paragraph.

It turns out there's a really simple solution:

:set formatoptions+=a

Will automatically re-format the whole paragraph every time you edit a line

Zoom into pane in tmux

Leader (in my case ctrl + a) then z zooms the current pane to full screen in tmux. This means you can have vim in one pane and console in the other and switch between them seamlessly.

Highlight matching words in vim

While in normal mode, the # (hash) key (alt + 3 in OSX) will highlight all occurrences of the word currently under the cursor.