Passing Vim's arguments via :edit command

From Vifm Wiki
Revision as of 00:46, 25 July 2014 by Y2kbugger (talk | contribs) (small grammar fixes)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

You can pass arbitrary Vim arguments to :edit command. For example, the following command opens Vim with buffer named script and 'filetype' set to sh:

:edit +set\ filetype=sh script

For convenience one can define a command to start editing files in Vim forcing the desired value of 'filetype':

:command new :edit +set\ filetype=%a

And use it like:

:new sh script

which is equal to the first command.