-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathconfig.fish
148 lines (120 loc) · 4.96 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
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
# Greeting
set fish_greeting ""
# Commands to run in interactive sessions can go here
if status is-interactive
# ▄▀█ █▄▄ █▄▄ █▀█ ▄▀█ █▄░█ █▀▄ ▄▀█ █░░ █ ▄▀█ █▀
# █▀█ █▄█ █▄█ █▀▄ █▀█ █░▀█ █▄▀ █▀█ █▄▄ █ █▀█ ▄█
# =================================================
# User abbreviations
abbr -a -g sayonara 'shutdown now' # Epic way to Shutdown
abbr -a -g cls 'clear' # Clear Screen
abbr -a -g yeet 'sudo pacman -Rns' # Remove packages with dependencies
abbr -a -g mid 'nvim' # Neovim
abbr -a -g brs 'bash ~/Mid_Hunter/scripts/set_brightness.sh' # Brightness
abbr -a -g vos 'bash ~/Mid_Hunter/scripts/set_volume.sh' # Volume
abbr -a -g woman 'man -k . | fzf | awk \'{print $1}\' | xargs man'
alias arch 'bash ~/Mid_Hunter/scripts/archchan/get_command-list.sh'
# function format_duration
# set ms $CMD_DURATION
# set x (math --scale=0 $ms / 1000)
# set seconds (math --scale=0 $x % 60)
# set x (math --scale=0 $x / 60)
# set minutes (math --scale=0 $x % 60)
# set x (math --scale=0 $x / 60)
# set hours (math --scale=0 $x % 24)
# set result ""
# if test $hours -gt 0
# set result "$result$hours"h
# end
# if test $minutes -gt 0
# set result "$result$minutes"m
# end
# if test $seconds -gt 0 -o (not test -n "$result")
# set result "$result$seconds"s
# end
# echo $result
# end
# LS_COLORS
source ~/.config/fish/ls_colors.fish
# Better Alternatives
source ~/.config/fish/better_alternatives.fish
# Starship prompt
starship init fish | source
set -x STARSHIP_CONFIG $HOME/.config/starship/starship.toml
# Starship transient prompt
function starship_transient_prompt_func
set BLKFG '\033[1;30m'
set GRNFG '\033[1;32m'
set YLOFG '\033[1;33m'
set WHTFG '\033[1;37m'
set BLKBG '\033[1;40m'
set GRNBG '\033[1;42m'
set YLOBG '\033[1;43m'
set WHTBG '\033[1;47m'
set BOLD '\033[4m'
set RESET '\033[0;0m'
set PROMPT ""
# # COMMAND DURATION
# set DURATION (format_duration)
# if test $DURATION != ''
# set PROMPT (string join '' $PROMPT "$RESET$BLKFG")
# set PROMPT (string join '' $PROMPT "$BLKBG$WHTFG $DURATION ")
# set PROMPT (string join '' $PROMPT "$RESET$BLKFG\n")
# else
# set PROMPT (string join '' $PROMPT "\n")
# end
# BUBBLE
set PROMPT (string join '' $PROMPT "$RESET$YLOFG")
set PROMPT (string join '' $PROMPT "$YLOBG$BLKFG $(date +%H:%M) ")
set PROMPT (string join '' $PROMPT "$RESET$YLOFG")
echo -n -e "\n$PROMPT$RESET "
end
enable_transience
# █▀▀ █░█ █▀ ▀█▀ █▀█ █▀▄▀█ █▀▀ █▀█ █░░ █▀█ █▀█ █▀
# █▄▄ █▄█ ▄█ ░█░ █▄█ █░▀░█ █▄▄ █▄█ █▄▄ █▄█ █▀▄ ▄█
# =================================================
# Custom Completion Colors
set fish_pager_color_background --background=black
set fish_pager_color_secondary_background --background=brblack
set fish_pager_color_progress white # the progress bar at the bottom left
set fish_pager_color_prefix blue # already typed tab completion
set fish_pager_color_completion white # rest of the tab completion
set fish_pager_color_description yellow # tab completion (description)
# Set the cursor shapes for the different vi modes.
set fish_cursor_default block blink
set fish_cursor_insert line blink
set fish_cursor_replace_one underscore blink
set fish_cursor_visual block
# █▄▀ █▀▀ █▄█ █▄▄ █ █▄░█ █▀▄ █ █▄░█ █▀▀ █▀
# █░█ ██▄ ░█░ █▄█ █ █░▀█ █▄▀ █ █░▀█ █▄█ ▄█
# ========================================
bind --mode default U redo
# Move to 0 and $ with H and L
for mode in default visual
bind --mode $mode H 'commandline -f beginning-of-line'
bind --mode $mode L 'commandline -f end-of-line'
end
# Ctrl-Z fg command
bind --mode insert \cz 'fg 2>/dev/null; commandline -f repaint'
# █▀▀ █░█ █▄░█ █▀▀ ▀█▀ █ █▀█ █▄░█ █▀
# █▀░ █▄█ █░▀█ █▄▄ ░█░ █ █▄█ █░▀█ ▄█
# ==================================
# Vi mode with default Emacs keybindings
function fish_hybrid_key_bindings --description \
"Vi-style bindings that inherit emacs-style bindings in all modes"
for mode in default insert visual
fish_default_key_bindings -M $mode
end
fish_vi_key_bindings --no-erase
end
set -g fish_key_bindings fish_hybrid_key_bindings
# VIFM CD Function
function vicd
set dst "$(command vifm --choose-dir - $argv[2..-1])"
if [ -z "$dst" ];
echo 'Directory picking cancelled/failed'
return 1
end
builtin cd "$dst"
end
end