I'm used to using https://www.vim.org/scripts/script.php?script_id=2703 for replacing a text object in Vim and I'm now in the process of recreating some of this functionality in IdeaVim.
I'm using these mappings in my vimrc
:
nmap Ö <Plug>ReplaceWithRegisterOperator$
nmap öö <Plug>ReplaceWithRegisterLine
xmap ö <Plug>ReplaceWithRegisterVisual
nmap ö <Plug>ReplaceWithRegisterOperator
The first 3 lines are easy to recreate in my .ideavimrc
like this:
nnoremap Ö "_Dp
nnoremap öö "_ddP
vnoremap ö "_dP
But is this really the best way to get ö
to work with every single text object in normal mode?
nnoremap öiw "_diwP
nnoremap öaw "_dawP
nnoremap öIw "_dIwP
nnoremap öAw "_dAwP
nnoremap öis "_disP
nnoremap öas "_dasP
nnoremap öip "_dipP
nnoremap öap "_dapP
nnoremap öib "_dibP
nnoremap öab "_dabP
nnoremap öiB "_diBP
nnoremap öaB "_daBP
nnoremap öi( "_di(P
nnoremap öi) "_di)P
nnoremap öa( "_da(P
nnoremap öa) "_da)P
nnoremap öi[ "_di[P
nnoremap öi] "_di]P
nnoremap öa[ "_da[P
nnoremap öa] "_da]P
nnoremap öi{ "_di{P
nnoremap öi} "_di}P
nnoremap öa{ "_da{P
nnoremap öa} "_da}P
nnoremap öi< "_di<P
nnoremap öi> "_di>P
nnoremap öa< "_da<P
nnoremap öa> "_da>P
nnoremap öi" "_di"P
nnoremap öa" "_da"P
nnoremap öi' "_di'P
nnoremap öa' "_da'P
nnoremap öi` "_di`P
nnoremap öa` "_da`P
nnoremap öit "_ditP
nnoremap öat "_datP
These mappings do work, but I was wondering if there would be a cleaner and simpler way to accomplish this?