Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
66 changes: 66 additions & 0 deletions config/fish.config
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
#
# Init file for fish
#

#
# Some things should only be done for login terminals
#

if status --is-login

#
# Set some value for LANG if nothing was set before, and this is a
# login shell.
#

if not set -q LANG >/dev/null
set -gx LANG en_US.UTF-8
end

# Check for i18n information in
# /etc/sysconfig/i18n

if test -f /etc/sysconfig/i18n
eval (cat /etc/sysconfig/i18n |sed -ne 's/^\([a-zA-Z]*\)=\(.*\)$/set -gx \1 \2;/p')
end

#
# Put linux consoles in unicode mode.
#

if test "$TERM" = linux
if expr "$LANG" : ".*\.[Uu][Tt][Ff].*" >/dev/null
if which unicode_start >/dev/null
unicode_start
end
end
end
end

set tmp_path $PATH
setenv PATH
for path in $tmp_path
setenv PATH $PATH $path ^ /dev/null
end

# fix conflict between bash export and fish set global variables in profile.d
# add this to /etc/fish/config.fish to run your bash scripts in profile.d

if status --is-login
for line in (sh --noprofile --norc -c '. /etc/profile; env')
set variable (echo $line | cut -d '=' -f 1)
set value (echo $line | cut -d '=' -f 2-)
# Convert to array
if test (echo $value | grep ":")
set value (echo $value | sed -e 's/:/\n/g')
end
if test $variable = PATH
for path in $value
setenv PATH $PATH $path ^ /dev/null
end
else
setenv $variable $value ^ /dev/null
end
end
end