Calling zle set-local-history 1 from .zshrc causes
widgets can only be called when ZLE is active
Is there a way to execute the widget on startup, or maybe a setting for this particular case?
upd: I checked zsh source code, and I believe that hist_skip_flags is set only by set-local-history widget, so there is no setting to change this behavior. However it is much harder to determinate if it's possible to run zle widget on startup.
bindkeycan be used in zshrc, which according to the guide should mean that zle is loaded. – magras Feb 15 '23 at 14:16set-local-history 1– DavidPostill Feb 15 '23 at 15:13ZLE_STATEis persisting in between widget calls and is global (changes to it are visible to other widgets), so it is possible to switch between local and global history at runtime without wrapping and rebinding all functions that access history. – magras Feb 15 '23 at 15:54ALT+X, where you can executeset-local-historywhich will toggle between global and local history. If you want to have the local state by default, IMHO you have to redefine the widgets you are using to access the history, as it is explained in the Q&A which DavidPostill linked above. – mpy Feb 15 '23 at 18:28zle-line-inithook work for you? – okapi Mar 18 '23 at 01:03