Easily prefix your current or previous commands with watch by pressing Alt + w
- Clone this repository into
$ZSH_CUSTOM/plugins(by default~/.oh-my-zsh/custom/plugins)
git clone https://github.com/enrico9034/watch-plugin-zsh.git ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/watch- To use it, add
watchto the plugins array in your zshrc file:
plugins=(... watch)- Start a new terminal session.
Say you have typed a long command and forgot to add watch in front:
$ kubectl get pod -n namespaceBy pressing the Alt + w key, you will have the same command with watch prefixed without typing:
$ watch kubectl get pod -n namespaceSay you want to delete a system file and denied:
$ kubectl get pod -n namespace
$By pressing the Alt + w key, you will have the same command with watch prefixed without typing:
$ rm some-system-file.txt
$
$ kubectl get pod -n namespace
$sudo official plugin: https://github.com/ohmyzsh/ohmyzsh/tree/master/plugins/sudo