Thursday, May 10, 2012

Shell commands in VIM

If we need to execute a shell command on currently opened file in VIM, we can do following

  :%! sed G          Double space the entire file.
  :1,5! sed G        Double space the lines from 1-5.