I started to use vim recently, but I miss the character/line selection methods from other text editors. By default vim maps <S-Up>
, <S-Down>
to jumping one page up/down and I want to remap these to text selection.
Is there a way to do that?
I completed @escrafford mapping with insert mode's ones:
" shift+arrow selection nmap <S-Up> v<Up> nmap <S-Down> v<Down> nmap <S-Left> v<Left> nmap <S-Right> v<Right> vmap <S-Up> <Up> vmap <S-Down> <Down> vmap <S-Left> <Left> vmap <S-Right> <Right> imap <S-Up> <Esc>v<Up> imap <S-Down> <Esc>v<Down> imap <S-Left> <Esc>v<Left> imap <S-Right> <Esc>v<Right>
Also mapping usual copy/cut/paste like this you can return to insert mode after select+copy, for example.
vmap <C-c> y<Esc>i vmap <C-x> d<Esc>i map <C-v> pi imap <C-v> <Esc>pi imap <C-z> <Esc>ui
Now you can start a shift+arrow selection from any mode, then C-c to copy, and then C-v to paste. You always end in insert mode, so you have also C-z to undo.
I think this approaches more to the 'expected standard' behaviour for a text editor yu are asking for.
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