From e66fcd297f026e404b307dd308c4532f469ff6d8 Mon Sep 17 00:00:00 2001 From: Jonathan Schleifer Date: Wed, 22 Jan 2020 21:38:12 +0000 Subject: [PATCH] fish: Slightly change command and operator color This is the exact same color in Apple Terminal, but improves legibility in Gnome Terminal. Also silences stderr from which. --- config/fish/fish_variables | 6 +++--- config/fish/functions/fgrep.fish | 2 +- config/fish/functions/grep.fish | 2 +- config/fish/functions/ls.fish | 2 +- config/fish/functions/make.fish | 3 ++- config/fish/functions/pkg_rolling-replace.fish | 4 ++++ config/fish/functions/pw.fish | 4 ++-- 7 files changed, 14 insertions(+), 9 deletions(-) create mode 100644 config/fish/functions/pkg_rolling-replace.fish diff --git a/config/fish/fish_variables b/config/fish/fish_variables index 1e8e9f3..67614ea 100644 --- a/config/fish/fish_variables +++ b/config/fish/fish_variables @@ -10,7 +10,7 @@ SETUVAR _fish_abbr_gpg:gpg2 SETUVAR _fish_abbr_vi:vim SETUVAR fish_color_autosuggestion:4e4e4e SETUVAR fish_color_cancel:normal -SETUVAR fish_color_command:003cb3 +SETUVAR fish_color_command:205cb3 SETUVAR fish_color_comment:6600cc SETUVAR fish_color_cwd:209060 SETUVAR fish_color_end:730099 @@ -21,8 +21,8 @@ SETUVAR fish_color_host:176945 SETUVAR fish_color_jobs:ffff00 SETUVAR fish_color_match:normal SETUVAR fish_color_normal:normal -SETUVAR fish_color_operator:cc33ff -SETUVAR fish_color_param:3377ff +SETUVAR fish_color_operator:cc6fdf +SETUVAR fish_color_param:3377cf SETUVAR fish_color_quote:ff751a SETUVAR fish_color_redirection:bf4080 SETUVAR fish_color_search_match:ffff00 diff --git a/config/fish/functions/fgrep.fish b/config/fish/functions/fgrep.fish index c6db13a..79758d1 100644 --- a/config/fish/functions/fgrep.fish +++ b/config/fish/functions/fgrep.fish @@ -1,5 +1,5 @@ function fgrep - if which ggrep >/dev/null + if which ggrep >/dev/null ^&1 command ggrep -F --color=auto $argv else command fgrep --color=auto $argv diff --git a/config/fish/functions/grep.fish b/config/fish/functions/grep.fish index d348336..6ddf50a 100644 --- a/config/fish/functions/grep.fish +++ b/config/fish/functions/grep.fish @@ -1,5 +1,5 @@ function grep - if which ggrep >/dev/null + if which ggrep >/dev/null ^&1 command ggrep --color=auto $argv else command grep --color=auto $argv diff --git a/config/fish/functions/ls.fish b/config/fish/functions/ls.fish index 0b88468..b894cdb 100644 --- a/config/fish/functions/ls.fish +++ b/config/fish/functions/ls.fish @@ -1,5 +1,5 @@ function ls --description 'List contents of directory' - if which gls >/dev/null + if which gls >/dev/null ^&1 command gls --color=auto $argv else command ls --color=auto $argv diff --git a/config/fish/functions/make.fish b/config/fish/functions/make.fish index f04e163..1550731 100644 --- a/config/fish/functions/make.fish +++ b/config/fish/functions/make.fish @@ -1,6 +1,7 @@ # Automatically use bmake instead of make when using pkgsrc function make - if which bmake >/dev/null && string match -q -r '/pkgsrc$|/pkgsrc/' $PWD + if which bmake >/dev/null ^&1 && \ + string match -q -r '/pkgsrc$|/pkgsrc/' $PWD # pkgsrc does not like MAKEFLAGS including -j env MAKEFLAGS= bmake $argv else diff --git a/config/fish/functions/pkg_rolling-replace.fish b/config/fish/functions/pkg_rolling-replace.fish new file mode 100644 index 0000000..b5b1fb6 --- /dev/null +++ b/config/fish/functions/pkg_rolling-replace.fish @@ -0,0 +1,4 @@ +function pkg_rolling-replace + set -lx MAKEFLAGS + command pkg_rolling-replace $argv +end diff --git a/config/fish/functions/pw.fish b/config/fish/functions/pw.fish index a31c2e4..2e4f545 100644 --- a/config/fish/functions/pw.fish +++ b/config/fish/functions/pw.fish @@ -1,8 +1,8 @@ function pw set -l clipboard - if which pbcopy >/dev/null + if which pbcopy >/dev/null ^&1 set clipboard pbcopy - else if which xclip >/dev/null + else if which xclip >/dev/null ^&1 set clipboard xclip else echo "No clipboard handler found!"