aboutsummaryrefslogtreecommitdiffhomepage
path: root/init/fish_interactive.fish
diff options
context:
space:
mode:
authorGravatar axel <axel@liljencrantz.se>2005-09-23 06:16:52 +1000
committerGravatar axel <axel@liljencrantz.se>2005-09-23 06:16:52 +1000
commitf971e02256f903fa58fbc288629009d47fc89712 (patch)
treec64b639776ab294a7f17a374ddb3ad1743939a8f /init/fish_interactive.fish
parentfcdaed44d73b0f151f53a304501c987b7a649446 (diff)
Exportable universal variables
darcs-hash:20050922201652-ac50b-f70e7607b4ace24da4020f2d432718dc335e5bdd.gz
Diffstat (limited to 'init/fish_interactive.fish')
-rw-r--r--init/fish_interactive.fish23
1 files changed, 16 insertions, 7 deletions
diff --git a/init/fish_interactive.fish b/init/fish_interactive.fish
index 14b389a9..c2a30761 100644
--- a/init/fish_interactive.fish
+++ b/init/fish_interactive.fish
@@ -53,12 +53,19 @@ end
# Set various color values
#
-function set_default -d "Set a universal variable, unless it has already been set"
- if not test $$argv[1]
+function set_default -d "Set an universal variable, unless it has already been set"
+ if not set -q $argv[1]
set -U -- $argv
end
end
+function set_exported_default -d "Set an exported universal variable, unless it has already been set"
+ if not set -q $argv[1]
+ set -Ux -- $argv
+ end
+end
+
+
# Regular syntax highlighting colors
set_default fish_color_normal normal
set_default fish_color_command green
@@ -83,21 +90,20 @@ set_default fish_pager_color_progress cyan
# Directory history colors
set_default fish_color_history_current cyan
-functions -e set_default
#
# Setup the CDPATH variable
#
-set -gx CDPATH . ~
+set_exported_default CDPATH . ~
#
# Match colors for grep, if supported
#
if grep --color=auto --help 1>/dev/null 2>/dev/null
- set -gx GREP_COLOR '97;45'
- set -gx -- GREP_OPTIONS '--color=auto'
+ set_exported_default GREP_COLOR '97;45'
+ set_exported_default GREP_OPTIONS '--color=auto'
end
#
@@ -105,6 +111,9 @@ end
#
if command ls --color=auto --help 1>/dev/null 2>/dev/null
- set -gx LS_COLORS $LS_COLORS '*.jar=01;31' '*.doc=35' '*.pdf=35' '*.ps=35' '*.xls=35' '*.swf=35' '*~=37'
+ set_exported_default LS_COLORS $LS_COLORS '*.jar=01;31' '*.doc=35' '*.pdf=35' '*.ps=35' '*.xls=35' '*.swf=35' '*~=37'
end
+
+functions -e set_default
+functions -e set_exported_default