forked from CPatchane/config-fish
-
Notifications
You must be signed in to change notification settings - Fork 0
/
config.fish
111 lines (94 loc) · 3.21 KB
/
config.fish
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
#
### GLOBAL VARIABLES
#
# Load private config
# (local settings or computer specific config for example)
if [ -f $HOME/.config/fish/private.fish ]
source $HOME/.config/fish/private.fish
end
# Colors for ls command
set -gx LSCOLORS "Cxbgdxdxbxdgeghegeacad"
# Keys binding
bind "^X\\x7f" backward-kill-line
# Editor
set -x EDITOR vim
set -x GIT_EDITOR $EDITOR
set -x SUDO_EDITOR "rvim -u NONE"
switch (uname)
case Linux
set -x OSTYPE "Linux"
case Darwin
set -x OSTYPE "MacOS"
case FreeBSD NetBSD DragonFly
set -x OSTYPE "FreeBSD"
case '*'
set -x OSTYPE "unknown"
end
## ENV
# Fish 3.1+ doesn't add binaries to the path autmatically anymore
# https://github.com/fish-shell/fish-shell/issues/6594
contains /usr/local/bin $PATH
or set PATH /usr/local/bin $PATH
# On M1 Macs, homebrew installs things in /opt/homebrew
contains /opt/homebrew/bin
or set PATH /opt/homebrew/bin $PATH
if [ -f $HOME/.config/fish/env/index.fish ]
source $HOME/.config/fish/env/index.fish
end
#
### ALIAS
#
# Main
if [ -f $HOME/.config/fish/aliases/main.fish ]
source $HOME/.config/fish/aliases/main.fish
end
# Private aliases (e.g. with servers address...)
## aliases/private.fish will be ignored by git (.gitignore)
if [ -f $HOME/.config/fish/aliases/private.fish ]
source $HOME/.config/fish/aliases/private.fish
end
# Git
if [ -f $HOME/.config/fish/aliases/git.fish ]
source $HOME/.config/fish/aliases/git.fish
end
#
### GIT PROMPT CONFIGURATION
# See the file /usr/local/share/fish/functions/fish_git_prompt.fish
#
set __fish_git_prompt_showdirtystate 'yes'
set __fish_git_prompt_showstashstate 'yes'
set __fish_git_prompt_showuntrackedfiles 'yes'
set __fish_git_prompt_show_informative_status 'yes'
set __fish_git_prompt_showupstream 'yes'
set -l cl_empress '757575'
set -l cl_gainsboro 'E0E0E0'
set -l cl_dodger_blue '297EF2'
set -l cl_gorse 'FFEB3B'
set -l cl_red_orange 'F52D2D'
set __fish_git_prompt_color_branch $cl_gorse -b $cl_empress
set __fish_git_prompt_color_dirtystate $cl_dodger_blue -b $cl_gainsboro
set __fish_git_prompt_color_invalidstate $cl_red_orange -b $cl_gainsboro
set __fish_git_prompt_color_stagedstate $cl_dodger_blue -b $cl_gainsboro
set __fish_git_prompt_color_cleanstate $cl_dodger_blue -b $cl_gainsboro
set __fish_git_prompt_color_stashstate $cl_dodger_blue -b $cl_gainsboro
set __fish_git_prompt_color_upstream $cl_gainsboro -b $cl_empress
set __fish_git_prompt_color_untrackedfiles $cl_dodger_blue -b $cl_gainsboro
set __fish_git_prompt_color $cl_gainsboro -b $cl_empress
set __fish_git_prompt_char_cleanstate ' '
set __fish_git_prompt_char_dirtystate ' '
set __fish_git_prompt_char_invalidstate ' '
set __fish_git_prompt_char_stagedstate ' '
set __fish_git_prompt_char_stashstate ' '
set __fish_git_prompt_char_stateseparator ' '
set __fish_git_prompt_char_untrackedfiles ' '
set __fish_git_prompt_char_upstream_ahead ' '
set __fish_git_prompt_char_upstream_behind ' '
set __fish_git_prompt_char_upstream_diverged ' '
set __fish_git_prompt_char_upstream_equal ' '
set __fish_git_prompt_char_upstream_prefix ' '
#
### PROMPT
#
# Prevent directories names from being shortened
set fish_prompt_pwd_dir_length 0
# fish_prompt defined in ~/.config/fish/functions/fish_prompt.fish