9

I have this mappings for indenting several lines by pressing TAB in visual mode:

vnoremap <Tab> >gv
vnoremap <S-Tab> <gv

But it conflicts with snipmate plugin. Is there a way to remap TAB button to work only in visual line mode (S-V)?

Anton
  • 2,217
  • 3
  • 21
  • 34

1 Answers1

16

Change your mapping commands from vnoremap to xnoremap:

xnoremap <Tab> >gv
xnoremap <S-Tab> <gv

Why?

v[nore]map defines mappings both for visual mode and for select mode. Because Snipmate puts you into select mode when you are on a placeholder you need to use a more specific mapping command that can't be triggered in select mode: x[nore]map.

Actually, you should always use x[nore]map instead of v[nore]map.

romainl
  • 186,200
  • 21
  • 280
  • 313