Friday, January 3, 2014

VIM Chores

1. Read the output of a vim command (ex mode).
Say for example to list all the loaded plugins in vim

:redir @q 
:scriptnames
:redir end 

The output is now saved into q register. 
To paste from register q just type:

 "qp 

 The output is in vim now.

2. Read the output of a external command in vim
Say for example, i want to get the list of all processes in linux in vim

:read !ps -ef

and the processlist is now in the vim buffer.

No comments:

Post a Comment