fork/fish-shell

git clone https://git.julia.blue/fork/fish-shell

Drazape(refactor) default mode prompt: multiple `test` equality checks → `contains`4c30c9ec2

master
781 B28 linesraw
1function fish_default_mode_prompt --description "Display vi prompt mode"
2    # Do nothing if not in vi mode
3    if not contains -- "$fish_key_bindings" fish_vi_key_bindings fish_hybrid_key_bindings
4        return
5    end
6    switch $fish_bind_mode
7        case default
8            set_color --bold red
9            echo '[N]'
10        case insert
11            set_color --bold green
12            echo '[I]'
13        case replace_one
14            set_color --bold green
15            echo '[R]'
16        case replace
17            set_color --bold cyan
18            echo '[R]'
19        case visual
20            set_color --bold magenta
21            echo '[V]'
22        case operator f F t T
23            set_color --bold cyan
24            echo '[N]'
25    end
26    set_color --reset
27    echo -n ' '
28end