Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/chmouel/zsh-sudo-previous-current
ZSH Plugin to add sudo word to the current line or the previous
https://github.com/chmouel/zsh-sudo-previous-current
sudo zsh zsh-plugin
Last synced: about 1 month ago
JSON representation
ZSH Plugin to add sudo word to the current line or the previous
- Host: GitHub
- URL: https://github.com/chmouel/zsh-sudo-previous-current
- Owner: chmouel
- License: apache-2.0
- Created: 2023-09-20T09:07:38.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2024-06-17T16:57:29.000Z (8 months ago)
- Last Synced: 2024-11-22T01:47:57.156Z (3 months ago)
- Topics: sudo, zsh, zsh-plugin
- Language: Shell
- Homepage:
- Size: 7.81 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Add sudo to the current line or previous command zsh plugin
A simple zsh plugin to add a sudo to the current line or to the previous command.
It tries hard to keep the current cursor position so your flow doesn't get disturbed.It's a useful plug-in if you forget to add sudo to a command.
## Usage
- Load the plugin with your favourite zsh plugin manager or simply source the
[zsh-sudo-previous-current.plugin.zsh](zsh-sudo-previous-current.plugin.zsh)
file
- Type a command and press `control-x and s` to add sudo. If you don't type any
command, the previous command will be used.## CONFIGURATION
- `ZSH_SUDO_PREVIOUS_CURRENT_BIND`: Key binding to add sudo to the current line
or previous command. Default: `^x s` which is `ctrl+x and s`
- `ZSH_SUDO_PREVIOUS_CURRENT_CMD`: Command to use for sudo. Default: `sudo`## Authors
### Chmouel Boudjnah
- Fediverse - <[@[email protected]](https://fosstodon.org/@chmouel)>
- Twitter - <[@chmouel](https://twitter.com/chmouel)>
- Blog - <[https://blog.chmouel.com](https://blog.chmouel.com)>