Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/enrico9034/zsh-watch-plugin
https://github.com/enrico9034/zsh-watch-plugin
Last synced: about 1 month ago
JSON representation
- Host: GitHub
- URL: https://github.com/enrico9034/zsh-watch-plugin
- Owner: enrico9034
- License: mit
- Created: 2020-10-05T13:00:27.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2021-11-16T16:05:45.000Z (over 2 years ago)
- Last Synced: 2024-01-03T04:18:14.329Z (5 months ago)
- Language: Shell
- Size: 3.91 KB
- Stars: 4
- Watchers: 1
- Forks: 1
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Lists
- awesome-zsh-plugins - watch - Easily prefix your current or previous commands with watch by pressing `CTRL + W`. (Plugins / ZSH on Windows)
- fucking-awesome-zsh-plugins - watch - Easily prefix your current or previous commands with watch by pressing `CTRL + W`. (Plugins / ZSH on Windows)
- awesome-zsh-plugins - watch - Easily prefix your current or previous commands with watch by pressing `CTRL + W`. (Plugins / ZSH on Windows)
README
# WATCH
Easily prefix your current or previous commands with `watch` by pressing Alt + w
1. Clone this repository into `$ZSH_CUSTOM/plugins` (by default `~/.oh-my-zsh/custom/plugins`)
```bash
git clone https://github.com/enrico9034/watch-plugin-zsh.git ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/watch
```2. To use it, add `watch` to the plugins array in your zshrc file:
```zsh
plugins=(... watch)
```3. Start a new terminal session.
## Usage
### Current typed commands
Say you have typed a long command and forgot to add `watch` in front:
```console
$ kubectl get pod -n namespace
```By pressing the Alt + w key, you will have the same command with `watch` prefixed without typing:
```console
$ watch kubectl get pod -n namespace
```### Previous executed commands
Say you want to delete a system file and denied:
```console
$ kubectl get pod -n namespace
$
```By pressing the Alt + w key, you will have the same command with `watch` prefixed without typing:
```console
$ rm some-system-file.txt
$
$ kubectl get pod -n namespace
$
```### This plugin is based on official sudo plugin
sudo official plugin: https://github.com/ohmyzsh/ohmyzsh/tree/master/plugins/sudo