Replies: 1 comment 5 replies
-
ctrl-n is bound to "down-or-search", this will either move down a line or, if you are currently in a history search, continue the search forward in time, i.e. to the newer element. However it doesn't start a history search since, conceptually, you're always "before" the newest element when you enter a new command (basically the current commandline is future history). And once you've selected a commandline from history, the history search ends. There's no persistent "history pointer" that tells fish you're still at that position in history and continues a search from there. This is a bit of state that can easily become confusing. What you're asking for is essentially #9751. |
Beta Was this translation helpful? Give feedback.
5 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I find myself often having a sequence of commands that is run for some task, work on some more things and realise I need to run the same sequence again.
What I usually do is just ctrl-p until i find the first, and remember how many I did, and just repeat the same amount for each command (given it was not too far).
What I found is that the Julia REPL allows you to step forward from last history fetch using ctrl-n on an empty line (probably exists elsewhere also, but his is where I first encountered it).
This enables me to only make a search for the first command in the sequence (either ctrl-p or crtl-r) and run it, and then ctrl-n on an empty line will start stepping forward from that spot in history.
So to repeat my sequence I just need to find and run the first command in the sequence, and then do ctrl-n + enter a few times.
Running ctrl-n when the previous command was not fetched from history does nothing.
I don't know if this already exists under some other key-combination or command, or if it would be easy to build as a script, but I couldn't find it or figure it out based on what seemed available from the history command. Though I can't say I have tried very hard, pretty new to fish scripting.
If anyone knows if this exists or can easily be built it would be awesome, otherwise I guess it is an idea for a new feature that at least one person would like :)
Beta Was this translation helpful? Give feedback.
All reactions