Tip #42: Using marks
tip karma |
Rating 43/22, Viewed by 2471
|
Read and edit this tip on the
Vim tip wiki.
The wiki may have a more recent version of this tip.
created: |
|
March 9, 2001 2:20 |
|
complexity: |
|
basic |
author: |
|
Anonymous |
|
as of Vim: |
|
5.7 |
To mark one or more positions in a file, use the m[ark] command.
Examples:
ma - set current cursor location as mark a
'a - jump to beginning of line of mark a
`a - jump to postition of mark a
d'a - delete from current line to line of mark a
d`a - delete from current cursor position to mark a
c'a - change text from current line to line of mark a
y`a - yank text to unnamed buffer from cursor to mark a
:marks - list all the current marks
NB: Lowercase marks (a-z) are valid within one file. Uppercase marks
(A-Z), also called file marks, are valid between files.
For a detailed description of the m[ark] command refer to
:help mark
See also:
:help various-motions
<< Command-history facilities for Oracle/sqlplus user |
Using abbreviations >>
Additional Notes
[email protected],
December 10, 2001 14:41
|
I find that the most useful command is '' (that's a pair of single quotes). This jumps to the special mark ' which is set automatically after every jump. This allows you to easily return to your starting point after a search, for example. This is similar to using the jump stack (vimtip #10 or :help jump-motions).
|
|