Bash One-Liners Explained, Part V: Navigating around
31–35 of 35 posts
Re: Bash One-Liners Explained, Part V: Navigating around
#32Earlier quoted context omitted.
You can enjoy the best of both worlds with something like zsh's edit-command-line . I'm very happy with Emacs keys in the shell, unless I need to make a non-trivial edit or type in a multi-line command. In those cases, C-x C-e drops me right into Vim with the current command-line ready for editing.
Anybody know how to do the equivalent of C-x C-e in vim mode?
Re: Bash One-Liners Explained, Part V: Navigating around
#33One shortcut that used often is Ctrl-o. When you have a few commands in your history that you want to repeat in that seqeunce, search for the first command in the group, optionally edit it if you want, and press Ctrl-o instead of the ENTER key.
After this command is executed, the next command in the history is presented to you. Press Ctrl-o again to continue the sequence, or press ENTER once you reached the last command in the sequence.
If you want skip a command in the sequence, instead of Ctrl-o just press Ctrl-n (or down-arrow) to get the next one in sequence.
Re: Bash One-Liners Explained, Part V: Navigating around
#34Re: Bash One-Liners Explained, Part V: Navigating around
#35Instead of searching through history, you can add this to your .inputrc "\e[B": history-search-forward "\e[A": history-search-backward And this to your .bash_proflie export HISTCONTROL=erasedups export HISTSIZE=100000 shopt -s histappend Now the up/down arrow keys auto search and complete backwards/forwards based on what's written. If the line is empty, it behaves as normal. This is also pretty neat, in your .bash_pr…
> When this variable is assigned a value, the history file is truncated
Which I read as meaning if you export the following then you should get infinite entries:
export HISTFILESIZE=
I'm testing to see if it works for this also: export HISTSIZE=