4 ms·
the documentation is in a local file, so it works on the plane. to edit the default prompt (or any function): funced fish_prompt will launch your editor.
by micampe 13y ago
the documentation is in a local file, so it works on the plane.
to edit the default prompt (or any function):
funced fish_prompt
will launch your editor. then:
funcsave fish_prompt
to persist a copy in your user's configuration.
all shell instances will pick it up right away, no need to close, relaunch or source anything.
- barrkel 13y agoDo you know the equivalent to Alt+. in readline? And how to incrementally search the history (i.e. anywhere in the command, not just the start of the line like the autocomplete)? And does fish really need to separate out its subshell from text substitution? E.g. I'd write 'echo "my host is $(hostname)."' in bash, but in fish I seem to need to use 'echo "my host is " (hostname) "."', which is a lot more fiddly, noisy, ugly etc. And do you know the equivalent of <() in bash? I use that with fgrep -f a lot. And (<todo.txt)? That's another one I use in workflows, though (cat todo.txt) would be a verbose alternative.
- micampe 13y ago(I actually don't use fish full time, been experimenting once in a while) I believe Alt+. (or any kind of history substitution) hasn't been implemented by design. I don't have references handy but they should be easy to find. Incremental history search is just type something and then up arrow. The rest of your questions I don't know the answers but it wouldn't surprise me if there were none. Fish prefers to have a simple and coherent syntax to a concise one (though I agree the text substitution is annoying – it seems they usually put the subshell result in a variable and expand that in the string). This helps understanding their design goals http://ridiculousfish.com/shell/user_doc/html/design.html http://ridiculousfish.com/shell/user_doc/html/design.html
- siteshwar 13y agoUpdated design documentation can be found at http://fishshell.com/docs/2.0/design.html http://fishshell.com/docs/2.0/design.html
- barrkel 13y agoThanks for your answers. Incremental search isn't too bad once I found out about bind and the other key bindings, as the arrow keys are some distance from the home keys. Lack of Alt+. quickly became annoying. It's so useful; meanwhile, prefix search isn't a significant improvement over incremental search, and I usually know ahead of time whether my command is in the history or not, so being prompted an irrelevance is more annoying than having to type Ctrl+R in readline. I disable auto-completion in browsers, Google etc. for similar reasons. You're right about not much else. Command substitution is the only thing implemented, not subshells or process substitution. I probably exercise my shell more than average, so I don't think fish is feature-rich enough yet for me. It's a good thing the design goals have been updated to remove "a large performance decrease [...] is acceptable in order to improve [modularity]". That would have been a total killer. Process forking is often a performance limitation for me in the shell, so I strive, wherever possible, to use the builtins that fish so proudly spurned.
- mixmastamyk 13y agoecho my host is (hostname). Doesn't need quotes.
- sagarm 13y ago<($cmd) is called "process substitution." The fish equivalent is ($cmd | psub) I miss incremental history search myself -- that's probably my most used bash feature. Typing a few letters and then hitting C-P or up arrow works, but there's no way to refine the search if you don't get the result you're looking for.