(NEO)VIM
- Redirect output of Ex commands to register
:redir @a
:__commands__
:redir END
"ap
:%!bash
- Convert textfile to pdf (via ps)
$ vim filename.txt -c "hardcopy > filename.ps | q"; pstopdf filename.ps
pstopdf may be names ps2pdf on other OSes
:earlier __time__
:later __time__
where time = x(s|m|h|d) (s = second, m = minute, h = hour, day)
to go back and forth on state of buffer in time of x units
- Remote editing (using ssh config)
:e scp://staging/~/path/to/file.ext
Assuming a Host for ‘staging’ is set in ~/.ssh/config
- Delete other buffers except current
:% bd | e # | bd #
where
- % bd = delete all buffers (creates a new no-name buffer),
- e # = edit previous buffer (since current is no-name),
- bd # = delete previous buffer (no-name)
spaces are optional
- Ex mode completion options
TAB cycles through options; Ctrl-a inputs all options.
Example: To delete all *.js files in buffer list
:bd js Ctrl-a
Can use :bwipeout to completely remove a buffer