There is any solution to highlight the entire line where a mark has been inserted (e.g. with command ma)?

The best could be to have marked each mark with a different color of choice.

Any idea?


  • 1
    AFAIK there's no way to do this natively, but it sounds like a fun plugin to write. If there's no answers on this after several hours I'll take a stab at it and update here.
    – Tumbler41
    Apr 4 '17 at 15:12
  • btw, a gist could be that each time one set a mark ( ma, mb, mc, etc.), a different (transparent) color is take to highlight the marked line, or just use a fixed sequence of colors or just a unique color... :) Apr 4 '17 at 15:21

I created a plugin that I think does what you want.

If you want to change the colors that it uses simply define g:highlightMarks_colors in your vimrc as a list of colors (either names or RGB strings).

I welcome any feedback you have.

Screenshot as example:

enter image description here

  • Fantastic! Minor change: I would prefer color on ALL the line (not just covering text), see line 16 of this screenshot: scontent.xx.fbcdn.net/v/t31.0-8/… BTW, for cursorline at line 16 I use: autocmd InsertLeave,WinEnter * set cursorline 356 autocmd InsertEnter,WinLeave * set nocursorline In that way the mark would be more visible. Easy to modify? Thanks @Tumbler41 Apr 5 '17 at 10:54
  • 1
    Hmm... I think the only way to do that is with signs. Those are line based, so I'd be worried they'd get un-synced with the mark. I'll play around a little and update if I get anything useful.
    – Tumbler41
    Apr 5 '17 at 14:33
  • 1
    Updated with the option to use signs. Put let g:highlightMarks_useSigns = 1 in your vimrc. (Also fixed two small bugs)
    – Tumbler41
    Apr 5 '17 at 18:20
  • Great! Exactly what I was looking for! minor side effect: the initial vertical line (on each window), but maybe is because signs enabled...isn'it? see: scontent.xx.fbcdn.net/v/t31.0-8/… can I avoid the line? Note 1: I'll do some test with g:highlightMarks_colors (transparency and I'll try to contribute to your github repo). Note 2: :RemoveMarkHighlights is perfect for me. Thanks for your effort! Apr 6 '17 at 9:00
  • 1
    Yup, it's a side effect of using signs. If you look at the documentation, you'll see I mention that. It's one of the reasons I left signs as an option and not just the new way to do it. Unfortunately, I think that's the only way to get the full line highlighting like you want.
    – Tumbler41
    Apr 6 '17 at 14:29

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.