ZSH set behaviour when command reading
by hashille from LinuxQuestions.org on (#4YE1S)
Hello everyone,
I hope i'm in the good place to start with.
Here is my question : I've been looking for a way to set a defined behaviour when zsh is reading from the command-line, i've come across Zshzle but can't find anything related to what I would like to do :
I would like to start all of my commands with a special character and if it's not there, call my "lock" alias.
Let's say I have the following command line :
"vim ~/.bashrc"
then it would call my "lock" alias and lock my computer, as the "good" input would have been "h vim ~/.bashrc".
Any suggestions ?
Thanks


I hope i'm in the good place to start with.
Here is my question : I've been looking for a way to set a defined behaviour when zsh is reading from the command-line, i've come across Zshzle but can't find anything related to what I would like to do :
I would like to start all of my commands with a special character and if it's not there, call my "lock" alias.
Let's say I have the following command line :
"vim ~/.bashrc"
then it would call my "lock" alias and lock my computer, as the "good" input would have been "h vim ~/.bashrc".
Any suggestions ?
Thanks