Penguin

Differences between version 4 and revision by previous author of VimHowto.

Other diffs: Previous Major Revision, Previous Revision, or view the Annotated Edit History

Newer page: version 4 Last edited on Tuesday, May 13, 2003 3:14:55 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,29 @@
  :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. 
+* :<number> goes to line no. <number>, :$ is the end of file. Alternatively, gg is the start of the file and G is the end of the file.  
+* To read read from stdin invoke Vim like so: 'vim -'. This is very useful to pipe stuff into Vim for later editing.  
+* Best of all are the scripts and useful tips at [http://vim.sf.net]
 * SeeAlso ViNotes