Created
August 10, 2021 01:23
-
-
Save coke12103/2e1fb362dd82329bfe207562891bcdf8 to your computer and use it in GitHub Desktop.
config.fish
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
set -x EDITOR nvim | |
function cd | |
builtin cd $argv; and ls | |
end | |
function hello | |
echo 'hello' | |
end | |
function command_not_found_handler --on-event fish_command_not_found | |
echo "ξ゚⊿゚)ξ < ハァ…?$argv[1]とか何言ってんの?" | |
echo "ξ゚⊿゚)ξ < コマンドもろくに覚えられないなんて、アンタどうしようもないクズね。" | |
end | |
alias vi='nvim' | |
alias emacs='nvim' | |
alias s="true" | |
alias h='hostname' | |
alias vim='nvim' | |
alias pbcopy='xsel --clipboard --input' | |
if which rbenv > /dev/null 2>&1 | |
status --is-interactive; and source (rbenv init -|psub) | |
end | |
set -g theme_display_user yes | |
set -g default_user your_default_username | |
set git_dirty_color red | |
set git_not_dirty_color green | |
if [ -n "$REMOTEHOST$SSH_CONNECTION" ] | |
set is_ssh "< "(set_color green)"ssh!"(set_color white) | |
end | |
function parse_git_branch | |
set -l branch (git branch 2> /dev/null | grep -e '\* ' | sed 's/^..\(.*\)/\1/') | |
set -l git_diff (git diff) | |
if test -n "$git_diff" | |
echo (set_color $git_dirty_color)$branch(set_color normal) | |
else | |
echo (set_color $git_not_dirty_color)$branch(set_color normal) | |
end | |
end | |
function fish_prompt | |
if [ $status -eq 0 ] | |
set status_face (set_color white)"(*>_<)$is_ssh: " | |
else | |
set status_face (set_color cyan)"(*- -)$is_ssh: " | |
end | |
set prompt (set_color green)$USER@(prompt_hostname)":"(tty | sed 's/\/dev\///g') | |
set ppwd (set_color yellow)(prompt_pwd) | |
set -l git_dir (git rev-parse --git-dir 2> /dev/null) | |
if test -n "$git_dir" | |
echo $prompt $ppwd (set_color normal)"["(parse_git_branch)"]" (date "+%Y/%m/%d %T") | |
echo $status_face | |
else | |
echo $prompt $ppwd (set_color cyan)(date "+%Y/%m/%d %T") | |
echo $status_face | |
end | |
end | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment