Commit 1e7c6743 authored by Giel van Schijndel's avatar Giel van Schijndel
Browse files

sudo: maintain cursor position

I.e. when prefixing the current command-line with 'sudo ' maintain the
current cursor position instead of jumping to the end of the line.
parent 96e4e5dd
......@@ -13,9 +13,8 @@
# ------------------------------------------------------------------------------
sudo-command-line() {
[[ -z $BUFFER ]] && zle up-history
[[ $BUFFER != sudo\ * ]] && BUFFER="sudo $BUFFER"
zle end-of-line
[[ -z $BUFFER ]] && zle up-history
[[ $BUFFER != sudo\ * ]] && LBUFFER="sudo $LBUFFER"
}
zle -N sudo-command-line
# Defined shortcut keys: [Esc] [Esc]
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment