Vertical vim cursor in command mode

前端 未结 2 1237
情深已故
情深已故 2021-01-24 10:38

Im on mac and I have my terminal cursor set to the vertical bar option. However in vim command mode the cursor is the vertical bar but it wont let me use hjkl to go to the end o

2条回答
  •  时光说笑
    2021-01-24 11:19

    I think you're looking for set virtualedit=onemore.

    From :help 'virtualedit':

    A comma separated list of these words:
        block   Allow virtual editing in Visual block mode.
        insert  Allow virtual editing in Insert mode.
        all     Allow virtual editing in all modes.
        onemore Allow the cursor to move just past the end of the line
    
    [...]
    
    "onemore" is not the same, it will only allow moving the cursor just
    after the last character of the line.  This makes some commands more
    consistent.  Previously the cursor was always past the end of the line
    if the line was empty.  But it is far from Vi compatible.  It may also
    break some plugins or Vim scripts.  For example because l can move
    the cursor after the last character.  Use with care!
    

    I've never noticed any problems myself, so it seems reasonably safe in spite of the warning.

提交回复
热议问题