aboutsummaryrefslogtreecommitdiff
path: root/config/fish/config.fish
blob: 5394e1923aba869c903ee67568f56eaa895c5486 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
# PATH Stuff

if not contains ~/.local/bin $PATH
    set PATH ~/.local/bin $PATH
end

# export the path to our dotfiles
if not set -q DOTFILES_LOCATION
	set -x DOTFILES_LOCATION (get_dotfiles_location)
end

# include cargo binaries
if type -q rustup
    for p in $HOME/.rustup/toolchains/*/bin $HOME/.cargo/bin
        if not contains $p $PATH
            set PATH $PATH $p
        end
    end
end

#include go binaries
if type -q go
    not set -q GOPATH; and set -x GOPATH ~/Desktop/projects/go

	if not contains $GOPATH/bin $PATH
	    set PATH $GOPATH/bin $PATH
	end
end

# guixsd has nether /bin nor /usr
# TODO find a  better way to check if we are on guixsd
if type -q guix
	set -x GUIX_PACKAGE_PATH $DOTFILES_LOCATION/guix/packages
	# source the system paths
	set fish_function_path $fish_function_path /run/current-system/profile/share/fish/functions
	set fish_complete_path $fish_complete_path /run/current-system/profile/share/fish/completions
else
	if not contains /bin/core_perl $PATH
	    set PATH /bin/core_perl $PATH
	end

	if not contains /usr/local/bin $PATH
	    set PATH /usr/local/bin $PATH
	end
end

# autoload functions and completions in .dotfiles 
set fish_function_path $DOTFILES_LOCATION/config/fish/functions $fish_function_path
set fish_complete_path $DOTFILES_LOCATION/config/fish/completions $fish_complete_path

# add git-alias subdirectory to functions path
set fish_function_path $DOTFILES_LOCATION/config/fish/functions/git-alias $fish_function_path

set -x __fish_git_prompt_show_informative_status true

not set -q MPD_PORT; and set -x MPD_PORT 6601

if type -q mpd; and not pgrep mpd >/dev/null
	mpd
end

if not set -q EDITOR
	if type -q vis
		set -x EDITOR vis
	else if type -q vim
		set -x EDITOR vim
	end
end

not set -q VISUAL; and set -q EDITOR; set -x VISUAL $EDITOR

not set -q SSH_KEY_PATH; and set -x SSH_KEY_PATH $HOME/.ssh/id_rsa

# start ssh-agent
if not pgrep ssh-agent >/dev/null
	not set -q SSH_AUTH_SOCK; set -x SSH_AUTH_SOCK ~/.ssh/agent.sock
	test -e $SSH_AUTH_SOCK; and rm $SSH_AUTH_SOCK
	set out (ssh-agent -a $SSH_AUTH_SOCK)
	set -U SSH_AGENT_PID (string replace ";" "" (string split " " $out)[-1])
end

# set yaourt specific VARS
if type -q yaourt
    if not set -q AURUSEGIT
        set -x AURUSEGIT 1
    end
    if not set -q AURSHOWDIFF
        set -x AURSHOWDIFF 1
    end
end

################### HOST SETTINGS #############################################

# Antares.uberspace.de
# Change TERM on antares.uberspace.de
if test (hostname) = "antares.uberspace.de"
	if test "$TERM" = "st-256color"
		set -x TERM "xterm-256color"
	end

	# Use gcc 4.9
	if not contains "/package/host/localhost/gcc-4/bin" $PATH
		set -x PATH "/package/host/localhost/gcc-4/bin" $PATH
	end

	# Include libraries for gcc 4.9
	if not contains "/package/host/localhost/gcc-4/lib64" $LD_LIBRARY_PATH
		set -x LD_LIBRARY_PATH "/package/host/localhost/gcc-4/lib64" $LD_LIBRARY_PATH
	end
end

#start xsession
if not set -q DISPLAY; and test "$XDG_VTNR" = "1"
	startx ~/.xinitrc
end