-
Notifications
You must be signed in to change notification settings - Fork 1
/
fish.nix
82 lines (82 loc) · 2.28 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
{
config,
lib,
...
}: {
programs.fish = {
interactiveShellInit = ''
set __fish_git_prompt_show_informative_status 1
set __fish_git_prompt_showcolorhints 1
set __fish_git_prompt_showdirtystate 1
set __fish_git_prompt_showstashstate 1
set __fish_git_prompt_showuntrackedfiles 1
set fish_greeting 'Nyonk!'
'';
shellAliases =
{
"." = "eza --git --git-repos";
py = "python";
nb = "vyxnix build";
nd = "vyxnix develop";
nl = "vyxnix log";
nf = "vyxnix fmt";
nfc = "vyxnix flake check";
nfu = "vyxnix flake update";
nr = "vyxnix run";
ns = "vyxnix shell";
jj = "echo use A/C";
}
// builtins.mapAttrs (name: _v: "git ${name}") config.programs.git.aliases
// builtins.mapAttrs (name: _v: "ssh ${name}") config.programs.ssh.matchBlocks;
functions = let
jjAliases = {
"d" = "diff";
"h" = "show";
"l" = "log";
"ln" = "log --no-pager";
"m" = "describe -m";
"mm" = "describe";
"n" = "new";
"e" = "edit";
"a" = "abandon";
"z" = "restore";
"q" = "squash";
"qi" = "squash -i";
"p" = "split";
"r" = "rebase";
"b" = "bookmark set";
"gp" = "git push";
"gf" = "git fetch";
"v" = "resolve";
"s" = "absorb";
# XXX betray'd by case-insensitive APFS
# "N" = "next";
"Nx" = "next";
"Ne" = "next --edit";
# "P" = "prev";
"Pr" = "prev";
"Pe" = "prev --edit";
"ep" = "evolog -p";
"" = "";
};
in
lib.concatMapAttrs (lhs: rhs: {
"A${lhs}" = {
body = "JJ_USER='Asherah Connor' JJ_EMAIL='[email protected]' J ${rhs} $argv";
description = "jj ${rhs}";
wraps = "J ${rhs}";
};
"C${lhs}" = {
body = "JJ_USER='Charlotte' JJ_EMAIL='[email protected]' J ${rhs} $argv";
description = "jj ${rhs}";
wraps = "J ${rhs}";
};
})
jjAliases;
};
home.file = {
".config/fish/functions/blognew.fish".source = ./blognew.fish;
".config/fish/functions/blogserve.fish".source = ./blogserve.fish;
".config/fish/functions/J.fish".source = ./J.fish;
};
}