Vim Tips Wiki
Explore
Main Page
All Pages
Community
Interactive Maps
Community portal
To do
FANDOM
Fan Central
BETA
Games
Anime
Movies
TV
Video
Wikis
Explore Wikis
Community Central
Start a Wiki
Don't have an account?
Register
Sign In
Sign In
Register
Vim Tips Wiki
1,649
pages
Explore
Main Page
All Pages
Community
Interactive Maps
Community portal
To do
Editing
Using marks
(section)
Back to page
Edit
Edit source
View history
Talk (0)
We recommend that you
log in
before editing. This will allow other users to leave you a message about your edit, and will let you track edits via your
Watchlist
.
Creating an account
is quick and free.
Anti-spam check. Do
not
fill this in!
==Using marks== To jump to a mark enter an apostrophe (<code>'</code>) or backtick (<code>`</code>) followed by a letter. Using an apostrophe jumps to the beginning of the line holding the mark, while a backtick jumps to the line and column of the mark. Using a lowercase letter (for example <code>`a</code>) will only work if that mark exists in the current buffer. Using an uppercase letter (for example <code>`A</code>) will jump to the file and the position holding the mark (you do not need to open the file prior to jumping to the mark). *Each file can have mark '''a''' β use a lowercase mark to jump within a file. *There is only one file mark '''A''' β use an uppercase mark to jump between files. {| class="wikitable" !Command !! Description |- | <code>ma</code> || set mark '''a''' at current cursor location |- | <code>'a</code> || jump to line of mark '''a''' (first non-blank character in line) |- | <code>`a</code> || jump to position (line and column) of mark '''a''' |- | <code>d'a</code> || delete from current line to line of mark '''a''' |- | <code>d`a</code> || delete from current cursor position to position of mark '''a''' |- | <code>c'a</code> || change text from current line to line of mark '''a''' |- | <code>y`a</code> || yank text to unnamed buffer from cursor to position of mark '''a''' |- | <code>:marks</code> || list all the current marks |- | <code>:marks aB</code> || list marks '''a''', '''B''' |} Commands like <code>d'a</code> operate "linewise" and include the start and end lines.<br> Commands like <code>d`a</code> operate "characterwise" and include the start but not the end character. It is possible to navigate between lowercase marks: {| class="wikitable" !Command !! Description |- | <code>]'</code> || jump to next line with a lowercase mark |- | <code>['</code> || jump to previous line with a lowercase mark |- | <code>]`</code> || jump to next lowercase mark |- | <code>[`</code> || jump to previous lowercase mark |} The above commands take a count. For example, <code>5]`</code> jumps to the fifth mark after the cursor.
Summary:
Please note that all contributions to the Vim Tips Wiki are considered to be released under the CC-BY-SA
Cancel
Editing help
(opens in new window)
Follow on IG
TikTok
Join Fan Lab