Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: zle: vi mode: wrong undo handling on fresh lines



On Sep 22,  2:37pm, Hauke Petersen wrote:
}
} example, typing
} 
}     foo<ESC>u
} 
} yields "fo" instead of the expected empty line. Expliduntantly setting

Congratulations, google finds no occurrences of that outside of the zsh
archive for this thread.  You have officially coined a word.

}     function zle-line-init { zle vi-insert; }; zle -N zle-line-init
} 
} works around this misbehavior

Until the bug is fixed, try something like

  zle-line-init() { [[ -o vi ]] && { zle vi-cmd-mode; zle vi-insert } }

} As an aside, `zle -K viins' does not have the same effect as `zle
} vi-insert' here, when I expected them to be functionally equivalent.

Well, no.  "zle -K viins" means you're still in whatever "mode" you were
in before (emacs, vicmd, or viins), but have started using the keymap
normally used for viins mode.  Similarly "zle -K menuselect" would not
magically fling you into the completion menu.  "zle vi-insert" causes an
actual change of mode, just as "zle menu-select" begins completion.



Messages sorted by: Reverse Date, Date, Thread, Author