Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Probably not a direct answer to your comment, but fish autocompletion has two killer features I haven't found in any other shell:

1. Type part of a command and search the history: I often have to run a mysqldump + mysql load on a couple databases, and the command is quite long. If i just type `db1` and press up arrow, fish will load the command 'mysqldump -uxxx db1 | mysql -uyyy local_db1'. I don't have to create functions to do complex, common shell commands, as long as they have keywords I can use to look them up.

2. Search the history based on the current path: Suppose I have two directories, `app1` and `app2`, each with a `run-appX` executable. If I enter `app2` and I type `.`, fish will autocomplete it to `./run-app2`, because the history is context dependent, and it knows there's a `run-app2` file I've often referenced while in the `app2` directory.

Haven't found a way to replicate these two behaviours in any other shell as well as fish does, and I don't have to create separate functions for most of my workflow. fish takes care of that.



Very interesting tricks!

The first one probably has an equivalent in Bash with Ctrl-R and typing (and Ctrl+R again to cycle through matching lines)

The second one is new to me. Cool!


I have a long command I use semi-regularly in Bash. The ctrl-r search tends to turn up the wrong command, so I edited the command and appended a unique comment. Now I just do ctrl-r, unique-comment, enter.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: