I want to be able to highlight lines I want to indent/reverse-indent and indent with tab and shift-tab respectively.
" for command mode reverse tab
nmap <S-Tab> <<
" for insert mode reverse tab
imap <S-Tab> <Esc><<i
" for command mode multiple line reverse tab(doesn't work)
nmap <Tab> i<
" for insert mode multiple line reverse tab(doesn't work)
imap <Tab> <
" for command mode tab
nmap <Tab> >>
" for command mode multiple line tab(doesn't work)
nmap <Tab> i>
" for insert mode multiple line tab(doesn't work)
imap <Tab> >
This is the last thing I need before I'm willing to use vim as my primary editor.
In visual mode,
To select and highlight your text, you need to start using visual mode, (I usually do this by hitting v, or if coming from insert mode: Escv) and select your text using the standard motions (such as h, j, k and l) .
If you do not want to use the default shortcuts < and >, create mappings for use in visual mode. You need :vmap
:
:vmap <Tab> >
:vmap <S-Tab> <
which would mean pressing
But why do you need to create a mapping for this?
Sometimes it's better just to learn the Vim (or even Vi) keys (and < and > are easy anyway), and then you can use any installation, not just the one with your .vimrc
.
For instance, you've put:
imap <Tab> <
This is a bad idea. This will make it harder for you to insert a tab-character into your text (even ctrl+i won't work as I'd expect), and every time you type tab you'll insert a <
.
Happy editing!