From 1e13cfa09d1a2c057a7a4b9590daf569bd91b760 Mon Sep 17 00:00:00 2001 From: Tom Barrett Date: Mon, 9 Mar 2020 07:52:31 -0500 Subject: new fish settings --- .config/fish/config.fish | 12 ++++++- .config/fish/fish_variables | 34 ++++++++---------- .config/fish/functions/fish_prompt.fish | 62 ++++++++++++--------------------- 3 files changed, 47 insertions(+), 61 deletions(-) mode change 100644 => 100755 .config/fish/functions/fish_prompt.fish (limited to '.config/fish') diff --git a/.config/fish/config.fish b/.config/fish/config.fish index 5a9db4b..b42e312 100644 --- a/.config/fish/config.fish +++ b/.config/fish/config.fish @@ -1,7 +1,17 @@ -set PATH /bin /home/tom/.cargo/bin /sbin /usr/bin /usr/games /usr/local/bin /usr/local/games /usr/local/sbin /usr/sbin /home/tom/bin +set PATH /bin /sbin /usr/bin /usr/games \ + /usr/local/bin /usr/local/games \ + /usr/local/sbin /usr/sbin \ + /home/tom/bin \ + /home/tom/.cargo/bin \ + /home/tom/.local/bin + +set GOPATH /home/tom/src/go function fish_user_key_bindings for mode in insert default visual bind -M $mode \cf forward-char end end + +function fish_mode_prompt +end diff --git a/.config/fish/fish_variables b/.config/fish/fish_variables index c020444..ae9139e 100644 --- a/.config/fish/fish_variables +++ b/.config/fish/fish_variables @@ -1,37 +1,31 @@ # This file contains fish universal variable definitions. # VERSION: 3.0 SETUVAR EDITOR:nvim -SETUVAR --export --path GOPATH:/home/tom/src/go -SETUVAR __fish_init_2_39_8:\x1d -SETUVAR __fish_init_2_3_0:\x1d -SETUVAR __fish_init_3_x:\x1d -SETUVAR _fish_abbr_ifconfig:ip\x20addr -SETUVAR _fish_abbr_vim:nvim -SETUVAR _fish_abbr_v:nvim -SETUVAR _fish_abbr_m:make -SETUVAR fish_color_autosuggestion:64DF85 +SETUVAR __fish_initialized:3100 +SETUVAR fish_color_autosuggestion:585858 SETUVAR fish_color_cancel:\x2dr -SETUVAR fish_color_command:00BF32 -SETUVAR fish_color_comment:5C9900 +SETUVAR fish_color_command:a1b56c +SETUVAR fish_color_comment:f7ca88 SETUVAR fish_color_cwd:green SETUVAR fish_color_cwd_root:red -SETUVAR fish_color_end:8EEB00 -SETUVAR fish_color_error:60B9CE -SETUVAR fish_color_escape:00a6b2 +SETUVAR fish_color_end:ba8baf +SETUVAR fish_color_error:ab4642 +SETUVAR fish_color_escape:86c1b9 SETUVAR fish_color_history_current:\x2d\x2dbold SETUVAR fish_color_host:normal -SETUVAR fish_color_match:\x2d\x2dbackground\x3dbrblue +SETUVAR fish_color_host_remote:yellow +SETUVAR fish_color_match:7cafc2 SETUVAR fish_color_normal:normal -SETUVAR fish_color_operator:00a6b2 -SETUVAR fish_color_param:04819E -SETUVAR fish_color_quote:206676 -SETUVAR fish_color_redirection:7CB02C +SETUVAR fish_color_operator:7cafc2 +SETUVAR fish_color_param:d8d8d8 +SETUVAR fish_color_quote:f7ca88 +SETUVAR fish_color_redirection:d8d8d8 SETUVAR fish_color_search_match:bryellow\x1e\x2d\x2dbackground\x3dbrblack SETUVAR fish_color_selection:white\x1e\x2d\x2dbold\x1e\x2d\x2dbackground\x3dbrblack SETUVAR fish_color_status:red SETUVAR fish_color_user:brgreen SETUVAR fish_color_valid_path:\x2d\x2dunderline -SETUVAR fish_greeting:\x1d +SETUVAR fish_greeting: SETUVAR fish_key_bindings:fish_vi_key_bindings SETUVAR fish_pager_color_completion:normal SETUVAR fish_pager_color_description:B3A06D\x1eyellow diff --git a/.config/fish/functions/fish_prompt.fish b/.config/fish/functions/fish_prompt.fish old mode 100644 new mode 100755 index 7f4860d..8a208e2 --- a/.config/fish/functions/fish_prompt.fish +++ b/.config/fish/functions/fish_prompt.fish @@ -1,42 +1,24 @@ function fish_prompt --description 'Write out the prompt' - - set stat $status - - if not set -q __fish_prompt_normal - set -g __fish_prompt_normal (set_color normal) - end - - if not set -q __fish_color_blue - set -g __fish_color_blue (set_color -o blue) - end - - #Set the color for the status depending on the value - set __fish_color_status (set_color -o green) - if test $stat -gt 0 - set __fish_color_status (set_color -o red) - end - - switch "$USER" - - case root toor - - if not set -q __fish_prompt_cwd - if set -q fish_color_cwd_root - set -g __fish_prompt_cwd (set_color $fish_color_cwd_root) - else - set -g __fish_prompt_cwd (set_color $fish_color_cwd) - end - end - - printf '%s@%s %s%s%s# ' $USER (prompt_hostname) "$__fish_prompt_cwd" (prompt_pwd) "$__fish_prompt_normal" - - case '*' - - if not set -q __fish_prompt_cwd - set -g __fish_prompt_cwd (set_color $fish_color_cwd) - end - - 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 + if set -l branch_name (command git symbolic-ref HEAD 2>/dev/null | string replace refs/heads/ '') + set git_info (set_color d8d8d8)"|" + if command git diff-index --quiet HEAD -- + set git_info $git_info(set_color f7ca88) + else + set git_info $git_info(set_color ab4642) + end + set git_info $git_info"$branch_name" + end + + # Disable PWD shortening by default. + set -q fish_prompt_pwd_dir_length + or set -lx fish_prompt_pwd_dir_length 0 + + printf '%s' (set_color -o d8d8d8) '<' + printf '%s' (set_color a1b56c) $USER + printf '%s' (set_color d8d8d8) '@' + printf '%s' (set_color 7cafc2) (prompt_hostname) + printf '%s' (set_color d8d8d8) '|' + printf '%s' (set_color ba8baf) (prompt_pwd) + printf '%s' $git_info + printf '%s' (set_color d8d8d8) '>' end -- cgit v1.2.3