Questions tagged [operator-pending-mode]

For questions about operator-pending mode, which is the mode after triggering an operator but before specifying a motion or text-object to operate on.

Filter by
Sorted by
Tagged with
2
votes
1answer
20 views

Recursive map to <leader> not working

I have a german keyboard and \ is hard to reach, so I added the following line to my config: map ß \ This works fine for simple leader commands, and I did not have to change my leader command in case ...
3
votes
1answer
70 views

Is g@ useful outside of VimL scripting, i.e. when editing? (Instead of vim-repeat)

I read on an old none commentable reddit that Tpope no longer uses his vim-repeat plugin, and instead uses g@. I have used g@ in plugins, and unstand you set opfunc first, then g@{motion} will run ...
0
votes
0answers
28 views

Is <C-U> really necessary in operator-pending mode mappings?

Is <C-U> necessary when activating command mode within operator-pending mode mappings? According to :h omap-info, onoremap <silent> F :<C-U>normal! 0f(hviw<CR> The ...
1
vote
1answer
21 views

How to test whether the cursor is at the end of a line in a mapping?

I would like to test in an operator-pending mapping whether the cursor is on the last position of the line. I currently have this, but it does not work: onoremap <expr> i$ col('.') == col('$') ?...
1
vote
1answer
46 views

How to ignore or silence errors in operator-pending mappings?

The following operator-depending mapping works great for me, onoremap <silent> a$ :<C-U>normal! hEF$v,<CR> except when it is issued at the very beginning of a line. What happens is ...
3
votes
1answer
65 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 ...
3
votes
1answer
70 views

custom mapping to make dge consistent with dw, de, and db?

Situation Recently I was investigating the behaviour of word motions in vim and to me it seems like ge is grossly inconsistent with the other 3. Here is an example with ^ showing the cursor: word1 ...
4
votes
5answers
302 views

Delete text between two $ symbols in gvim

I understand that we can use da{ to delete a whole {} block in vim. I am wondering if there is a corresponding version with { replaced by $ (similarly for di{) as this would be very useful for people ...
2
votes
1answer
45 views

What is the purpose of the short cursor in command mode?

If I'm in command mode with default vim and I press the right angle key, the cursor switches from the normal block to a short version. What is the function of this? (Sometimes it seems related to ...
2
votes
1answer
85 views

Visual/Operator-pending autocommand?

Last week, I turned off 'number' and have been using only 'relativenumber', plus a line/column count in my status line. I don't really look at line numbers that much. But now I've had a radical idea. ...