Skip to main content

Questions tagged [map-operator]

Use this tag for questions about creating your own operator within vim.

2 votes
5 answers
286 views

I did a macro, that works, and I want to save it for future use. I am afraid to leave the macro in the registry because it might be overwritten, then I want to save it in a function (or a plugin). I ...
Antonio's user avatar
  • 351
0 votes
2 answers
69 views

I read the example in :h map-operator which does the job but it is very convoluted. I am wondering if there is a simpler way to save/restore options before/after having set 'opfunc' and run g@. My ...
Barzi2001's user avatar
  • 1,133
2 votes
3 answers
529 views

I'm currently trying to create a mapping that sends a command and a newline to an open terminal using nnoremap and term_sendkeys(). term_sendkeys() interprets the \<CR> string as a newline, so ...
Martín Fixman's user avatar
6 votes
1 answer
915 views

On regular AIX vi (not vim, just plain old vi): I tried to do the following map, but it fails on the "P" or "p" part with the message Cannot use the put command while inside a ...
Olivier Dulac's user avatar
1 vote
2 answers
122 views

I use a plugin for todo.txt file (https://gitlab.com/dbeniamine/todo.txt-vim). Because I mapped some d[other_letters] in my .vimrc and there's a \d mapped in the plugin, to avoid delays when I type \d ...
Antonio's user avatar
  • 351
2 votes
1 answer
294 views

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 ...
user avatar
2 votes
1 answer
96 views

I've written some customizations in my .vimrc that I would like to further improve and refine. In particular, for some key combinations, I'm doing text substitutions, like this: vmap <C-S-w> :s/\...
Jonas Mechtheim's user avatar
0 votes
1 answer
69 views

function! s:Surround(motion = "") abort let [_, l:start_row, l:start_col, _] = getpos("'[") let [_, l:end_row, l:end_col, _] = getpos("']") let l:before = &...
Big McLargeHuge's user avatar
0 votes
1 answer
272 views

Context I'm evaluating https://github.com/tyru/open-browser.vim which looks really promising. I figured out how to set the default search engine and add a mapping " vim-openbrowser let g:...
Dan Garthwaite's user avatar
0 votes
1 answer
91 views

This questions sounds ridicolous, but is there any (mental?!) aid for my struggle when resizing windows? Since the earliest days of my vi/m usage, I have struggle shrinking windows in the correct ...
Tomes's user avatar
  • 96
2 votes
1 answer
215 views

The following is from vim-sensible plugin: set incsearch " Use <C-L> to clear the highlighting of :set hlsearch. if maparg('<C-L>', 'n') ==# '' nnoremap <silent> <C-L> :...
john c. j.'s user avatar
0 votes
2 answers
341 views

I frequently use EasyAlign in my tex files to align tables around the $ delimiter such that this header1 & header2 & header3 \\ data1 & data2 & data3 \\ becomes this header1 & ...
joharr's user avatar
  • 103
1 vote
1 answer
178 views

To call a custom operator with a mapping, one can do nnoremap <Plug>(Foo) :set opfunc=Baa<CR>g@ so that <Plug>(Foo) expects a motion, after which the function Baa is called. Here, ...
husB's user avatar
  • 2,183
1 vote
1 answer
186 views

I'm already aware of existing solution to automatically "surround" sentences/word/etc (eg: auto-surround, vim-surround, etc) but those (as far as i know) don't support using normal strings ...
secemp9's user avatar
  • 723
0 votes
1 answer
93 views

I am trying to map MarkdownPreviewToggle to an key like "mk". My vimrc is like it: nnoremap mk <Plug>MarkdownPreviewToggle But it doesnt work, what should i do? (the other key isnt ...
BreezyMain's user avatar

15 30 50 per page