Mapping -Arrows to selecting characters/lines

前端 未结 8 1090
再見小時候
再見小時候 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:40

    I completed @escrafford mapping with insert mode's ones:

    " shift+arrow selection
    nmap  v
    nmap  v
    nmap  v
    nmap  v
    vmap  
    vmap  
    vmap  
    vmap  
    imap  v
    imap  v
    imap  v
    imap  v
    

    Also mapping usual copy/cut/paste like this you can return to insert mode after select+copy, for example.

    vmap  yi
    vmap  di
    map  pi
    imap  pi
    imap  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.

提交回复
热议问题