Differences between version 7 and predecessor to the previous major change of VimHowto.
Other diffs: Previous Revision, Previous Author, or view the Annotated Edit History
Newer page: | version 7 | Last edited on Monday, September 1, 2003 1:24:44 am | by AristotlePagaltzis | Revert |
Older page: | version 4 | Last edited on Tuesday, May 13, 2003 3:14:55 pm | by SamJansen | Revert |
@@ -15,9 +15,9 @@
After leaving insert mode, Vim returns back to normal mode. The key to normal mode is the colon key, ':'. Pressing the colon key allows commands to be typed into Vim. Some simple commands follow:
:w[[rite] Write, or save the current file.
- :q[[uit] Quit Vim (will not exit of
there are unsaved changes)
+ :q[[uit] Quit Vim (will not exit if
there are unsaved changes)
:e[[dit] <file> Edit/load a new file.
:help <topic> Open up a help window displaying topic.
The above commands are usually just abbreviated ':w' and such, there isn't really any point in typing ':write'.
@@ -37,8 +37,17 @@
> Indent the current selection.
< De-indent the current selection.
While in normal mode, pressing 'p' will paste.
+
+----
+! Search and replace
+
+In normal mode,
+ :s/(search regex)/(replace string)/
+to replace text on the current line, or
+ :%s/regex/replace/
+for the whole buffer.
----
! Navigating Multiple Files
@@ -75,5 +84,5 @@
* 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. 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
+* See also:
ViNotes