8

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.

Rich
  • 31,891
  • 3
  • 72
  • 139
vimKoans44
  • 147
  • 1
  • 6

1 Answers1

11

There is no way to make marks visible in vim proper.

If it is however enough to just list them you can issue the :marks normal-mode command, which will give you a list of all marks in the current buffer and all global marks (the one with capitalized letters).

Additionally there is a plugin called showmarks that will do the job. It displays a column left to the linenumbers-column which will contain the names of the marks on a specific line. This includes global marks.

A few versions of this plugin exist, i've found that Jacques Bodin-Hullin's version is the only one that seems to work without problems in any current version of vim (greater or equal than 7.4). It is located on github: jacquesbh/vim-showmarks.

If you are using Vundle as your plugin manager you can register it with the following line in your .vimrc, after doing a :PluginInstall jacquesbh/vim-showmarks.

call vundle#begin()
" ... other plugins
Plugin 'jacquesbh/vim-showmarks'
call vundle#end()

After you've installed showmarks you can make the marks visible with :DoShowMarks and hide them again with :NoShowMarks - an ! at the end will execute the command for all buffers.

robustus
  • 226
  • 2
  • 5