I would love to map << and >> to single keys to speed up my workflow, but I can't find any info on how to write the remap in my vimrc. Any idea how I can get my remap on?
The other responses given answer your immediate question. I would just like to suggest that you remap that to indent and dedent to and respectively, in both normal and visual modes (making sure to add gv
to reselect in visual selection mode):
nnoremap <TAB> >>
nnoremap <S-TAB> <<
vnoremap <TAB> >gv
vnoremap <S-TAB> <gv
In insert mode of course, as you probably might know already, you can just use Ctrl-t and Ctrl-d to indent/dedent.
You're probably looking for :noremap
:
:noremap > >>
:noremap < <<
If you just use :map
, you of course get recursively defined function, which is hilarious. (^C
will stop it.) The :noremap
variant doesn't recursively expand mappings.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With