TransWikia.com

How can I repeat a custom function mapped using `vnoremap` using something similar to the dot (`.`) operator?

Vi and Vim Asked on December 16, 2021

I have this custom function in my ~/.vimrc mapped to Visual mode using vnoremap.

After having executed the function using <leader><space>, how execute it again using something similar to the dot (.) operator, so that I don’t have two press to keys?

function! Visual_indent_with_space() range abort
   '<,'>g/./exe "normal! " v:count1 . "I "
   :normal gv
endfunction

vnoremap <leader><space> :call Visual_indent_with_space()<cr>

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP