Differences between version 3 and revision by previous author of VimHowto.
Other diffs: Previous Major Revision, Previous Revision, or view the Annotated Edit History
Newer page: | version 3 | Last edited on Thursday, February 13, 2003 1:07:34 pm | by SamJansen | Revert |
Older page: | version 2 | Last edited on Monday, October 7, 2002 12:09:42 am | by PerryLorier | Revert |
@@ -51,13 +51,28 @@
:bn Short for 'buffer next', switches to the next buffer.
:bp Short for 'buffer previous', switches to the previous buffer.
:b<number> Switches to buffer no. <number>.
:b <name> Switches to the buffer named <name>. Note that tab completion can be used here.
+
+----
+! Windows
+
+Also, it can be quite useful to have multiple 'windows' open in vim to edit/view multiple files. Vim can split both vertically and horizontally. Accessing the windows functions requires using the 'ctrl-w' combination. Some of the combinations below work if you keep holding ctrl down, for example '<ctrl-w><ctrl-w>' also navigates to the next window.
+
+In normal mode:
+
+ <ctrl-w>n Create a new window with a new buffer, splitting the screen with a horizontal line.
+ <ctrl-w>s Create a new window of the current buffer, splitting the screen with a horizontal line.
+ <ctrl-w>v Create a new window of the current buffer, splitting the screen with a vertical line.
+ <ctrl-w>c Close the current window.
+ <ctrl-w>o Close all the other windows (all windows but the currently selected one).
+ <ctrl-w>w Navigate to the next window.
----
! More Stuff
There are many, many ways to be more productive in Vim. This is just a short and very basic introduction. Listed here are a few commands that may come in handy.
* Look at the help for the 's', or 'substitute' command. This command works similar to 'sed', except it can just work on your selection/range/motion.
* :<number> goes to line no. <number>, :$ is the end of file.
+* Best of all are the scripts and useful tips at [http://vim.sf.net].
* SeeAlso ViNotes