mirror of
https://github.com/fish-shell/fish-shell
synced 2025-01-13 21:44:16 +00:00
Remove setup outside of fish_prompt from sample prompts
This doesn't work with fish_config. For terlar and pythonista, remove unnecessary color setting. For informative+git and pythonista, move variable setup into fish_prompt Fixes #1141
This commit is contained in:
parent
5043b9d06e
commit
60089f9750
3 changed files with 57 additions and 30 deletions
|
@ -1,29 +1,63 @@
|
||||||
# name: Informative Git Prompt
|
# name: Informative Git Prompt
|
||||||
# author: Mariusz Smykula <mariuszs at gmail.com>
|
# author: Mariusz Smykula <mariuszs at gmail.com>
|
||||||
|
|
||||||
set -g __fish_git_prompt_show_informative_status 1
|
|
||||||
set -g __fish_git_prompt_hide_untrackedfiles 1
|
|
||||||
|
|
||||||
set -g __fish_git_prompt_color_branch magenta --bold
|
|
||||||
set -g __fish_git_prompt_showupstream "informative"
|
|
||||||
set -g __fish_git_prompt_char_upstream_ahead "↑"
|
|
||||||
set -g __fish_git_prompt_char_upstream_behind "↓"
|
|
||||||
set -g __fish_git_prompt_char_upstream_prefix ""
|
|
||||||
|
|
||||||
set -g __fish_git_prompt_char_stagedstate "●"
|
|
||||||
set -g __fish_git_prompt_char_dirtystate "✚"
|
|
||||||
set -g __fish_git_prompt_char_untrackedfiles "…"
|
|
||||||
set -g __fish_git_prompt_char_conflictedstate "✖"
|
|
||||||
set -g __fish_git_prompt_char_cleanstate "✔"
|
|
||||||
|
|
||||||
set -g __fish_git_prompt_color_dirtystate blue
|
|
||||||
set -g __fish_git_prompt_color_stagedstate yellow
|
|
||||||
set -g __fish_git_prompt_color_invalidstate red
|
|
||||||
set -g __fish_git_prompt_color_untrackedfiles $fish_color_normal
|
|
||||||
set -g __fish_git_prompt_color_cleanstate green --bold
|
|
||||||
|
|
||||||
|
|
||||||
function fish_prompt --description 'Write out the prompt'
|
function fish_prompt --description 'Write out the prompt'
|
||||||
|
if not set -q __fish_git_prompt_show_informative_status
|
||||||
|
set -g __fish_git_prompt_show_informative_status 1
|
||||||
|
end
|
||||||
|
if not set -q __fish_git_prompt_hide_untrackedfiles
|
||||||
|
set -g __fish_git_prompt_hide_untrackedfiles 1
|
||||||
|
end
|
||||||
|
|
||||||
|
if not set -q __fish_git_prompt_color_branch
|
||||||
|
set -g __fish_git_prompt_color_branch magenta --bold
|
||||||
|
end
|
||||||
|
if not set -q __fish_git_prompt_showupstream
|
||||||
|
set -g __fish_git_prompt_showupstream "informative"
|
||||||
|
end
|
||||||
|
if not set -q __fish_git_prompt_char_upstream_ahead
|
||||||
|
set -g __fish_git_prompt_char_upstream_ahead "↑"
|
||||||
|
end
|
||||||
|
if not set -q __fish_git_prompt_char_upstream_behind
|
||||||
|
set -g __fish_git_prompt_char_upstream_behind "↓"
|
||||||
|
end
|
||||||
|
if not set -q __fish_git_prompt_char_upstream_prefix
|
||||||
|
set -g __fish_git_prompt_char_upstream_prefix ""
|
||||||
|
end
|
||||||
|
|
||||||
|
if not set -q __fish_git_prompt_char_stagedstate
|
||||||
|
set -g __fish_git_prompt_char_stagedstate "●"
|
||||||
|
end
|
||||||
|
if not set -q __fish_git_prompt_char_dirtystate
|
||||||
|
set -g __fish_git_prompt_char_dirtystate "✚"
|
||||||
|
end
|
||||||
|
if not set -q __fish_git_prompt_char_untrackedfiles
|
||||||
|
set -g __fish_git_prompt_char_untrackedfiles "…"
|
||||||
|
end
|
||||||
|
if not set -q __fish_git_prompt_char_conflictedstate
|
||||||
|
set -g __fish_git_prompt_char_conflictedstate "✖"
|
||||||
|
end
|
||||||
|
if not set -q __fish_git_prompt_char_cleanstate
|
||||||
|
set -g __fish_git_prompt_char_cleanstate "✔"
|
||||||
|
end
|
||||||
|
|
||||||
|
if not set -q __fish_git_prompt_color_dirtystate
|
||||||
|
set -g __fish_git_prompt_color_dirtystate blue
|
||||||
|
end
|
||||||
|
if not set -q __fish_git_prompt_color_stagedstate
|
||||||
|
set -g __fish_git_prompt_color_stagedstate yellow
|
||||||
|
end
|
||||||
|
if not set -q __fish_git_prompt_color_invalidstate
|
||||||
|
set -g __fish_git_prompt_color_invalidstate red
|
||||||
|
end
|
||||||
|
if not set -q __fish_git_prompt_color_untrackedfiles
|
||||||
|
set -g __fish_git_prompt_color_untrackedfiles $fish_color_normal
|
||||||
|
end
|
||||||
|
if not set -q __fish_git_prompt_color_cleanstate
|
||||||
|
set -g __fish_git_prompt_color_cleanstate green --bold
|
||||||
|
end
|
||||||
|
|
||||||
set -l last_status $status
|
set -l last_status $status
|
||||||
|
|
||||||
|
|
|
@ -1,15 +1,11 @@
|
||||||
# name: Simple Pythonista
|
# name: Simple Pythonista
|
||||||
# author: davbo
|
# author: davbo
|
||||||
|
|
||||||
set normal (set_color normal)
|
|
||||||
set magenta (set_color magenta)
|
|
||||||
set yellow (set_color yellow)
|
|
||||||
set green (set_color green)
|
|
||||||
set gray (set_color -o black)
|
|
||||||
|
|
||||||
set -g VIRTUAL_ENV_DISABLE_PROMPT true
|
|
||||||
|
|
||||||
function fish_prompt
|
function fish_prompt
|
||||||
|
if not set -q VIRTUAL_ENV_DISABLE_PROMPT
|
||||||
|
set -g VIRTUAL_ENV_DISABLE_PROMPT true
|
||||||
|
end
|
||||||
set_color yellow
|
set_color yellow
|
||||||
printf '%s' (whoami)
|
printf '%s' (whoami)
|
||||||
set_color normal
|
set_color normal
|
||||||
|
|
|
@ -1,9 +1,6 @@
|
||||||
# name: Terlar
|
# name: Terlar
|
||||||
# author: terlar - https://github.com/terlar
|
# author: terlar - https://github.com/terlar
|
||||||
|
|
||||||
set -g fish_color_user magenta
|
|
||||||
set -g fish_color_host yellow
|
|
||||||
|
|
||||||
function fish_prompt --description 'Write out the prompt'
|
function fish_prompt --description 'Write out the prompt'
|
||||||
set -l last_status $status
|
set -l last_status $status
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue