-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathfish.nix
173 lines (158 loc) · 5.23 KB
/
fish.nix
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
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
{
pkgs,
lib,
config,
...
}:
with lib; let
cfg = config.cli.fish;
in {
options.cli.fish = {enable = mkEnableOption "fish";};
config = mkIf cfg.enable {
catppuccin.fish.enable = true;
programs = {
dircolors.enableFishIntegration = true;
fzf.enableFishIntegration = true;
kitty.shellIntegration.enableFishIntegration = true;
fish = {
enable = true;
shellInit = ''
set fish_greeting # Disable greeting
set hydro_color_pwd $fish_color_cwd
set hydro_color_git $fish_color_host
set hydro_color_prompt $fish_color_host_remote
fish_vi_key_bindings
'';
shellAbbrs = rec {
# Git
ga = "git add";
gaa = "git add --all";
gb = "git branch";
gbd = "git branch -D";
gbda = "git remote prune origin";
gco = "git checkout";
gcom = "git checkout $(git branch -l main master --format '%(refname:short)')";
gcoml = "${gcom} && ${ggl}";
gcb = "git checkout -b";
gcm = "git commit -m";
gcma = "${gaa} && git commit -m";
"gcn!" = "git commit --verbose --amend --no-edit";
"gcan!" = "git commit --verbose --amend --no-edit --all";
gd = "git diff";
gdca = "git diff --cached";
gf = "git fetch";
gp = "git push";
ggp = "git push origin $(git branch --show-current)";
ggf = "git push origin $(git branch --show-current) -f";
gl = "git pull";
ggl = "git pull origin $(git branch --show-current)";
gr = "git reset";
"gr!" = "git reset --hard HEAD~";
"goops" = "git reset --hard HEAD~";
"gro!" = "git reset --hard origin/$(git branch --show-current)";
grs = "git reset --soft HEAD~";
gst = "git status";
gsta = "git stash push";
gstp = "git stash pop";
gstc = "git stash clear";
gm = "git merge";
gmm = "git merge $(git branch -l main master --format '%(refname:short)')";
gmc = "git merge --continue";
# Docker
docker = "sudo docker";
# .NET
db = "dotnet build";
dr = "dotnet run";
# Terraform
tfa = "terraform apply";
tfaa = "terraform apply -auto-approve";
tfd = "terraform destroy";
tfda = "terraform destroy -auto-approve";
tfi = "terraform init";
tfp = "terraform plan";
tfr = "terraform refresh";
tfs = "terraform show";
tfsl = "terraform state list";
tfsr = "terraform state remove";
tft = "terraform taint";
tfv = "terraform version";
# OpenTofu
otfa = "tofu apply";
otfaa = "tofu apply -auto-approve";
otfd = "tofu destroy";
otfda = "tofu destroy -auto-approve";
otfi = "tofu init";
otfp = "tofu plan";
otfr = "tofu refresh";
otfs = "tofu show";
otfsl = "tofu state list";
otfsr = "tofu state remove";
otft = "tofu taint";
otfv = "tofu version";
# Terragrunt
tga = "terragrunt apply";
tgaa = "terragrunt apply -auto-approve";
tgd = "terragrunt destroy";
tgda = "terragrunt destroy -auto-approve";
tgi = "terragrunt init";
tgp = "terragrunt plan";
tgr = "terragrunt refresh";
tgs = "terragrunt show";
tgsl = "terragrunt state list";
tgsr = "terragrunt state remove";
tgt = "terragrunt taint";
tgv = "terragrunt version";
# Pulumi
pl = "pulumi login";
pu = "pulumi up";
puy = "pulumi up -y";
# Nix Helper
nhr = "nh os switch";
nhrn = "${nhr} -n";
nhb = "nh os boot";
nht = "nh os test";
nhs = "nh search";
nhc = "nh clean all --keep 10 --keep-since 10d";
nhcn = "${nhc} -n";
# Basic
ls = "ls -h --color=auto --group-directories-first";
la = "ls -lah --group-directories-first";
md = "mkdir -vp";
dir = "dir --color=auto";
grep = "grep --color=auto";
fgrep = "fgrep --color=auto";
egrep = "egrep --color=auto";
loc = "scc --no-cocomo";
rmf = "rm -rf";
gcsmg = "git commit -m";
# Tmux
tmk = "tmux kill-session";
tmkk = "tmux kill-server";
# Direnv
duf = "echo 'use flake' >> .envrc && direnv allow";
da = "direnv allow";
dd = "direnv disallow";
};
plugins = with pkgs; [
{
name = "hydro";
inherit (fishPlugins.hydro) src;
}
{
name = "autopair";
inherit (fishPlugins.autopair) src;
}
{
name = "fish-completion-sync";
src = pkgs.fetchFromGitHub {
owner = "pfgray";
repo = "fish-completion-sync";
rev = "ba70b6457228af520751eab48430b1b995e3e0e2";
sha256 = "sha256-JdOLsZZ1VFRv7zA2i/QEZ1eovOym/Wccn0SJyhiP9hI=";
};
}
];
};
};
};
}