vim

copy contents to/from files

to copy the contents into a file

:r <filename>
or
:"qY # yank out of first file
:"qP # put into second file
or read range of lines
:r! sed -n <n>,<m>p /path/to/file.md

to copy the contents to a new file

:<n>,<m> w <filename>
where <n> and <m> are numbers or symbols that designate range of lines

text wrap

(wrap to column) wrap current line

gqq

wrap entire file

gqG

wrap paragraph using visual selection

V}gq

also use visual or visual block with gq

spell

using_spellcheck check spelling

Spell

move to word

]s [s

and see results

z=

turn off highlighting

set nospell

buffers

incrementing numbers

post on reddit

select several lines containing '0' and type g<C-a>

split

  • movement <Ctrl>-w [h,j,k,l] <Ctrl>-w w
  • rotate <Ctrl>-w r
  • orientate <Ctrl>-w J <Ctrl>-w L
  • sizing <Ctrl>-w - # decrease height by 1 line <Ctrl>-w + # increase height by 1 line <Ctrl>-w < # change width by 1 line to the left <Ctrl>-w > # change width by 1 line to the right <Ctrl>-w 10 - # decrease height by 10 lines, etc...

list recent doc

:ol[dfiles]

replace

  • change inner word ciw

delete

  • until but not dt <char>
  • until and df <char>

using the shell

vim and the shell

  • in script, highlight line and switch to command mode by pressing :
    :'<,'>w !bash -
:'<,'>w !python -