-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathconfig.fish
136 lines (112 loc) · 3.8 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
fish_default_key_bindings
######## SOURCE ########
source ~/.config/fish/env.fish
argc --argc-completions fish $ARGC_SCRIPTS | source
atuin init fish | source
mise activate fish | source
pay-respects fish --alias f | source
starship init fish | source
######## KEY-BINDINGS ########
bind ! __history_previous_command # add '!!' functionality, req ./functions/__history_previous_command.fish
bind '$' __history_previous_command_arguments # add '!$' functionality, req ./functions/__history_previous_command_arguments.fish
bind \cr _atuin_search
bind \cs __ethp_commandline_toggle_sudo
######## ABBREVIATIONS ########
if status --is-interactive
abbr --add --global cp 'cp -i'
abbr --add --global mv 'mv -i'
abbr --add --global rm 'cnc'
abbr --add --global gitbit 'git commit --amend --no-edit --date="Sat 01 Jan 2022 16:20:00 PST"'
end
######## ALIASES ########
alias ani "ani-cli -q best --skip" # weeb out in S-rank ultra-fidelity 8k lossless greenray
alias boi "wikiman"
alias cat "bat"
alias cbin "yes | cargo binstall"
alias cdr "cd (git rev-parse --show-toplevel)"
alias cg "config-grep"
alias clip "clipcat-menu --finder='fzf'"
alias cncr "conceal restore"
alias cols "column -c '$COLUMNS'"
alias d "devour"
alias feh "feh --scale-down --image-bg black"
alias fp "sk --preview='bat --color=always {}'"
alias glow "glow -p"
alias hn "clx -an --no-less-verify"
alias j "yazi"
alias jd "lfcd"
alias jls "jless -r"
alias la "fls -al --color=always" # all files and dirs
alias lc "lazygit --git-dir='$DOTFILES' --work-tree='$HOME'" # lazygit for config files
alias lg "lazygit"
alias lh "eza -la --color=always --ignore-glob='[a-z]*|[A-Z]*|[0-9]*'" # hidden only
alias ll "eza -l --color=always --git" # long format
alias ls "fls -l --color=always" # preferred listing
alias lt "erd -HIl --color=force" # tree listing
alias loc "plocate"
alias lok "xlock"
alias m "qalc"
alias mdc "mdcat --columns=70"
alias mkdir "mkdir -p"
alias nbg "feh --randomize --bg-scale --no-fehbg ~/media/pictures/wallpapers/" # change bg
alias o "xdg-open"
alias py "python"
alias q "exit"
alias thes "thesauromatic"
alias tf "terraform"
alias tv "lobster"
alias wh "wormhole-rs"
alias wget "wget2 --hsts-file='$XDG_DATA_HOME/wget-hsts'"
######## KAKOUNE ########
function config-grep
set config_files (config ls-files | while read line; printf "\"%s\" " "$line"; end)
set grepargs
for x in $argv
set -a grepargs (echo $x | sed -e "s/'/''/g" -e "s/^/'/" -e "s/\$/'/")
end
kak -e "grep $(string join -- " " $grepargs) $config_files; buffer-only; echo; info-buffers"
end
complete -c config-grep -w rg
function kd
k (fd $argv)
end
complete -c kd -w fd
function kda
kak -e "delta $argv; buffer-only; echo; info-buffers"
end
function kg
set grepargs
for x in $argv
set -a grepargs (echo $x | sed -e "s/'/''/g" -e "s/^/'/" -e "s/\$/'/")
end
kak -e "grep $(string join -- " " $grepargs); buffer-only; echo; info-buffers"
end
complete -c kg -w rg
function kgl
kak -e 'live-grep; buffer-only;echo "live-grep"; info-buffers'
end
function kif
kak -e "diff $argv; buffer-only; echo; info-buffers"
end
function kift
kak -e "difft $argv; buffer-only; echo; info-buffers"
end
function kp
kak -e "kakpipe -- $argv"
end
alias k 'kak'
alias kakrc 'k ~/.config/kak/kakrc'
alias kenv 'k ~/.config/fish/env.fish'
alias kish 'k ~/.config/fish/config.fish'
# fix ssh agent
if not set -q SSH_AUTH_SOCK
eval (ssh-agent -c) &> /dev/null
end
# Start X at login
if status is-login
if test -z "$DISPLAY" -a "$XDG_VTNR" = 1
echo "Starting X11. (<C-c> to cancel)"
sleep 2
exec startx -- -keeptty &>/dev/null
end
end