Thursday, January 27, 2011

Put the results of a command in the current vim buffer

:r will read a file into the current buffer in vim
:! will execute a command
You can use them together to read the results of a command and put them in the current buffer

e.g. :r ! ls -1 /home/user/directory | sort -r

No comments:

Post a Comment