Follow Techotopia on Twitter

On-line Guides
All Guides
eBook Store
iOS / Android
Linux for Beginners
Office Productivity
Linux Installation
Linux Security
Linux Utilities
Linux Virtualization
Linux Kernel
System/Network Admin
Programming
Scripting Languages
Development Tools
Web Development
GUI Toolkits/Desktop
Databases
Mail Systems
openSolaris
Eclipse Documentation
Techotopia.com
Virtuatopia.com
Answertopia.com

How To Guides
Virtualization
General System Admin
Linux Security
Linux Filesystems
Web Servers
Graphics & Desktop
PC Hardware
Windows
Problem Solutions
Privacy Policy

  




 

 

Debian GNU/Linux Reference Guide
Prev Home Next

11.3.8 Split screen with vim

vim can edit multiple files in a multi-split-screen environment. Type :help usr_08.txt for details.

To split the screen display between different files, type at the vi command prompt:

     :split another-file
     :vsplit another-file

Or at a shell prompt:

     $ vi -o file1.txt file2.txt   # Horizontal split
     $ vi -O file1.txt file2.txt   # Vertical split

will provide multiwindow vi.

     $ vimdiff file.txt~ file.txt         # check recent changes of file.txt
     $ vimdiff file.en.sgml file.fr.sgml  # check changes of translation
     $ gvimdiff file.txt~ file.txt        # in X

will provide a nice view of differences between an original and a backup file. In SGML it matches tags, so comparing translations in this mode works very well.

Special cursor movements with Ctrl-W commands:

     Ctrl-W +      increase the size of a window
     Ctrl-W -      decrease the size of a window
     Ctrl-W h      move to the window left
     Ctrl-W j      move to the window below
     Ctrl-W k      move to the window above
     Ctrl-W l      move to the window right
     ...

Use the following to control screen scrolling:

     :set scrollbind
     :set noscrollbind

Debian GNU/Linux Reference Guide
Prev Home Next


 
 
  Published under the terms of the GNU General Public License Design by Interspire