” at top of paragraph, format this paragraph
!} fmt -c
” for the whole file, format all paragraphs
!G fmt -c
“from here to the end of the file, format all paragraphs
!$ fmt -c
” from anwhere in the paragraph, format this paragraph
{!}fmt -c
Here’s how I map them in my .exrc file:
map @f !} fmt -c^M
map @F !G fmt -c^M
map ^Xf !$ fmt -c^M
map ^XF {!}fmt -c^M}^M
#To delete all lines which contain the string tornado watch:
:g/tornado watch/d
#To comment out all lines between line 6 and 22
:6,22 s/^/#/
#To run a python script inside vi