mirror of
https://github.com/fish-shell/fish-shell
synced 2024-12-27 05:13:10 +00:00
change name of the function
This commit is contained in:
parent
8dfee7ff76
commit
37d91d0c29
15 changed files with 18 additions and 18 deletions
|
@ -18,5 +18,5 @@ function fish_fallback_prompt --description "A simple fallback prompt without to
|
||||||
set suffix '>'
|
set suffix '>'
|
||||||
end
|
end
|
||||||
|
|
||||||
echo -n -s "$USER" @ (fish_prompt_hostname) ' ' (set_color $color_cwd) (prompt_pwd) (set_color normal) "$suffix "
|
echo -n -s "$USER" @ (prompt_hostname) ' ' (set_color $color_cwd) (prompt_pwd) (set_color normal) "$suffix "
|
||||||
end
|
end
|
||||||
|
|
|
@ -18,5 +18,5 @@ function fish_prompt --description "Write out the prompt"
|
||||||
set suffix '>'
|
set suffix '>'
|
||||||
end
|
end
|
||||||
|
|
||||||
echo -n -s "$USER" @ (fish_prompt_hostname) ' ' (set_color $color_cwd) (prompt_pwd) (set_color normal) "$suffix "
|
echo -n -s "$USER" @ (prompt_hostname) ' ' (set_color $color_cwd) (prompt_pwd) (set_color normal) "$suffix "
|
||||||
end
|
end
|
||||||
|
|
|
@ -5,6 +5,6 @@ if not set -q __fish_prompt_hostname
|
||||||
set -g __fish_prompt_hostname (hostname | string split '.')[1]
|
set -g __fish_prompt_hostname (hostname | string split '.')[1]
|
||||||
end
|
end
|
||||||
|
|
||||||
function fish_prompt_hostname
|
function prompt_hostname
|
||||||
echo $__fish_prompt_hostname
|
echo $__fish_prompt_hostname
|
||||||
end
|
end
|
|
@ -15,5 +15,5 @@ function fish_prompt --description "Write out the prompt"
|
||||||
set suffix '>'
|
set suffix '>'
|
||||||
end
|
end
|
||||||
|
|
||||||
echo -n -s "$USER" @ (fish_prompt_hostname) ' ' (set_color $color_cwd) (prompt_pwd) (set_color normal) "$suffix "
|
echo -n -s "$USER" @ (prompt_hostname) ' ' (set_color $color_cwd) (prompt_pwd) (set_color normal) "$suffix "
|
||||||
end
|
end
|
||||||
|
|
|
@ -25,5 +25,5 @@ function fish_prompt --description "Write out the prompt"
|
||||||
set suffix '>'
|
set suffix '>'
|
||||||
end
|
end
|
||||||
|
|
||||||
echo -n -s "$USER" @ (fish_prompt_hostname) ' ' (set_color $color_cwd) (prompt_pwd) (set_color normal) "$suffix "
|
echo -n -s "$USER" @ (prompt_hostname) ' ' (set_color $color_cwd) (prompt_pwd) (set_color normal) "$suffix "
|
||||||
end
|
end
|
||||||
|
|
|
@ -63,5 +63,5 @@ function fish_prompt --description 'Write out the prompt'
|
||||||
set prompt_status ' ' (set_color $fish_color_status) "[$last_status]" "$normal"
|
set prompt_status ' ' (set_color $fish_color_status) "[$last_status]" "$normal"
|
||||||
end
|
end
|
||||||
|
|
||||||
echo -n -s (set_color $fish_color_user) "$USER" $normal @ (set_color $fish_color_host) (fish_prompt_hostname) $normal ' ' (set_color $color_cwd) (prompt_pwd) $normal (__fish_vcs_prompt) $normal $prompt_status "> "
|
echo -n -s (set_color $fish_color_user) "$USER" $normal @ (set_color $fish_color_host) (prompt_hostname) $normal ' ' (set_color $color_cwd) (prompt_pwd) $normal (__fish_vcs_prompt) $normal $prompt_status "> "
|
||||||
end
|
end
|
||||||
|
|
|
@ -35,7 +35,7 @@ function fish_prompt --description 'Write out the prompt, prepending the Debian
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
echo -n -s "$USER" @ (fish_prompt_hostname) ' ' "$__fish_prompt_cwd" (prompt_pwd) "$__fish_prompt_normal" '# '
|
echo -n -s "$USER" @ (prompt_hostname) ' ' "$__fish_prompt_cwd" (prompt_pwd) "$__fish_prompt_normal" '# '
|
||||||
|
|
||||||
case '*'
|
case '*'
|
||||||
|
|
||||||
|
@ -43,7 +43,7 @@ function fish_prompt --description 'Write out the prompt, prepending the Debian
|
||||||
set -g __fish_prompt_cwd (set_color $fish_color_cwd)
|
set -g __fish_prompt_cwd (set_color $fish_color_cwd)
|
||||||
end
|
end
|
||||||
|
|
||||||
echo -n -s "$USER" @ (fish_prompt_hostname) ' ' "$__fish_prompt_cwd" (prompt_pwd) "$__fish_prompt_normal" '> '
|
echo -n -s "$USER" @ (prompt_hostname) ' ' "$__fish_prompt_cwd" (prompt_pwd) "$__fish_prompt_normal" '> '
|
||||||
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -32,7 +32,7 @@ if not set -q __fish_prompt_cwd
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
printf '%s@%s %s%s%s# ' $USER (fish_prompt_hostname) "$__fish_prompt_cwd" (prompt_pwd) "$__fish_prompt_normal"
|
printf '%s@%s %s%s%s# ' $USER (prompt_hostname) "$__fish_prompt_cwd" (prompt_pwd) "$__fish_prompt_normal"
|
||||||
|
|
||||||
case '*'
|
case '*'
|
||||||
|
|
||||||
|
@ -40,7 +40,7 @@ if not set -q __fish_prompt_cwd
|
||||||
set -g __fish_prompt_cwd (set_color $fish_color_cwd)
|
set -g __fish_prompt_cwd (set_color $fish_color_cwd)
|
||||||
end
|
end
|
||||||
|
|
||||||
printf '[%s] %s%s@%s %s%s %s(%s)%s \f\r> ' (date "+%H:%M:%S") "$__fish_color_blue" $USER (fish_prompt_hostname) "$__fish_prompt_cwd" "$PWD" "$__fish_color_status" "$stat" "$__fish_prompt_normal"
|
printf '[%s] %s%s@%s %s%s %s(%s)%s \f\r> ' (date "+%H:%M:%S") "$__fish_color_blue" $USER (prompt_hostname) "$__fish_prompt_cwd" "$PWD" "$__fish_color_status" "$stat" "$__fish_prompt_normal"
|
||||||
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -10,5 +10,5 @@ function fish_prompt --description 'Write out the prompt'
|
||||||
set -g __fish_prompt_cwd (set_color $fish_color_cwd)
|
set -g __fish_prompt_cwd (set_color $fish_color_cwd)
|
||||||
end
|
end
|
||||||
|
|
||||||
echo -n -s "$USER" @ (fish_prompt_hostname) ' ' "$__fish_prompt_cwd" (prompt_pwd) (__fish_vcs_prompt) "$__fish_prompt_normal" '> '
|
echo -n -s "$USER" @ (prompt_hostname) ' ' "$__fish_prompt_cwd" (prompt_pwd) (__fish_vcs_prompt) "$__fish_prompt_normal" '> '
|
||||||
end
|
end
|
||||||
|
|
|
@ -26,7 +26,7 @@ function fish_prompt
|
||||||
else
|
else
|
||||||
set_color -o cyan
|
set_color -o cyan
|
||||||
end
|
end
|
||||||
echo -n (fish_prompt_hostname)
|
echo -n (prompt_hostname)
|
||||||
set_color -o white
|
set_color -o white
|
||||||
#echo -n :(prompt_pwd)
|
#echo -n :(prompt_pwd)
|
||||||
echo -n :(pwd|sed "s=$HOME=~=")
|
echo -n :(pwd|sed "s=$HOME=~=")
|
||||||
|
|
|
@ -12,7 +12,7 @@ function fish_prompt
|
||||||
printf ' at '
|
printf ' at '
|
||||||
|
|
||||||
set_color magenta
|
set_color magenta
|
||||||
echo -n (fish_prompt_hostname)
|
echo -n (prompt_hostname)
|
||||||
set_color normal
|
set_color normal
|
||||||
printf ' in '
|
printf ' in '
|
||||||
|
|
||||||
|
|
|
@ -2,8 +2,8 @@
|
||||||
# author: Matthias
|
# author: Matthias
|
||||||
function fish_prompt -d "Write out the prompt"
|
function fish_prompt -d "Write out the prompt"
|
||||||
if test -z $WINDOW
|
if test -z $WINDOW
|
||||||
printf '%s%s@%s%s%s%s%s> ' (set_color yellow) (whoami) (set_color purple) (fish_prompt_hostname) (set_color $fish_color_cwd) (prompt_pwd) (set_color normal)
|
printf '%s%s@%s%s%s%s%s> ' (set_color yellow) (whoami) (set_color purple) (prompt_hostname) (set_color $fish_color_cwd) (prompt_pwd) (set_color normal)
|
||||||
else
|
else
|
||||||
printf '%s%s@%s%s%s(%s)%s%s%s> ' (set_color yellow) (whoami) (set_color purple) (fish_prompt_hostname) (set_color white) (echo $WINDOW) (set_color $fish_color_cwd) (prompt_pwd) (set_color normal)
|
printf '%s%s@%s%s%s(%s)%s%s%s> ' (set_color yellow) (whoami) (set_color purple) (prompt_hostname) (set_color white) (echo $WINDOW) (set_color $fish_color_cwd) (prompt_pwd) (set_color normal)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
# author: Ivan Tham <ivanthamjunhoe@gmail.com>
|
# author: Ivan Tham <ivanthamjunhoe@gmail.com>
|
||||||
|
|
||||||
function fish_prompt
|
function fish_prompt
|
||||||
test $SSH_TTY; and printf (set_color red)(whoami)(set_color white)'@'(set_color yellow)(fish_prompt_hostname)' '
|
test $SSH_TTY; and printf (set_color red)(whoami)(set_color white)'@'(set_color yellow)(prompt_hostname)' '
|
||||||
|
|
||||||
test $USER = 'root'; and echo (set_color red)"#"
|
test $USER = 'root'; and echo (set_color red)"#"
|
||||||
|
|
||||||
|
|
|
@ -13,7 +13,7 @@ function fish_prompt --description 'Write out the prompt'
|
||||||
|
|
||||||
# Host
|
# Host
|
||||||
set_color $fish_color_host
|
set_color $fish_color_host
|
||||||
echo -n (fish_prompt_hostname)
|
echo -n (prompt_hostname)
|
||||||
set_color normal
|
set_color normal
|
||||||
|
|
||||||
echo -n ':'
|
echo -n ':'
|
||||||
|
|
|
@ -9,5 +9,5 @@ function fish_prompt -d "Write out the prompt"
|
||||||
case root toor; set prompt_symbol '#'
|
case root toor; set prompt_symbol '#'
|
||||||
case '*'; set prompt_symbol '$'
|
case '*'; set prompt_symbol '$'
|
||||||
end
|
end
|
||||||
printf "[%s@%s %s%s%s]%s " $USER (fish_prompt_hostname) (set_color $fish_color_cwd) $pwd (set_color normal) $prompt_symbol
|
printf "[%s@%s %s%s%s]%s " $USER (prompt_hostname) (set_color $fish_color_cwd) $pwd (set_color normal) $prompt_symbol
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in a new issue