When I run :marks it lists all the marks including the standard Vim marks. This is somehow distracting.
Is there a way to list only my marks that I created using m-X for example?
When I run :marks it lists all the marks including the standard Vim marks. This is somehow distracting.
Is there a way to list only my marks that I created using m-X for example?
You can define a custom command like this, that will only show the lowercase marks a-z:
:com :MyMarks :sil! marks abcdefghijklmnopqrstuvwxyz
I end up having this in my vimrc
nnoremap <silent> ,m :marks abcdefghijklmnopqrstuvwxyz<CR>:normal! `
With this, ,m vim lists all my marks and then I only have to type the mark that I want to jump to, and hit enter.
The 'normal' command executes its command-line args as if you had pressed those keys in normal mode. We deliberately don't add a <CR> to this, part so that the user is presented with a half-typed command:
:normal! '
The ' at the end is the start of a 'go to mark' command, hence the user can just press 'A' (or whatever) and then enter.
:marks a-zshould work – Christian Brabandt Oct 08 '20 at 11:03:marks– Salahuddin Ahmed Oct 08 '20 at 11:59:marks a-bwill show 'a' and 'b'.:marks a-cwill show 'a' and 'c'.:marks a-dwill only show 'a'. As far as I read, this should list marks from a to d. If I run:marks abcdit will list 'a', 'b', and 'c' which all I have. So it looks like this is the best solution – Salahuddin Ahmed Oct 08 '20 at 12:05