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.
1 Answer
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.
-
1Why Vim out of the box do now show marks? Why we need a plugin for that? Jun 6, 2019 at 7:39
m'
.