Questions tagged [operator]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
1 vote
1 answer
90 views

Get motion used within operatorfunction?

How can I make a custom operator function that can programmatically reuse the motion that the user called it with? E.g. I want to map the operator m so that miw goes to the start of the file and then ...
theonlygusti's user avatar
  • 2,229
1 vote
1 answer
23 views

How to make dot replay embedded normal command? e.g in insert mode: <c-o>ysiw>Some<esc>

For example: OpRef ^- cursor I press <c-o>ysiw>Option<esc> in insert mode to get: Option<OpRef> I want to repeat this command with dot operator, but when I press dot it only ...
Alfa07's user avatar
  • 111
7 votes
2 answers
1k views

On string concatenation, what's the difference between . and .. (single dot and double dot)?

From the :execute help (:h :exe): *:exe* *:execute* :exe[cute] {expr1} .. Executes the string that results from the evaluation of {expr1} as an Ex command. ...
André Willik Valenti's user avatar
0 votes
1 answer
17 views

Make j and k act character-wise when used with operators

When I use j or k with operators, they make the operator act line-wise - acting over two whole lines, as if I had used Vj/Vk. I want them to act character-wise so that they act until the current ...
pxeger's user avatar
  • 111
4 votes
3 answers
352 views

Keep cursor from moving when using operators

I'm trying to implement a custom operator following :h :map-operator. The operator works just fine but has the side effect of moving the cursor position! For example the code defining the <F4> ...
Sebastian Müller's user avatar
3 votes
1 answer
386 views

Creating custom text objects via omap - How to run functions after the motion

I've done extensive reading including :h omap-info and Vim the hardway operator pending mode, this part is espcially good: A good way to keep the multiple ways of creating operator-pending mappings ...
run_the_race's user avatar
2 votes
1 answer
179 views

Why doesn't d_ delete to the first non-blank character on the line?

v^ and v_ both select to the first non-blank character on the line. d^ deletes to the first non-blank character on the line, but d_ deletes the entire line. Why is this? Is there any reason to use ...
vvv's user avatar
  • 53
2 votes
1 answer
287 views

Operator Modifier

I have been using vim mode for atom for quite a while, recently I've been trying to switch to nvim, but I can't seem to find a way to replicate the operator modifiers behaviour, which I've come to ...
user2662833's user avatar
0 votes
0 answers
105 views

Find out last used text object

I'm trying to figure out a way to make a repeatable operator insert. To do so I'm trying to make use of tpope/repeat. My idea is to set a repeatable call that repeats the last operation, repeating the ...
Blasco's user avatar
  • 255
0 votes
2 answers
228 views

Making operator insert and append repeatable

Is there an insert and append operation that can be followed by a text-object? I've found this plugins: https://github.com/deris/vim-operator-insert https://github.com/mwgkgk/vim-operator-insert ...
Blasco's user avatar
  • 255
1 vote
1 answer
185 views

How to create new operator by using existing operator with current motion?

function! OperatorFunc(type, ...) " how to call another operator with current motion? " do other stuff endfunction Is it possible to get motion text? such as get iw from yiw
dedowsdi's user avatar
  • 6,188