Questions tagged [mark]

Question about the navigation in a buffer via the marks mechanism and the general usage of marks.

See :h mark-motions.

59 questions
11
votes
3 answers

Set a mark to its previous value

Sometimes I use marks to navigate easily through different files using mA, mB... and 'A, 'B... And sometime (more often than I'd like to admit) because of inattention or whatever the reason is, I use m[LETTER] with an already existing mark which…
statox
  • 49,782
  • 19
  • 148
  • 225
8
votes
1 answer

How do I display any marks that are set on the current line?

I usually jump to next mark in file using ]' and [' commands. But I am not able to find a way to discover whether there are any marks set on current line.
vimKoans44
  • 147
  • 1
  • 6
4
votes
1 answer

What does `1 do?

I tried to set a mark using a digit: m1 and apparently that does not work, because later I typed `1 and I think it opened the last opened file or something else, I'm not sure. What does m1 do? Are marks restricted to letters?
Tyler Durden
  • 2,091
  • 2
  • 23
  • 42
4
votes
3 answers

How do I delete a mark in current line?

Lets say I jump to mark with ]' and I want to remove it, how can I do it without typing :delmarks a?
noee
  • 43
  • 1
  • 3
3
votes
2 answers

Is it possible to list only my marks?

When I run :marks it lists all the marks including the standard Vim marks. This is somehow distracting. Is there a way to list only my marks that I created using m-X for example?
Salahuddin Ahmed
  • 441
  • 3
  • 14
3
votes
1 answer

Can I get a visual indicator when I drop a mark?

I like using marks, but I wouldn't mind having a visual indicator of some sort that maybe shows me "you've dropped mark x here", perhaps a letter in the gutter or some sort of line or character highlighting. Is there a plugin or something for that…
scanny
  • 217
  • 1
  • 6
2
votes
1 answer

Jump to where insert mode was entered?

`. seems to take me to where I last left insert mode, but I would like to jump to where my cursor was when I entered insert mode last. How can I do that?
minseong
  • 2,313
  • 1
  • 19
  • 38
2
votes
1 answer

Go to the last cursor position using marks

I like to add marks for move across files but most of the time, I don't care about the line. I want to go on the last position of the cursor. For example, I have this marks : :marks mark line col file/text ' 1 0 class ContentsController <…
Dougui
  • 227
  • 1
  • 2
  • 5
2
votes
1 answer

Shortcut for applying a command between the last two marks

When I first started using Vim 10 years ago, I found myself typing :'a,'fs/target/replacement/g a lot. I was used to using 'a and 'f as my go-to marks. So I also had this in my .vimrc: map qq :'a,'f Are there any special kinds of marks in Vim that…
1
vote
1 answer

Is there a way to make marks in color or at least visible?

Is there a way to make marks in color or at least visible? Actually I need to put visible marks on the text (code) in Vim.
IvanDi
  • 99
  • 3
1
vote
1 answer

Organize :marks list?

Is there a way to organize / parse the :marks list? E.g. list them in the order they were created, rather than alphabetically. Or see which marks are associated with currently open buffers.
Aaron Parisi
  • 239
  • 1
  • 7
1
vote
1 answer

Marks and insertions of lines

Assuming I have a line such as the following one: XXXXXXXXXXXXXABCXXXXXXXXXXXXXXXXXABCXXXXXXXXX mark a is at the first instance of ABC, mark b on the second one. Now I run a macro on it, breaking the line twice, and inserting something around that…
muk.li
  • 449
  • 3
  • 8
1
vote
1 answer

Do you know any plugins which allow marks to be longer than one char?

I'm looking for plugin which emulates marks behavior for longer key sequences. I want to be able to mark two distinct files with 3 char mappings and jump to files when sequence is typed. Do you know if it already exists or is part of some other…
amonowy
  • 31
  • 3
1
vote
1 answer

Understanding a few of the preset marks

When doing :marks, there are a few marks that show up that I'm not quite sure what they do, even after reading the entry in the help section. For example, the following marks seem a bit obscure (at least in my understanding) to me: '0-9 (shows a…
David542
  • 2,445
  • 14
  • 50
1
vote
2 answers

undo mark overwrite

Sometimes I accidentally type ma instead of 'a and overwrite the mark I had at a instead of jumping there. I know that by default vim has no way to undo an ma, but how can I add this functionality? I want to be able to undo an accidental mark…
minseong
  • 2,313
  • 1
  • 19
  • 38
1
2