Closed olbrew closed 8 years ago
I'm sorry I don't know a way to detect vi mode, as I don't use this mode.
Do you want to add a variable to turn off the vi mode indicator for user who don't want to use this feature? (I'm thinking of replacing this variable with a 'constant' that you can change in your fish.config while you're searching for a solution)
I found a fix for the vi key bindings check.
Unfortunately I found out that my fix for the coloring of the right_segment_separator
gives errors so I removed it again.
It's not immediately clear to me how to give it the corresponding vi mode color in the fish_right_prompt
function because the modes are switched in prompt_vi_mode
without a global variable of some kind.
Honestly the whole prompt_segment
syntax seems like a reimplementation of built-in fish functions to me. A rewrite of fish_right_prompt.fish
with built-in fish
commands takes less than half the amount of LoC.
As this would simplify fish_right_prompt.fish
considerably and fixes the right_segment_separator
coloring issue, I'd be happy to make a new pull request if you're ok with that.
@sn0cr any updates here?
Sorry that I'm responding that late, but due to midterm exams I didn't have time to have a look to github.
Sure do it 👍- A rewrite of the theme / coloring would be a great thing to do. I can merge it as soon as you are ready.
No problem, I can relate, I'm having exams as well 😉 .
Ok, I'll close this pull request then as it still has some problems with the coloring and add a new one with the rewritten fish_right_prompt.fish as defined here. This fixes coloring issues for the right-prompt but not for the whole theme. Maybe I can take a look at that after my exams and when I have some more time 😄 .
This fixes the mode indicator by
set -q __fish_vi_mode
check as this doesn't work anymore in v2.3. I have yet to find a new way to this, @sn0cr do you happen to know one?right_prompt_segment $first_color
line. This was removed in a follow up commit to my last pull request and breaks the coloring of the left-facing arrow.