From d18b1f2a2e25cb71639c10ecbe90a01c76487702 Mon Sep 17 00:00:00 2001 From: Malfurious Date: Thu, 13 May 2021 03:31:51 -0400 Subject: Add fish config --- .config/fish/config.fish | 2 ++ .config/fish/functions/clera.fish | 3 +++ .config/fish/functions/fish_greeting.fish | 3 +++ .config/fish/functions/fish_prompt.fish | 23 +++++++++++++++++++++++ .config/fish/functions/gist.fish | 3 +++ .config/fish/functions/rice.fish | 3 +++ 6 files changed, 37 insertions(+) create mode 100644 .config/fish/config.fish create mode 100644 .config/fish/functions/clera.fish create mode 100644 .config/fish/functions/fish_greeting.fish create mode 100644 .config/fish/functions/fish_prompt.fish create mode 100644 .config/fish/functions/gist.fish create mode 100644 .config/fish/functions/rice.fish diff --git a/.config/fish/config.fish b/.config/fish/config.fish new file mode 100644 index 0000000..4e7f405 --- /dev/null +++ b/.config/fish/config.fish @@ -0,0 +1,2 @@ +set --export EDITOR "vim" +set --export GIT_RADAR_FORMAT " \\x01\\033[1;30m\\x02git:(\\x01\\033[0m\\x02%{branch}%{ :local}\\x01\\033[1;30m\\x02)\\x01\\033[0m\\x02%{ :stash}%{ :changes}" diff --git a/.config/fish/functions/clera.fish b/.config/fish/functions/clera.fish new file mode 100644 index 0000000..2c9c91b --- /dev/null +++ b/.config/fish/functions/clera.fish @@ -0,0 +1,3 @@ +function clera + clear $argv; +end diff --git a/.config/fish/functions/fish_greeting.fish b/.config/fish/functions/fish_greeting.fish new file mode 100644 index 0000000..e2774dd --- /dev/null +++ b/.config/fish/functions/fish_greeting.fish @@ -0,0 +1,3 @@ +function fish_greeting + screenfetch $argv; +end diff --git a/.config/fish/functions/fish_prompt.fish b/.config/fish/functions/fish_prompt.fish new file mode 100644 index 0000000..e03b391 --- /dev/null +++ b/.config/fish/functions/fish_prompt.fish @@ -0,0 +1,23 @@ +function fish_prompt --description 'Write out the prompt' + set -l normal (set_color normal) + set -l color_cwd $fish_color_cwd + set -l color_host $fish_color_host + set -l suffix '>' + + # Color the prompt differently when we're root + if contains -- $USER root toor + if set -q fish_color_cwd_root + set color_cwd $fish_color_cwd_root + end + set suffix '#' + end + + # If we're running via SSH, change the host color + if set -q SSH_TTY + set color_host $fish_color_host_remote + end + + # TODO: git-sonar will eventually be located in the $PATH + echo -n -s (set_color $fish_color_user) "$USER" $normal @ (set_color $color_host) (prompt_hostname) $normal ' ' \ + (set_color $color_cwd) (prompt_pwd) $normal (~/rice/submodules/git-sonar/git-sonar --fish --fetch) $normal " " $suffix " " +end diff --git a/.config/fish/functions/gist.fish b/.config/fish/functions/gist.fish new file mode 100644 index 0000000..61b09b7 --- /dev/null +++ b/.config/fish/functions/gist.fish @@ -0,0 +1,3 @@ +function gist + git status -s $argv; +end diff --git a/.config/fish/functions/rice.fish b/.config/fish/functions/rice.fish new file mode 100644 index 0000000..d0b8bae --- /dev/null +++ b/.config/fish/functions/rice.fish @@ -0,0 +1,3 @@ +function rice + git --git-dir=$HOME/rice/.gitdir --work-tree=$HOME $argv; +end -- cgit v1.2.3