Mapping -Arrows to selecting characters/lines

前端 未结 8 1119
再見小時候
再見小時候 2020-12-29 03:55

I started to use vim recently, but I miss the character/line selection methods from other text editors. By default vim maps ,

8条回答
  •  渐次进展
    2020-12-29 04:38

    This mapping keeps insert mode during selection (visual mode) and it starts on the correct position. You can also select a word to the left or right using Ctrl-Shift-Left/Right (if your terminal supports it):

    " Select with shift + arrows
    inoremap                  v
    inoremap                 v
    inoremap                    v
    inoremap                  v
    imap                    
    imap                   
    vnoremap                  
    vnoremap                 
    vnoremap                    
    vnoremap                  
    
    " Auto unselect when not holding shift
    vmap                        
    vmap                       
    vmap                          
    vmap                        
    

    This may be useful for quickly selecting small parts when you're in insert mode but I recommend using the default commands for selecting larger parts.

提交回复
热议问题