-
Notifications
You must be signed in to change notification settings - Fork 0
/
config.fish
127 lines (120 loc) · 4.54 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
/opt/homebrew/bin/brew shellenv | source
# micromamba shell hook --shell fish | source
starship init fish | source
zoxide init fish | source
direnv hook fish | source
atuin init fish | source
fish_vi_key_bindings
# https://github.com/jimeh/tmuxifier
fish_add_path $HOME/.tmux/plugins/tmuxifier/bin
fish_add_path $HOME/.local/bin
fish_add_path $HOME/.cargo/bin
fish_add_path $HOME/go/bin
fish_add_path /opt/homebrew/opt/avr-gcc@8/bin
fish_add_path /Applications/WezTerm.app/Contents/MacOS
fish_add_path /Applications/neovide.app/Contents/MacOS
# tmuxifier init - fish | source
set -gx EDITOR "emacsclient -a '' -t"
# for lazygit https://github.com/jesseduffield/lazygit/blob/master/docs/Config.md#user-config
# set -gx XDG_CONFIG_HOME "$HOME/.config"
alias emacs=$EDITOR
set -gx POETRY_VIRTUALENVS_IN_PROJECT true
# https://www.packetmischief.ca/2016/09/06/ssh-agent-on-os-x/
set -gx SSH_AUTH_SOCK (launchctl getenv SSH_AUTH_SOCK)
set -g fish_greeting
# cursor style like vim
set fish_vi_force_cursor
set fish_cursor_default block
set fish_cursor_insert line
set fish_cursor_replace_one underscore
set fish_cursor_replace underscore
set fish_cursor_external line
set fish_cursor_visual block
# https://the.exa.website/
alias ls=eza
alias ll="ls -lh"
alias l="ls -la"
alias rt="ls -l --sort newest"
alias u="cd .."
alias n="NVIM_APPNAME=nvim neovide"
alias ze="zellij attach --create LOCAL"
alias tldrf='tldr --list | fzf --preview "tldr {1}" --preview-window=right,60% | xargs tldr'
function nvims
set items cool rocks default kickstart NvChad AstroNvim LazyVim jose
set config (printf "%s\n" $items | fzf --prompt=" Neovim Config » " --height=~50% --layout=reverse --border --exit-0)
if [ -z $config ]
echo "Nothing selected"
return 0
else if [ $config = default ]
set config ""
end
env NVIM_APPNAME=$config nvim $argv
end
# test sqls from scratch
alias emacs-sql="/opt/homebrew/bin/emacs --init-directory $HOME/.emacs.sql"
# test sqls
alias emacs-space="/opt/homebrew/bin/emacs --init-directory $HOME/.emacs.space"
# test fuzzy search
alias emacs-doom-dev="env DOOMDIR=$HOME/.doom-dev /opt/homebrew/bin/emacs --init-directory $HOME/.emacs.doom-dev"
# test prelude
alias emacs-prelude="/opt/homebrew/bin/emacs --init-directory $HOME/.emacs.prelude"
# test god
alias emacs-god="/opt/homebrew/bin/emacs --init-directory $HOME/.emacs.god"
function e
set items doom doom-dev space sql prelude
set config (printf "%s\n" $items | fzf --prompt=" » " --height=~50% --layout=reverse --border --exit-0)
if [ -z $config ]
echo "Nothing selected"
return 0
else if [ $config = doom ]
eval $EDITOR
return 0
else if [ $config = doom-dev ]
env DOOMDIR=$HOME/.doom-dev /opt/homebrew/bin/emacs --init-directory $HOME/.emacs.doom-dev
return 0
else if [ $config = sql ]
set config "$HOME/.emacs.sql"
else if [ $config = space ]
set config "$HOME/.emacs.space"
else if [ $config = prelude ]
set config "$HOME/.emacs.prelude"
end
/opt/homebrew/bin/emacs --init-directory $config
end
function login_aws
set items single-stg single-prod multi-stg multi-prod
set account (printf "%s\n" $items | fzf --prompt=" OneFootball AWS account » " --height=~50% --layout=reverse --border --exit-0)
if [ -z $account ]
echo "Nothing selected"
return 0
end
set -gx SAML2AWS_IDP_PROVIDER JumpCloud
set -gx SAML2AWS_MFA Auto
set -gx SAML2AWS_PROFILE default
if [ $account = multi-prod ]
echo "Connecting to OneFootball Prod"
set -gx SAML2AWS_URL https://sso.jumpcloud.com/saml2/awsproddataeng
saml2aws login --force
else if [ $account = single-stg ]
echo "Connecting to Data Staging"
set -gx SAML2AWS_URL https://sso.jumpcloud.com/saml2/awsdatateamstg
saml2aws login --force
else if [ $account = multi-stg ]
echo "Connecting to OneFootball Staging"
set -gx SAML2AWS_URL https://sso.jumpcloud.com/saml2/awsstgdataeng
saml2aws login --force
else if [ $account = single-prod ]
echo "Connecting to Data Prod"
set -gx SAML2AWS_URL https://sso.jumpcloud.com/saml2/awsdatateam
saml2aws login --force
end
end
if status is-interactive
set emacs_exp '(with-current-buffer (window-buffer (selected-window)) (projectile-project-root))'
set emacs_dir (emacsclient -a 'echo' --eval "$emacs_exp" 2> /dev/null)
if test "$emacs_dir" != "nil"
if test "$emacs_dir" != "$emacs_exp"
cd (echo $emacs_dir | jq -r)
end
end
end