Going back history with multiline commands #440
-
When my last command is a muiltiline comand, and I press up, the last command shows up, with the cursor at the very last of the command. Now If I press up again, I go to the second last line, pressing up again, the third last line, and so on... Can I configure some binding that instead of going up one line at a time (in the editor), I actually go back one command at a time? IE: pressing In other words: quickly go through history, even if there are multiline commands in the history. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 2 replies
-
In the default binding, PageUp and PageDown are bound by the history prefix search. If the history prefix search is started with an empty command line, it actually moves one history entry for every keypress. If you would like to configure C-up and C-down for the actual history movement, you can use the following settings: # For emacs editing mode
ble-bind -m emacs -f C-up 'history-prev'
ble-bind -m emacs -f C-down 'history-next'
# For vi editing mode
ble-bind -m vi_imap -f C-up 'history-prev'
ble-bind -m vi_imap -f C-down 'history-next'
ble-bind -m vi_nmap -f C-up 'vi-command/history-prev'
ble-bind -m vi_nmap -f C-down 'vi-command/history-next' Or you can also configure the same through the readline interface: bind -m emacs '"\e[1;5A": previous-history'
bind -m emacs '"\e[1;5B": next-history'
bind -m vi-insert '"\e[1;5A": previous-history'
bind -m vi-insert '"\e[1;5B": next-history'
bind -m vi-command '"\e[1;5A": previous-history'
bind -m vi-command '"\e[1;5B": next-history' |
Beta Was this translation helpful? Give feedback.
In the default binding, PageUp and PageDown are bound by the history prefix search. If the history prefix search is started with an empty command line, it actually moves one history entry for every keypress.
If you would like to configure C-up and C-down for the actual history movement, you can use the following settings:
Or you can also configure the same through …