3

The Vim 'ex-showmarks' plugin visually displays Vim marks in a file gutter, something like this:

After marking with 'ma' and 'mb'

I miss this functionality and am trying to find a way to replicate it in Emacs evil mode, and would like to make sure there's not some quick solution I'm missing before I try to learn how to write Emacs extensions.

Martin Tournoij
  • 26,737
  • 24
  • 105
  • 146
Benji L.
  • 197
  • 11
  • I'm not sure if there's a package that does exactly what you want, but there's a package called `bm` (bookmark) that's fairly close. It does highlighting, but you need to manually insert the bookmarks. You could adapt it to highlight the marks in `mark-ring`. – jpkotta Mar 29 '16 at 20:20

2 Answers2

1

Currently there is no package to highlight evil markers. However, it should not be too difficult to implement. The list of markers is stored in the variable evil-markers-alist (see the function evil-show-marks for an example how to access this data). Hence, one only needs to traverse this list and add appropriate overlays to the buffer.

It might be a good idea to add an advice to the function evil-set-marker, which is called whenever Evil changes a mark, so that the highlighting can be updated.

I would probably define a minor mode evil-show-marks-mode or so to enable/disable this feature.

Because it is a nice feature and quite easy but not trivial to implement, it would be nice if someone volunteers to write a corresponding extension package ;)

fifr
  • 138
  • 5
1

There is a package that does this, evil-visual-mark-mode.

Which shows mars inline in normal-mode.

Once installed, simply add (evil-visual-mark-mode) to your config to enable globally.

ideasman42
  • 42,413
  • 44
  • 197
  • 320