BML
put the following three lines in your .vimrc:
" move text and rehighlight -- vim tip_id=224
vnoremap > ><CR>gv
vnoremap < <<CR>gv
that should do what you want
--
sc
Well, depending on what you want, there are a couple ideas. If you just
want to continue to reindent them, you can just use the period "repeat
the last action" command which will indent them another line.
If you know how many 'shiftwidth's you want to indent, you can prefix
them with the count
3>
to indent 3 'shiftwidth's.
You can also use the "gv" command to restore the last selection no
matter what the action. If you commonly use the shifting and want to
restore, you can create mappings:
:vnoremap > >gv
:vnoremap <lt> <lt>gv
to restore visual mode after shifting.
-tim
I can, because:
- As long as visual mode remains active, the cursor can only be at one end of
the selection.
- You cannot use operator-motion or operator-object sequences in Visual mode
(not even something as simple as dd [delete line]) because the operator (such
as d) will operate on the selection instead of on the motion or object.
- I usually want successive Visual-mode operations to operate on different
selections.
- After yanking a selection, I usually want to put that yank elsewhere: this
requires moving to some other location, then using p, P or :put in non-visual
Normal mode.
And the clincher:
- I can't see how the text could usefully remain selected after a "delete"
operation. Or do you mean further cursor movements should create a new
selection extending from the deletion to the cursor?
Best regards,
Tony.
--
"I want to buy a husband who, every week when I sit down to watch `St.
Elsewhere', won't scream, `FORGET IT, BLANCHE ... IT'S TIME FOR "HEE
HAW"!!'"
-- Berke Breathed, "Bloom County"
No there isn't. If you absolutely want this
kind of feature, you can simulate it with an
autocommand.
"---------------------------
let g:autovis_enabled = 0
"Setting updatetime to this low values is
"ok, but can lead to problems with plugins,
"which, for example jump between windows.
set updatetime=100
augroup AutoVis
au!
au CursorHold * if g:autovis_enabled | exec 'normal gv' | endif
augroup END
com! -bar AutoVisOn let g:autovis_enabled = 1
com! -bar AutoVisOff let g:autovis_enabled = 0
noremap <C-V> :AutoVisOn<cr><C-V>
noremap v :AutoVisOn<cr>v
noremap V :AutoVisOn<cr>V
vnoremap <ESC> :<C-U>AutoVisOff<cr><ESC>
"---------------------------
-ap
--
Ich hab geträumt, der Krieg wär vorbei.