And some cool key bindings. I put these in a .inputrc file in my home.
# Up Arrow
"\e[A": history-search-backward
# Down Arrow
"\e[B": history-search-forward
This changes the behavior of the Up and Down arrows, if you have some text in your prompt it will perform a search using that text. Is like a "prefix search". Let's say I have these three commands in my history.
vim /tmp/test.txt
nvim /tmp/test.txt
echo "a string with vi in it"
vim /tmp/other-text.txt
If you start writing vi and then hit the Up arrow it will only cycle through the commands that start with vi. In this case it will skip nvim and the one that has vi in the middle.
If you are not a fan of changing the arrow keys behavior I suggest using these.
# Alt + k
"\ek": history-search-backward
# Alt + j
"\ej": history-search-forward
You can find more aliases and functions on my dotfiles.
The only use case I have for
duFor directory navigation I prefer numbers.
Some shortcuts for common
tmuxcommandsThat last one uses: gone.
And some cool key bindings. I put these in a
.inputrcfile in my home.This changes the behavior of the Up and Down arrows, if you have some text in your prompt it will perform a search using that text. Is like a "prefix search". Let's say I have these three commands in my history.
If you start writing
viand then hit the Up arrow it will only cycle through the commands that start withvi. In this case it will skipnvimand the one that hasviin the middle.If you are not a fan of changing the arrow keys behavior I suggest using these.
You can find more aliases and functions on my dotfiles.
I'll steal you directory navigation aliases.