Hacker News new | past | comments | ask | show | jobs | submit login

Not exactly what you're asking for but: Alt + Up might help.

From the docs: Alt-Up and Alt-Down search the command history for the previous/next token containing the token under the cursor before the search was started. If the commandline was not on a token when the search started, all tokens match. See the history section for more information on history searching. [1]

[1] - http://fishshell.com/docs/2.1/




Up does this by default. Alt+Up is useful for searching a single word through history

I know of three history completion modes in fish.

Full command search: start typing a command and press Up. This will search for entire commands matching your query.

Word search: type any letters in a command, then press Alt+Up. This will cycle only the current word based on a substring match of your query. Useful for hostnames, filenames, etc.

Context-sensitive: If fish 'previews' the rest of a line as a lighter color text, press the right arrow key to complete. This is sensitive to the current directory and available files. If you go into a directory, `touch filename`, `cat filename`, and type `cat`, it will preview `cat filename` for you. Pressing the right arrow key will type it. If you `rm filename` or change directory, `cat filename` will no longer appear.




Consider applying for YC's Summer 2025 batch! Applications are open till May 13

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

Search: