Linux Ask!

Linux Ask! is a Q & A web site specific for Linux related questions. Questions are collected, answered and audited by experienced Linux users.

Jul 072010
 

Open two files side by side using vim

Answer:

If you have two files, you want to open both of them in vi/vim and edit side by side, you can do the following.

# vim -O foo.txt bar.txt

  8 Responses to “Open two files side by side using vim”

  1. But how do I move from one file to other?

  2. @Sourav

    CTRL-W + w (Press CTRL and w together first)

  3. Can both file in sync when I page down or page up?

  4. for each window
    :set scrollbind

    then all scrollbound windows scroll together

  5. Thanks Chris! It works.

  6. How to exit the :set scrollbind
    Thanks,

  7. Thanks! this article was quick and informative. Already putting my VIM skills to work as a new php programmer. This article is a godsend

  8. [...] Fonte: http://www.linuxask.com/questions/open-two-files-side-by-side-using-vim Categories: Geral Tags: Comments (0) Trackbacks (0) Leave a comment Trackback [...]

 Leave a Reply

(required)

(required)

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>