Skip to content

chmouel/zsh-sudo-previous-current

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 

Repository files navigation

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 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

About

ZSH Plugin to add sudo word to the current line or the previous

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages