Stuff?
This commit is contained in:
parent
16de6fba1d
commit
1024a3626b
|
@ -14,7 +14,7 @@
|
||||||
|
|
||||||
[core]
|
[core]
|
||||||
editor = nvim
|
editor = nvim
|
||||||
pager = less -r
|
pager = diff-so-fancy | less --tabs=2 -RFX
|
||||||
|
|
||||||
[http "https://gopkg.in"]
|
[http "https://gopkg.in"]
|
||||||
followRedirects = true
|
followRedirects = true
|
||||||
|
@ -63,3 +63,17 @@
|
||||||
|
|
||||||
[gpg]
|
[gpg]
|
||||||
program = gpg2
|
program = gpg2
|
||||||
|
[color]
|
||||||
|
ui = true
|
||||||
|
[color "diff-highlight"]
|
||||||
|
oldNormal = red bold
|
||||||
|
oldHighlight = red bold 52
|
||||||
|
newNormal = green bold
|
||||||
|
newHighlight = green bold 22
|
||||||
|
[color "diff"]
|
||||||
|
meta = 11
|
||||||
|
frag = magenta bold
|
||||||
|
commit = yellow bold
|
||||||
|
old = red bold
|
||||||
|
new = green bold
|
||||||
|
whitespace = red reverse
|
||||||
|
|
8
bin/k8s-yaml-diff
Executable file
8
bin/k8s-yaml-diff
Executable file
|
@ -0,0 +1,8 @@
|
||||||
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
|
[ "$#" -lt 2 ] && echo "Need two filenames." && exit 1
|
||||||
|
|
||||||
|
f1="$1"; shift
|
||||||
|
f2="$1"; shift
|
||||||
|
|
||||||
|
nvim -d <(k8s-yaml-sort "$f1") <(k8s-yaml-sort "$f2")
|
17
bin/k8s-yaml-sort
Executable file
17
bin/k8s-yaml-sort
Executable file
|
@ -0,0 +1,17 @@
|
||||||
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
|
[ "$#" -lt 1 ] && echo "Need a filename." && exit 1
|
||||||
|
cat "$1" | yq -s . | jq -S '
|
||||||
|
sort_by(.metadata.name) |
|
||||||
|
sort_by(.kind) |
|
||||||
|
.[] | .spec.template.spec.containers |=
|
||||||
|
if . == null then empty
|
||||||
|
else
|
||||||
|
map(
|
||||||
|
if . == null then empty
|
||||||
|
else .env |= sort_by(.name)
|
||||||
|
| .volumeMounts |= sort_by(.name)
|
||||||
|
end
|
||||||
|
)
|
||||||
|
end
|
||||||
|
'
|
11
bin/pipeline
11
bin/pipeline
|
@ -52,19 +52,20 @@ else
|
||||||
trap "${cleanup_trap}; kill \"$watcher\"" EXIT
|
trap "${cleanup_trap}; kill \"$watcher\"" EXIT
|
||||||
fi
|
fi
|
||||||
|
|
||||||
job="call jobstart(['inotifywait', '-m', '-e', 'close_write', '${out}'], {'on_stdout':{j,d,e->execute('checktime')}})"
|
job="$(echo "let g:pipeline_job_id = jobstart(['inotifywait', '-m', '-e', 'close_write', '${out}'], {'detach':1,'on_stdout':{j,d,e->execute('checktime')}})")"
|
||||||
|
|
||||||
|
echo $job >> "$log"
|
||||||
|
|
||||||
# this will only autosave (and therefore autoreload) for the out buffer (since
|
# this will only autosave (and therefore autoreload) for the out buffer (since
|
||||||
# it was opened last) - autosaving (and therefore autorunning) is potentially
|
# it was opened last) - autosaving (and therefore autorunning) is potentially
|
||||||
# very scary
|
# very scary
|
||||||
nvim \
|
nvim -V9"$td/vimlog" \
|
||||||
--cmd 'set shm+=atIWF' \
|
|
||||||
--cmd 'set shm-=Oo' \
|
|
||||||
-o "$in" "$transform" "$out" \
|
-o "$in" "$transform" "$out" \
|
||||||
--cmd 'set autoread' \
|
--cmd 'set autoread' \
|
||||||
--cmd 'set updatetime=250' \
|
--cmd 'set updatetime=250' \
|
||||||
--cmd 'autocmd CursorHold,CursorHoldI <buffer> silent write' \
|
--cmd 'autocmd CursorHold,CursorHoldI <buffer> silent write' \
|
||||||
--cmd "$(<<< "$job" tr "'" '"')"
|
--cmd 'autocmd VimLeave call jobstop(g:pipeline_job_id)' \
|
||||||
|
--cmd "$job"
|
||||||
|
|
||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
|
|
8
bin/yamldiff
Executable file
8
bin/yamldiff
Executable file
|
@ -0,0 +1,8 @@
|
||||||
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
|
[ "$#" -lt 2 ] && echo "Need two filenames." && exit 1
|
||||||
|
|
||||||
|
f1="$1"; shift; echo "$f1" >&2
|
||||||
|
f2="$1"; shift; echo "$f2" >&2
|
||||||
|
|
||||||
|
nvim -d <(yq . "$f1" | jq -S .) <(yq . "$f2" | jq -S .)
|
Reference in a new issue