[ACCEPTED]-Highlight positions of the marks in Vim?-vim

Accepted answer
Score: 21

Use the showmarks plugin for VIM. It does just that.


Score: 13

vim-signature worked well for showing marks.

showmarks didn't work 2 for me. It also hasn't been updated in 1 nearly a decade.

Score: 3

I find several marks related plugins on 5 GitHub, which shows marks on the signcolumn 4 and provide commands to manage your marks:

Currently, I 3 am using vim-signature and it works great. You 2 may try these plugins and choose what suits 1 you best.

Score: 2

Your problem may be that the previously 9 changed or yanked text was all on one line. If 8 you use ' with a mark it just takes you 7 to the line, not to the exact character. Use 6 ` instead to get the exact character.

One 5 way to temporarily highlight the region 4 would be to type this:


This will jump to 3 the start change/yank mark, start a visual 2 block and then jump to the end change/yank 1 mark.

Score: 2

Normally you can "blink" the matching delimiter 31 ([{}]) ... using the % (percent sign) command 30 in vi.

(That's not even unique to vim ... it works 29 in other versions of vi as well).

The '[ and 28 '] (single quote, square brackets) are unique 27 to vim as far as I know. They move to the 26 first non-blank character on the first or 25 last line where most recently modified or 24 "put" any text. If your most recent change 23 only only affected a single line then the 22 commands would both move to the same place 21 (as you described).

Note that the ' command 20 (in normal vi as well as vim) is a movement. 'letter (single 19 quote followed by any lower case letter) is 18 a command to move to the locate where a 17 mark was most recently set (using the m command, of 16 course). '' (repeating the single quote command 15 twice) moves to "most recent" cursor location 14 (think of there being a implicit mark there). That's 13 the most recent location from which you 12 initiated a movement or made a change ('[ and 11 '] are ONLY about where you made changes).

For 10 example if I'm on line 100 and I use n to 9 search for the next occurrence of my current 8 search pattern, then '' will get me back to 7 line 100. From there if I type '' again then 6 it will toggle me back to whatever the search 5 (n) command found.
Personally I never use 4 '[ and '] ... I drop a mark using ma (or b, or 3 c or whatever) and then make my changes 2 or pastes before or after the mark I've 1 set, as appropriate.

Score: 1

This command will show the marks:

:match Error /\%'[\|\%']/


More Related questions