Monday, August 5, 2013

VI Editor

Few commands.

vi file Invoke vi on file
vi file1 file2 Invoke vi on files sequentially
view file Invoke vi on file in read-only mode
vi -R file Invoke vi on file in read-only mode
vi -r file Recover file and recent edits after a
          crash
vi -t tag Look up tag and start editing at its
         definition
vi -w n Set the window size to n; useful over a
       slow connection
vi + file Open file at last line
vi +n file Open file directly at line number n
vi -c command file Open file, execute command, which is
                  usually a search command or line num-
                 ber (POSIX)
vi +/pattern file Open file directly at pattern
ex file Invoke ex on file
ex - file < script Invoke ex on file, taking commands
                  from script; suppress informative mes-
                 sages and prompts
ex -s file < script Invoke ex on file, taking commands
                   from script; suppress informative mes-
                  sages and prompts (POSIX)

No comments:

Post a Comment