Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Configure terminal history searching #125

Open
chrisjsewell opened this issue Jul 13, 2020 · 4 comments
Open

Configure terminal history searching #125

chrisjsewell opened this issue Jul 13, 2020 · 4 comments

Comments

@chrisjsewell
Copy link
Member

Just a minor quality of life configuration. I always find it helpful to configure my terminal (a) to not store duplicate commands in history and (b) to allow for incremental searching (e.g. if you type ab, then it will only toggle commands in history beginning with ab.

for (a), you add in ~/.bashrc:

HISTCONTROL=ignoreboth
# optionally increase history capacity
HISTSIZE=1000000
HISTFILESIZE=1000000000

(see https://www.linuxjournal.com/content/using-bash-history-more-efficiently-histcontrol)

for (b), you add in ~/.inputrc:

"\e[A": history-search-backward
"\e[B": history-search-forward

(see https://codeinthehole.com/tips/the-most-important-command-line-tip-incremental-history-searching-with-inputrc/)

@borellim
Copy link
Member

I'm happy to add the history options.
The .inputrc additions, while cool, break CTRL-left and CTRL-right to move the cursor one word to the left and right...

@borellim
Copy link
Member

Thinking about it, 1M lines in memory and 1B lines on disk seems a bit excessive... What about 100k for both?

@chrisjsewell
Copy link
Member Author

The .inputrc additions, while cool, break CTRL-left and CTRL-right to move the cursor one word to the left and right...

Well I personally find the history much more helpful 😉 but yeh it's not a necessity. Perhaps there's a way to incoporate both

What about 100k for both

ph yeh sure that was just an example 👍

@borellim
Copy link
Member

Perhaps there's a way to incoporate both

This appears to do the trick:

"\e[1;5C": forward-word
"\e[1;5D": backward-word

I still want to wait a bit, I might find more stuff that's broken. Cool suggestions though.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants