zsh keybinding: insert-last-word
Clash Royale CLAN TAG#URR8PPP
up vote
3
down vote
favorite
In zsh
, I have alt+. bound to insert-last-word
When I am listing through the last command parameters by repeatedly pressing alt+., sometimes I press one too many and I need to go one back.
What keybinding is used to go back?
zsh keyboard-shortcuts
add a comment |
up vote
3
down vote
favorite
In zsh
, I have alt+. bound to insert-last-word
When I am listing through the last command parameters by repeatedly pressing alt+., sometimes I press one too many and I need to go one back.
What keybinding is used to go back?
zsh keyboard-shortcuts
add a comment |
up vote
3
down vote
favorite
up vote
3
down vote
favorite
In zsh
, I have alt+. bound to insert-last-word
When I am listing through the last command parameters by repeatedly pressing alt+., sometimes I press one too many and I need to go one back.
What keybinding is used to go back?
zsh keyboard-shortcuts
In zsh
, I have alt+. bound to insert-last-word
When I am listing through the last command parameters by repeatedly pressing alt+., sometimes I press one too many and I need to go one back.
What keybinding is used to go back?
zsh keyboard-shortcuts
zsh keyboard-shortcuts
edited yesterday
Jeff Schaller
35.8k952119
35.8k952119
asked yesterday
Martin Vegter
56233117231
56233117231
add a comment |
add a comment |
1 Answer
1
active
oldest
votes
up vote
2
down vote
accepted
You can just undo
, bound to Ctrl+_ in emacs
mode by default (note that insert-last-word
is also bound to Alt+_).
After undo
ing though, if you invoke insert-last-word
again, you'll be back to the beginning, you can't just alternate pressing Ctrl+_ and Alt+_ to go back and forth in the history.
For that, you'd need to define a separate widget that invokes the insert-last-word
widget with 1
as argument (see info zsh insert-last-word
for details).
For instance, bound to Alt+,:
insert-last-word-forward() zle insert-last-word 1
zle -N insert-last-word-forward
bindkey 'e,' insert-last-word-forward
thebind
on the last line did not work. I had to change that tobindkey
.
– Martin Vegter
yesterday
@Martin, sorry, my bad. Fixed now.
– Stéphane Chazelas
yesterday
add a comment |
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
2
down vote
accepted
You can just undo
, bound to Ctrl+_ in emacs
mode by default (note that insert-last-word
is also bound to Alt+_).
After undo
ing though, if you invoke insert-last-word
again, you'll be back to the beginning, you can't just alternate pressing Ctrl+_ and Alt+_ to go back and forth in the history.
For that, you'd need to define a separate widget that invokes the insert-last-word
widget with 1
as argument (see info zsh insert-last-word
for details).
For instance, bound to Alt+,:
insert-last-word-forward() zle insert-last-word 1
zle -N insert-last-word-forward
bindkey 'e,' insert-last-word-forward
thebind
on the last line did not work. I had to change that tobindkey
.
– Martin Vegter
yesterday
@Martin, sorry, my bad. Fixed now.
– Stéphane Chazelas
yesterday
add a comment |
up vote
2
down vote
accepted
You can just undo
, bound to Ctrl+_ in emacs
mode by default (note that insert-last-word
is also bound to Alt+_).
After undo
ing though, if you invoke insert-last-word
again, you'll be back to the beginning, you can't just alternate pressing Ctrl+_ and Alt+_ to go back and forth in the history.
For that, you'd need to define a separate widget that invokes the insert-last-word
widget with 1
as argument (see info zsh insert-last-word
for details).
For instance, bound to Alt+,:
insert-last-word-forward() zle insert-last-word 1
zle -N insert-last-word-forward
bindkey 'e,' insert-last-word-forward
thebind
on the last line did not work. I had to change that tobindkey
.
– Martin Vegter
yesterday
@Martin, sorry, my bad. Fixed now.
– Stéphane Chazelas
yesterday
add a comment |
up vote
2
down vote
accepted
up vote
2
down vote
accepted
You can just undo
, bound to Ctrl+_ in emacs
mode by default (note that insert-last-word
is also bound to Alt+_).
After undo
ing though, if you invoke insert-last-word
again, you'll be back to the beginning, you can't just alternate pressing Ctrl+_ and Alt+_ to go back and forth in the history.
For that, you'd need to define a separate widget that invokes the insert-last-word
widget with 1
as argument (see info zsh insert-last-word
for details).
For instance, bound to Alt+,:
insert-last-word-forward() zle insert-last-word 1
zle -N insert-last-word-forward
bindkey 'e,' insert-last-word-forward
You can just undo
, bound to Ctrl+_ in emacs
mode by default (note that insert-last-word
is also bound to Alt+_).
After undo
ing though, if you invoke insert-last-word
again, you'll be back to the beginning, you can't just alternate pressing Ctrl+_ and Alt+_ to go back and forth in the history.
For that, you'd need to define a separate widget that invokes the insert-last-word
widget with 1
as argument (see info zsh insert-last-word
for details).
For instance, bound to Alt+,:
insert-last-word-forward() zle insert-last-word 1
zle -N insert-last-word-forward
bindkey 'e,' insert-last-word-forward
edited yesterday
answered yesterday
Stéphane Chazelas
293k54547888
293k54547888
thebind
on the last line did not work. I had to change that tobindkey
.
– Martin Vegter
yesterday
@Martin, sorry, my bad. Fixed now.
– Stéphane Chazelas
yesterday
add a comment |
thebind
on the last line did not work. I had to change that tobindkey
.
– Martin Vegter
yesterday
@Martin, sorry, my bad. Fixed now.
– Stéphane Chazelas
yesterday
the
bind
on the last line did not work. I had to change that to bindkey
.– Martin Vegter
yesterday
the
bind
on the last line did not work. I had to change that to bindkey
.– Martin Vegter
yesterday
@Martin, sorry, my bad. Fixed now.
– Stéphane Chazelas
yesterday
@Martin, sorry, my bad. Fixed now.
– Stéphane Chazelas
yesterday
add a comment |
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f481713%2fzsh-keybinding-insert-last-word%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown