I recently noticed 2 features in Fish and was wondering if anyone knew if these were also available in Bash?
Syntax highlighting
Specifics:
- You'll quickly notice that fish performs syntax highlighting as you type. Invalid commands are colored red by default:
- A command may be invalid because it does not exist, or refers to a file that you cannot execute. When the command becomes valid, it is shown in a different color
- fish will underline valid file paths as you type them
- This tells you that there exists a file that starts with 'somefi', which is useful feedback as you type.
Autosuggestions
Specifics:
- fish suggests commands as you type, and shows the suggestion to the right of the cursor, in gray.
- It knows about paths and options
- To accept the autosuggestion, hit right arrow or Control-F. If the autosuggestion is not what you want, just ignore it.
bash
has is autocompletion. Unfortunately,fish
's scripting is so elementary that it's a very poor substitute for the sort of things I do routinely withbash
. – DopeGhoti Jan 15 '14 at 02:08zsh
version. – strugee Jan 15 '14 at 03:13zsh
. – strugee Jan 15 '14 at 03:41bug-bash@gnu.org
:-) – Chris Down Jan 15 '14 at 05:24history-search-(up|down)
to navigate commands beginning with what you just typed. This would mean your workflow would be to type something, and usehistory-search-up
to get the last match beginning with that, which I assume is fairly similar in functionality tofish
. You could also usereverse-i-search
, but that is slightly more rigid, and doesn't handle inline modifications to the input well. – Chris Down Jan 15 '14 at 05:30cd -@
,wait -n
,globasciiranges
, and$BASH_COMPAT
, which a lot of people wanted. Almost all the rest is just firefighting. – Chris Down Jan 15 '14 at 05:58"\e[A": history-search-backward
and"\e[B": history-search-forward
in your~/.inputrc
right? – terdon Jan 15 '14 at 13:27history-search-(backward|forward)
, not up/down :-) My brain was clearly not switched on at that point. You can either do it using inputrc (affects all readline applications), or by callingbind
(only affects bash). – Chris Down Jan 15 '14 at 13:31