-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrc.elv
239 lines (145 loc) · 6.4 KB
/
rc.elv
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
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
use n_util
use readline-binding
use path
# Setup for zoxide development.
use ./zoxide
use epm
epm:install github.com/chlorm/elvish-stl
use github.com/chlorm/elvish-stl/os
# use github.com/chlorm/elvish-stl/path
use github.com/chlorm/elvish-stl/platform
use github.com/chlorm/elvish-stl/windows
use github.com/chlorm/elvish-stl/time
use github.com/chlorm/elvish-stl/utils
epm:install github.com/zzamboni/elvish-completions
epm:install github.com/zzamboni/elvish-modules
epm:install github.com/xiaq/edit.elv
use github.com/zzamboni/elvish-completions/git
use github.com/zzamboni/elvish-completions/builtins
use github.com/zzamboni/elvish-completions/cd
use github.com/zzamboni/elvish-completions/ssh
#epm:install github.com/muesli/elvish-libs
use github.com/muesli/elvish-libs/theme/powerline
set edit:prompt-stale-transform = {|x| put $x }
set edit:rprompt-stale-transform = {|x| put $x }
epm:install &silent-if-installed=$true github.com/crinklywrappr/rivendell
epm:upgrade github.com/crinklywrappr/rivendell
# epm:install github.com/trieloff/elvish-completion
# use github.com/trieloff/elvish-completion/npx
# use github.com/trieloff/elvish-completion/npm
# use github.com/crinklywrappr/rivendell/test t
# # use github.com/crinklywrappr/rivendell/base b
# use github.com/crinklywrappr/rivendell/fun f
# use github.com/crinklywrappr/rivendell/lazy l
# use github.com/crinklywrappr/rivendell/rune r
# use github.com/crinklywrappr/rivendell/algo a
# use github.com/crinklywrappr/rivendell/vis v
# lazily graphing population data from the 2021 census
# var file = (a:lines NST-EST2021-alldata.csv)
# var f = {|line| s:split , $line | f:listify}
# var popkeys = ($f (l:first $file))
# l:drop 6 $file ^
# | l:each (f:comp $f (f:partial $f:zipmap~ $popkeys) (f:juxt (f:k NAME) (f:k POPESTIMATE2021)) $f:listify~) ^
# | l:take 20 ^
# | l:blast ^
# | v:barky &min=0
# Alabama ████████
# Alaska █
# Arizona ███████████
# Arkansas ████
# California ███████████████████████████████████████████████████████████████
# Colorado █████████
# Connecticut █████
# Delaware █
# District of Co… █
# Florida ███████████████████████████████████
# Georgia █████████████████
# Hawaii ██
# Idaho ███
# Illinois ████████████████████
# Indiana ███████████
# Iowa █████
# Kansas ████
# Kentucky ███████
# Louisiana ███████
# Maine ██
epm:install github.com/aca/elvish-bash-completion/bash-completer
# use github.com/aca/elvish-bash-completion/bash-completer
# set edit:completion:arg-completer[ssh] = (bash-completer:new "ssh")
# set edit:completion:arg-completer[scp] = (bash-completer:new "scp")
# set edit:completion:arg-completer[curl] = (bash-completer:new "curl")
# set edit:completion:arg-completer[man] = (bash-completer:new "man")
# set edit:completion:arg-completer[killall] = (bash-completer:new "killall")
# set edit:completion:arg-completer[aria2c] = (bash-completer:new "aria2c")
# set edit:completion:arg-completer[ip] = (bash-completer:new "ip")
# set edit:completion:arg-completer[journalctl] = (bash-completer:new "journalctl")
# set edit:completion:arg-completer[tcpdump] = (bash-completer:new "tcpdump")
# set edit:completion:arg-completer[iptables] = (bash-completer:new "iptables")
# set edit:completion:arg-completer[tmux] = (bash-completer:new "tmux")
# set edit:completion:arg-completer[fd] = (bash-completer:new "fd")
# set edit:completion:arg-completer[rg] = (bash-completer:new "rg")
# set edit:completion:arg-completer[pueue] = (bash-completer:new "pueue")
# # builtin completions
# set edit:completion:arg-completer[which] = (bash-completer:new "which" &bash_function="_complete type" &completion_filename="complete")
# ===================================================== env path
# Optional paths, add only those that exist
var optpaths = [
# ~/.emacs.d/bin
# /usr/local/opt/coreutils/libexec/gnubin
# /usr/local/opt/texinfo/bin
# /usr/local/opt/python/libexec/bin
# /usr/local/go/bin
# ~/Work/automated-security-helper
/Library/Java/JavaVirtualMachines/graalvm-ce-java19-22.3.1/Contents/Home/bin
]
var optpaths-filtered = [(each {|p|
if (path:is-dir $p) { put $p }
} $optpaths)]
# $n_util:append-path~ /Library/Java/JavaVirtualMachines/graalvm-ce-java19-22.3.1/Contents/Home/bin
var p = $E:PATH
set E:PATH = /Library/Java/JavaVirtualMachines/graalvm-ce-java19-22.3.1/Contents/Home/bin:$p
# prepend:fn:add-path-prepend() {
# local path="$1"
# if [[ -d "$path" ]]; then
# echo "Adding $path to the front of Elvish's PATH"
# export PATH="$path:$PATH"
# else
# echo "$path is not a valid directory"
# fi
# }
# fn prepend-path {|x|
# var p = $E:PATH
# set E:PATH = (put $x:p)
# }
# set paths = [
# # ~/bin
# # $E:GOPATH/bin
# $@optpaths-filtered
# # /usr/local/bin
# # /usr/local/sbin
# # /usr/sbin
# # /sbin
# # /usr/bin
# # /bin
# ]
# elvish (~/.elvish/rc.elv)
# eval (carapace _carapace|slurp)
if (not $platform:is-windows) {
(eval (carapace _carapace|slurp))
}
# test:fail { os:touch 'NUL' }
# set edit:insert:binding[Alt-x] = $edit:-instant:start~
fn file-manager { edit:navigation:start }
# ╭─────╮
# │ env │
# ╰─────╯
# https://github.com/stylelint/vscode-stylelint/issues/384#issuecomment-1332931914
set E:NODE_PATH = (npm root --quiet -g)
# ╭────────────╮
# │ completion │
# ╰────────────╯
# https://zzamboni.org/post/using-and-writing-completions-in-elvish/
# uninstall all pip freeze > requirements.txt;pip uninstall -r requirements.txt -y #remove-all
fn cmddir {|cmd| cd (dirname (which $cmd)) }
fn rm-LCU { rm -rf "C:/Windows/servicing/LCU/"}
fn cd-fzf { cd (fd -t d | fzf) }