jeffreytse / zsh-vi-mode

💻 A better and friendly vi(vim) mode plugin for ZSH.
MIT License
3.13k stars 109 forks source link

Support configuring the initialization mode #113

Closed jeffreytse closed 3 years ago

jeffreytse commented 3 years ago

Add an option called ZVM_INIT_MODE for people to configure the initialization mode. It allows users to decide the order of keybindings, since most of plugins do their keybindings when they are sourcing.

# Doing initialization at the first new command line starting (Default)
ZVM_INIT_MODE=precmd

# Doing initialization at the plugin sourcing (Instantly)
ZVM_INIT_MODE=sourcing

# Here we source the plugin
source zsh-vi-mode.zsh