Skip to main content
8 votes
Accepted

Can I get a visual indicator when I drop a mark?

Is there a plugin or something for that that works well? Why yes there is! I use kshenoy/vim-signature, and highly recommend it. From the README: vim-signature is a plugin to place, toggle and ...
DJMcMayhem's user avatar
  • 17.9k
7 votes

How do I delete a mark in current line?

I'm going to swim against the stream on this one. Just don't worry about it. Marks are pretty ephemeral and there are bunch of marks Vim automatically maintains like '[, '', and '. Humans are ...
Peter Rincker's user avatar
6 votes
Accepted

Find only between marks

You can use \%>'m and \%<'m to match after and before a given mark, m. /\%>'afoo\%<'b For more helps see: :h /\%'m
Peter Rincker's user avatar
6 votes
Accepted

marks with fullline visualization

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)....
Tumbler41's user avatar
  • 7,796
6 votes

Jump back to the position I started a search

I do this by first creating a mark - for example, create a mark named "a" with ma in command mode – then search or move around the file however you want. Then go back to your mark with 'a.
Kaan's user avatar
  • 341
6 votes
Accepted

How to move marked line to current location

The format for :m[ove] is :[range]m[ove] {address} Where the range is the line or lines you want to move and the address is the target. Note that the moved line(s) will actually be placed on the line ...
B Layer's user avatar
  • 20.1k
5 votes
Accepted

difference between marks and tags?

Both specify certain points in a file and give you commands to jump there and as such they are the same. But marks are created by vim. Either explicitly by hand with m or automatically by vim (for ...
Lucas's user avatar
  • 1,669
5 votes

Is it possible to have Vim displaying the list of available marks when using marks?

This does exactly what my original question was """""""""""""""""""""""""""" " Ranger style marks command " """""""""""""""""""""""""""" function! Marks() marks echo('Mark: ') " getchar()...
the_velour_fog's user avatar
4 votes

Is it possible to have Vim displaying the list of available marks when using marks?

A variation on your own response is to install fzf.vim and then bind to :Marks, e.g.: nnoremap ` :Marks<CR> This has the benefit that it will show up in fzf's fuzzy search window. (Caveat: It ...
steinar's user avatar
  • 149
4 votes
Accepted

Go to the last cursor position using marks

The mark " indicates the position of the cursor when you last exited a buffer. Using that... Continue to use your cross-file marks but immediately follow with '" (or `" to restore the column as well ...
B Layer's user avatar
  • 20.1k
4 votes

Is it possible to place marks at the end of a line?

I found the answer here. Another easy way is to just add v right after y, no setting or Visual mode selection necessary. `a"ryv`b y`b yanks to mark b excluding the character under mark b, ...
alligator's user avatar
4 votes
Accepted

Jump to where insert mode was entered?

If you haven't yanked or changed text since your last insertion, then you can use the `[ mark (see docs), which gets you back "to the first character of the previously changed or yanked text." By the ...
filbranden's user avatar
  • 29.9k
4 votes
Accepted

Is it possible to list only my marks?

You can define a custom command like this, that will only show the lowercase marks a-z: :com :MyMarks :sil! marks abcdefghijklmnopqrstuvwxyz
Christian Brabandt's user avatar
4 votes
Accepted

Deleting between two marks (or, from the previous mark to the cursor)

Using marks To do this with marks, do the following: Set your mark on the first ampersand: ma Move to the echo command anyway you choose. Delete from there back to the mark: d`a Make sure to use a ...
Phil R's user avatar
  • 547
3 votes

Jump back to the position I started a search

Two options I can think of off the top of my head: :[v]split, then search in only one window :nnoremap / mz/; then `z should take you back. Only works for one search at a time (i.e. new searches ...
D. Ben Knoble's user avatar
  • 27.7k
3 votes

How do I delete a mark in current line?

To delete a mark you can use :delmark it can be shortened to :delm. If you really want something shorter you can map a function which asks for an input but it's not really a common practice to have a ...
fievel's user avatar
  • 433
3 votes
Accepted

how to remap backtick mark with single-quote mark globally

You used nnoremap which means the mapping will only work in normal mode. d and y leave you in operator pending mode. Adding the following should solve these cases: onoremap ' ` onoremap ` ' I'm not ...
Octaviour's user avatar
  • 982
3 votes

Shortcut for applying a command between the last two marks

Using 2 marks to operate on the text between those lines is the 'vi'-compatible way of the more modern and (literally) visual way of operating in Vim (and probably why visual mode was invented in the ...
VanLaser's user avatar
  • 9,890
3 votes
Accepted

Understanding and navigating Mark / Mark not set

The ways to jump to a mark are 'm jump to line of mark m `m jump to line and column of mark m you can technically do :'m, since the range :'m is the line of mark m, and entering a range as an ex ...
D. Ben Knoble's user avatar
  • 27.7k
3 votes
Accepted

Understanding a few of the preset marks

The marks 0-9 are the last 10 files you were editing. See :h viminfo-file-marks (took me a while to find the correct help subject). '" : the cursor position when last exiting the current buffer (:h '"...
Ralf's user avatar
  • 9,417
3 votes
Accepted

Efficient copy->paste onto mark

The ex commands :put and :delete both allow you to specify a line, so if you've already placed mark 'a on the line you want replaced, then you can execute the following after the copy: :'apu :'ad or ...
Rich's user avatar
  • 32.6k
3 votes

Efficient copy->paste onto mark

Alternative solution: If you want to replace the text at the mark, you could just use :norm!'aVp`` Or in one line with the copy: :'<,'>y | norm!'aVp``
B.G.'s user avatar
  • 1,186
3 votes
Accepted

Visually selecting from mark to cursor

It should work as shown below: v`a
ENRIQUE GARCIA's user avatar
3 votes
Accepted

How to set more than 52 marks?

The number of marks is hard-coded in Vim, and you can't get any more without modifying the source. – Martin Tournoij However, an advanced alternative exists in form of :h textprop in Vim and :h api-...
tejasvi's user avatar
  • 470
3 votes
Accepted

Is there a way to make marks in color or at least visible?

I'm using the plugin vim-signature to see the marks in the margin:
Vivian De Smedt's user avatar
3 votes
Accepted

Using marks in custom functions/plugins without changing user's marks

To get a list of all marks, you can use the getmarklist() Vimscript function. It allows to either return global marks (when no buffer argument is given) or return buffer specific marks when a bufnr ...
Christian Brabandt's user avatar
2 votes

How to search for lines matching current line in vim

http://vim.wikia.com/wiki/Searching_for_expressions_which_include_slashes points out that the search register can be set directly, like this: :let @/='/abc/def/ghi/' This allows search on the line ...
Bernard Ogden's user avatar
2 votes

Is it possible to have Vim displaying the list of available marks when using marks?

Below is an excerpt from my ~/.vimrc that contains the vimscript code I implemented by building upon the very good "no new mappings" idea from the already existing answer provided by @...
dsimic's user avatar
  • 252
2 votes
Accepted

Plugin vim-signature: How to change mark column character color?

By default, the vim-signature plugin uses the SignatureMarkText highlighting group for its mark signs. It's better to set the colour of this in your vimrc rather than editing the plugin's code (which ...
Rich's user avatar
  • 32.6k
2 votes

Plugin vim-signature: How to change mark column character color?

Mark column is added by plugin: vim-signature. Need to edit: $HOME/.vim/bundle/vim-signature/autoload/signature/utils.vim Change 'SignatureMarkText' color. Need to exit vim to see the change.
Fisher's user avatar
  • 1,096

Only top scored, non community-wiki answers of a minimum length are eligible