I hate doing this but I am tired of touching a fish script as part of
some change and having `make style` radically change it. Which makes
editing fish scripts more painful than it needs to be. It is time to do
a wholesale reformatting of these scripts to conform to the documented
style as implemented by the `fish_indent` program.
Also, correct the Vi mode default escape timeout. I intended it to be 100 ms
in my previous change but it ended up 10 ms which is far too short. A 10 ms
delay will continue to cause problems for people running fish inside `screen`,
`tmux`, or over high latency connections.
This makes fish_mode_prompt rely on $fish_key_bindings instead.
fish_bind_mode is also set in default mode (only always "default"), so
it can't be used as the indicator.
Add a new function fish_mode_prompt which (if it is defined) has its output
prepended to the left prompt. Rather than replacing the prompt wholesale, make
fish_vi_mode enable this function by setting a variable __fish_vi_mode. This
enables vi mode to interoperate nicely with custom prompts. Users who want
to change how the mode is reported can either redefine this function or
erase it entirely. Fixes#1988.