-
Notifications
You must be signed in to change notification settings - Fork 0
/
Example.pkl
115 lines (105 loc) · 3.83 KB
/
Example.pkl
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
// This is an example USC config
// You can use the command "usc.sh Example.sh" from this directory
// to generate shell config files (created in ./out/)
// if you want to share this config file outside of this project
// you can easily inline the contents of "templates/ConfigTemplate.pkl"
// into where the "amends" keyword is located (below)
amends "templates/ConfigTemplate.pkl"
/// Creates environment variables at the start of initilization
variables = new {
new EnvVariableTarget {
files {".zshrc"}
items {
new EnvVariable { name = "ZSH" value = "$HOME/.oh-my-zsh" }
new EnvVariable { name = "ZSH_THEME" value = "aussiegeek" }
new EnvVariable { name = "plugin" value = "(git vi-mode)" }
}
}
}
/// Create command aliases
aliases = new {
new AliasTarget {
files {"*"}
items {
new Alias { aliases {"l"} command = "ls -l" }
new Alias { aliases {"ll"} command = "ls -latrh" }
new Alias { aliases {"record"} command = "asciinema rec" }
new Alias { aliases {"em"} command = "emacs -Q -nw" }
new Alias { aliases {"ada"} command = "gnatmake" }
new Alias { aliases {"vsc"} command = "code ." }
new Alias { aliases {"g"} command = "git" }
new Alias { aliases {"ga"} command = "git add -A" }
new Alias { aliases {"gs"} command = "ga;gc;gp" }
new Alias { aliases {"gcl"} command = "git clone" }
new Alias { aliases {"n"} command = "npm" }
new Alias { aliases {"pn"} command = "pnpm" }
new Alias { aliases {"e"} command = "ls -t --color=auto --group-directories-first" }
new Alias { aliases {"ee"} command = "ls -talhv --group-directories-first" }
new Alias { aliases {"fman"} command = "compgen -c | fzf | xargs man" }
new Alias { aliases {"lg"} command = "lazygit" }
new Alias { aliases {"t"} command = "tmux" }
new Alias { aliases {"q" "qa" "qq"} command = "exit" }
// for (i in List(1, 2, 3, 4, 5)) {
// new Alias { aliases { i * "u" } command = "cd " + i * ".." }
// }
}
}
new AliasTarget {
files {"Profile.ps1"}
items {
new Alias { aliases {"pt"} command = "powertoys" }
}
}
new AliasTarget {
files {".zshrc" ".bashrc"}
items {
new Alias { aliases {"c"} command = "xclip -selection clipboard" }
new Alias { aliases {"y"} command = "xclip -selection clipboard -o" }
new Alias { aliases {"cd"} command = "z" }
// powershell already has read only aliases for these commands
// therefore, we can only define gc, gp, and gm aliases on linux
new Alias { aliases {"gc"} command = "git commit" }
new Alias { aliases {"gp"} command = "git push" }
new Alias { aliases {"gm"} command = "git pull" }
}
}
}
sources = new {
new Target {
files {".zshrc"}
items {
"$ZSH/oh-my-zsh.sh"
"~/.local/bin/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh"
"~/.local/bin/zsh-autosuggestions/zsh-autosuggestions.zsh"
}
}
new Target {
files {".zshrc" ".bashrc"}
items {
"<(ng completion script)"
}
}
}
/// Adds paths to PATH
paths = new {
new Target {
files {".zshrc" ".bashrc"}
items {
"~/go/bin"
"~/.dotnet/tools"
"~/.cargo/bin"
"~/.config/emacs/bin"
"~/bin"
"/usr/sbin/"
}
}
}
/// Execute commands before the user can interact with the shell
commands = new {
new Target {
files {".bashrc" ".zshrc"}
items {
"eval \"$(zoxide init zsh)\""
}
}
}