Browse Source
the fuck did you just fucking say about me, you little bitch? I'll have you know I graduated top of my class in the Navy Seals, and I've been involved in numerous secret raids on Al-Quaeda, and I have over 300 confirmed kills. I am trained in gorilla warfare and I'm the top sniper in the entire US armed forces. You are nothing to me but just another target. I will wipe you the fuck out with precision the likes of which has never been seen before on this Earth, mark my fucking words. You think you can get away with saying that shit to me over the Internet? Think again, fucker. As we speak I am contacting my secret network of spies across the USA and your IP is being traced right now so you better prepare for the storm, maggot. The storm that wipes out the pathetic little thing you call your life. You're fucking dead, kid. I can be anywhere, anytime, and I can kill you in over seven hundred ways, and that's just with my bare hands. Not only am I extensively trained in unarmed combat, but I have access to the entire arsenal of the United States Marine Corps and I will use it to its full extent to wipe your miserable ass off the face of the continent, you little shit. If only you could have known what unholy retribution your little "clever" comment was about to bring down upon you, maybe you would have held your fucking tongue. But you couldn't, you didn't, and now you're paying the price, you goddamn idiot. I will shit fury all over you and you will drown in it. You're fucking dead, kiddo.master
commit
feb214d97e
122 changed files with 8695 additions and 0 deletions
@ -0,0 +1,4 @@
@@ -0,0 +1,4 @@
|
||||
.pijul |
||||
.stfolder |
||||
.stignore |
||||
elvish/lib/github.com/ |
@ -0,0 +1,5 @@
@@ -0,0 +1,5 @@
|
||||
# Huh? |
||||
|
||||
Dotfiles are partially managed/created with the help of [ntr](https://github.com/SolitudeSF/ntr) - templating configuration renderer. See [ntr/](ntr) for example. |
||||
|
||||
`bin/` scripts are probably unusable on your system, since they depend on programs that aren't present in coreutils (for no practical reason other than marginal performance gain) |
@ -0,0 +1,68 @@
@@ -0,0 +1,68 @@
|
||||
include "%L" |
||||
|
||||
# Greek |
||||
<Multi_key> <g> <a> : "ฮฑ" |
||||
<Multi_key> <g> <b> : "ฮฒ" |
||||
<Multi_key> <g> <g> : "ฮณ" |
||||
<Multi_key> <g> <d> : "ฮด" |
||||
<Multi_key> <g> <3> : "ฮต" |
||||
<Multi_key> <g> <z> : "ฮถ" |
||||
<Multi_key> <g> <e> : "ฮท" |
||||
<Multi_key> <g> <h> : "ฮธ" |
||||
<Multi_key> <g> <i> : "ฮน" |
||||
<Multi_key> <g> <k> : "ฮบ" |
||||
<Multi_key> <g> <l> : "ฮป" |
||||
<Multi_key> <g> <m> : "ฮผ" |
||||
<Multi_key> <g> <n> : "ฮฝ" |
||||
<Multi_key> <g> <x> : "ฮพ" |
||||
<Multi_key> <g> <p> : "ฯ" |
||||
<Multi_key> <g> <r> : "ฯ" |
||||
<Multi_key> <g> <s> : "ฯ" |
||||
<Multi_key> <g> <t> : "ฯ" |
||||
<Multi_key> <g> <u> : "ฯ" |
||||
<Multi_key> <g> <f> : "ฯ" |
||||
<Multi_key> <g> <c> : "ฯ" |
||||
<Multi_key> <g> <o> : "ฯ" |
||||
|
||||
<Multi_key> <g> <G> : "ฮ" |
||||
<Multi_key> <g> <D> : "ฮ" |
||||
<Multi_key> <g> <H> : "ฮ" |
||||
<Multi_key> <g> <L> : "ฮ" |
||||
<Multi_key> <g> <X> : "ฮ" |
||||
<Multi_key> <g> <P> : "ฮ " |
||||
<Multi_key> <g> <S> : "ฮฃ" |
||||
<Multi_key> <g> <F> : "ฮฆ" |
||||
<Multi_key> <g> <U> : "ฮจ" |
||||
<Multi_key> <g> <O> : "ฮฉ" |
||||
|
||||
# Bold |
||||
<Multi_key> <B> <A> : "๐ธ" |
||||
<Multi_key> <B> <B> : "๐น" |
||||
<Multi_key> <B> <C> : "โ" |
||||
<Multi_key> <B> <D> : "๐ป" |
||||
<Multi_key> <B> <E> : "๐ผ" |
||||
<Multi_key> <B> <F> : "๐ฝ" |
||||
<Multi_key> <B> <G> : "๐พ" |
||||
<Multi_key> <B> <H> : "โ" |
||||
<Multi_key> <B> <I> : "๐" |
||||
<Multi_key> <B> <J> : "๐" |
||||
<Multi_key> <B> <K> : "๐" |
||||
<Multi_key> <B> <L> : "๐" |
||||
<Multi_key> <B> <M> : "๐" |
||||
<Multi_key> <B> <N> : "โ" |
||||
<Multi_key> <B> <O> : "๐" |
||||
<Multi_key> <B> <P> : "โ" |
||||
<Multi_key> <B> <Q> : "โ" |
||||
<Multi_key> <B> <R> : "โ" |
||||
<Multi_key> <B> <S> : "๐" |
||||
<Multi_key> <B> <T> : "๐" |
||||
<Multi_key> <B> <U> : "๐" |
||||
<Multi_key> <B> <V> : "๐" |
||||
<Multi_key> <B> <W> : "๐" |
||||
<Multi_key> <B> <X> : "๐" |
||||
<Multi_key> <B> <Y> : "๐" |
||||
<Multi_key> <B> <Z> : "โค" |
||||
|
||||
# Misc |
||||
|
||||
<Multi_key> <equal> <asciitilde> : "โ" |
@ -0,0 +1,6 @@
@@ -0,0 +1,6 @@
|
||||
#!/bin/sh |
||||
echo "What the heck? :---DD" |
||||
printf %s "$(mpw -t x gpg 2>/dev/null)" | xclip -sel c -l 1 |
||||
gpg2 -d -q "$HOME/.password.gpg" | xclip -l 1 |
||||
mpw -t x ssh -M "$(xclip -o)" 2>/dev/null | xclip -sel c -l 1 |
||||
ssh-add |
@ -0,0 +1,2 @@
@@ -0,0 +1,2 @@
|
||||
#!/bin/sh |
||||
kitty +kitten icat "$(randfile "$HOME/pic/anzu")" |
@ -0,0 +1,3 @@
@@ -0,0 +1,3 @@
|
||||
#!/bin/sh |
||||
[ "$(id -u)" = 0 ] || _sudo=sudo |
||||
[ $# = 2 ] && exec $_sudo dd if="$1" of="$2" |
@ -0,0 +1,2 @@
@@ -0,0 +1,2 @@
|
||||
#!/bin/sh |
||||
"$@" </dev/null >/dev/null 2>&1 & |
@ -0,0 +1,5 @@
@@ -0,0 +1,5 @@
|
||||
#!/bin/sh |
||||
F=0 |
||||
for arg; do [ -f "$arg" ] && F=1 && break; done |
||||
[ $F = 1 ] && F='' || F=$(fd -t f | fzy) |
||||
exec "$EDITOR" "$@" "$F" |
@ -0,0 +1,9 @@
@@ -0,0 +1,9 @@
|
||||
#!/bin/sh |
||||
[ -z "$1" ] && return 1 || f=$(command -v "$1") |
||||
if [ -z "$f" ]; then |
||||
f="$HOME/bin/$1" |
||||
$EDITOR "$f" |
||||
[ -f "$f" ] && chmod +x "$f" |
||||
else |
||||
exec $EDITOR "$f" |
||||
fi |
@ -0,0 +1,81 @@
@@ -0,0 +1,81 @@
|
||||
#!/usr/bin/env elvish |
||||
|
||||
use re |
||||
|
||||
fn call [a @b]{ |
||||
list = [(splits ' ' $a)] |
||||
bin = (external $list[0]) |
||||
rest = [$@b] |
||||
if (> (count $list) 1) { |
||||
rest = [$list[1:] $@b] |
||||
} |
||||
$bin $@rest |
||||
} |
||||
|
||||
fn list-items [a]{ |
||||
if (-is-dir $a) { put $a/* } else { put $a } |
||||
} |
||||
|
||||
items = [] |
||||
|
||||
if (== (count $args) 0) { |
||||
items = [./*] |
||||
} else { |
||||
for i $args { |
||||
if (eq $i '-') { |
||||
each [x]{ items = [$@items (list-items $x)] } |
||||
} else { |
||||
items = [$@items (list-items $i)] |
||||
} |
||||
} |
||||
} |
||||
|
||||
high = (- (count $items) 1) |
||||
file = (mktemp -p /tmp elvmvXXXXX) |
||||
print > $file |
||||
c = 0 |
||||
|
||||
for i $items { |
||||
echo $c"\t"$items[$c] >> $file |
||||
c = (+ $c 1) |
||||
} |
||||
|
||||
editor = vi |
||||
if (has-env VISUAL) { |
||||
editor = (get-env VISUAL) |
||||
} elif (has-env EDITOR) { |
||||
editor = (get-env EDITOR) |
||||
} |
||||
|
||||
fn abort [&code=1 a]{ |
||||
echo $a >&2 |
||||
rm $file |
||||
exit $code |
||||
} |
||||
|
||||
try { |
||||
call $editor $file |
||||
} except { |
||||
abort 'Editor exited with error. Aborting...' |
||||
} |
||||
|
||||
cat $file | each [l]{ |
||||
matches = (re:find '^(\d+)\t?(.*)$' $l) |
||||
if (not (eq $matches '')) { |
||||
id = $matches[groups][1][text] |
||||
name = $matches[groups][2][text] |
||||
src = $items[$id] |
||||
if (> $id $high) { |
||||
abort 'Unknown item id: '$id'. Aborting...' |
||||
} elif (not (eq $src $name)) { |
||||
mkdir -p (path-dir $name) |
||||
mv $items[$id] $name |
||||
} |
||||
} elif (re:match '^\s*$' $l) { |
||||
continue |
||||
} else { |
||||
abort 'Couldn''t parse line "'$l'". Aborting...' |
||||
} |
||||
} |
||||
|
||||
rm $file |
@ -0,0 +1,3 @@
@@ -0,0 +1,3 @@
|
||||
#!/bin/sh |
||||
for i; do ext="$ext -e $i"; done |
||||
if [ "$ext" ]; then fd -L $ext | xe dirname | sort | uniq; fi |
@ -0,0 +1,7 @@
@@ -0,0 +1,7 @@
|
||||
#!/bin/sh |
||||
ps up $(pgrep -f ${@:-.}) | \ |
||||
while read -r l; do |
||||
printf '%s\n' "$l" >&2 |
||||
fzy | awk '{print $2}' |
||||
break |
||||
done |
@ -0,0 +1,26 @@
@@ -0,0 +1,26 @@
|
||||
#!/usr/bin/env elvish |
||||
|
||||
if (eq (mpc current) "") { exit 1 } |
||||
|
||||
library-location = (xdg-user-dir MUSIC) |
||||
song-relative = (mpc -f '%file%' | take 1) |
||||
song-location = $library-location'/'$song-relative |
||||
song-dir = (path-dir $song-location) |
||||
@images = (fd -t f -e png -e jpg -e jpeg . $song-dir) |
||||
|
||||
if (> (count $images) 0) { |
||||
use str |
||||
image = "" |
||||
for i $images { |
||||
t = (str:to-lower (joins . [(splits . (path-base $i))][:-1])) |
||||
if (or (eq $t "cover") \ |
||||
(eq $t "folder")) { image = $i } |
||||
} |
||||
if (eq $image '') { |
||||
print $images[0] |
||||
} else { |
||||
print $image |
||||
} |
||||
} else { |
||||
exit 1 |
||||
} |
@ -0,0 +1,2 @@
@@ -0,0 +1,2 @@
|
||||
#!/usr/bin/env elvish |
||||
print [(splits "'" (cat $E:XDG_CONFIG_HOME/setroot/.setroot-restore))][-2] |
@ -0,0 +1,4 @@
@@ -0,0 +1,4 @@
|
||||
#!/bin/sh |
||||
for remote in $(git remote); do |
||||
git push "$remote" "$@" |
||||
done |
@ -0,0 +1,2 @@
@@ -0,0 +1,2 @@
|
||||
#!/bin/sh |
||||
git commit --amend --no-edit -q && git push -f -q |
@ -0,0 +1,4 @@
@@ -0,0 +1,4 @@
|
||||
#!/bin/sh |
||||
for w; do |
||||
echo "$w: "$(xdg-mime query filetype "$w") |
||||
done |
@ -0,0 +1,5 @@
@@ -0,0 +1,5 @@
|
||||
#!/bin/sh |
||||
pkill xwinwrap |
||||
exec xwinwrap -ni -fs -s -nf -b -un -argb -fdt -- \ |
||||
mpv --wid WID --no-terminal --no-audio --no-config --no-border \ |
||||
--x11-bypass-compositor=no --keepaspect=no --loop "$1" |
@ -0,0 +1,13 @@
@@ -0,0 +1,13 @@
|
||||
#!/usr/bin/env elvish |
||||
t="" |
||||
if (eq 0 (count $args)) { |
||||
sites=[(keys (cat ~/.mpw.d/SolitudeSF.mpsites.json | from-json)[sites])] |
||||
if (eq ?(tty -s) $ok) { |
||||
t=(echo &sep="\n" $@sites | fzy) |
||||
} else { |
||||
t=(echo &sep="\n" $@sites | rofi -dmenu -p 'Enter site: ' -width 25) |
||||
} |
||||
} else { |
||||
t=$args[0] |
||||
} |
||||
mpw -t x -M (gpg2 -d -q ~/.password.gpg) $t 2>/dev/null | xclip -sel c -r |
@ -0,0 +1,2 @@
@@ -0,0 +1,2 @@
|
||||
#!/bin/sh |
||||
exec xe -ap -j0 '%.{flac,wv,ape,wav}' opusenc --quiet --bitrate 256 {} %.opus -- "$@" |
@ -0,0 +1,2 @@
@@ -0,0 +1,2 @@
|
||||
#!/bin/sh |
||||
split2flac -nd -D -F -cue *cue "$@" && opus *flac && rm *flac |
@ -0,0 +1,2 @@
@@ -0,0 +1,2 @@
|
||||
#!/bin/sh |
||||
exec xe -a -j0 optipng -quiet -keep -o7 -- "$@" |
@ -0,0 +1,12 @@
@@ -0,0 +1,12 @@
|
||||
#!/bin/sh |
||||
n=1 |
||||
for arg; do |
||||
if [ -z "$n" ]; then |
||||
n=$arg |
||||
else case $arg in |
||||
-n) n="";; |
||||
*) dir=$arg;; |
||||
esac |
||||
fi |
||||
done |
||||
fd -I -d 1 -t f -t l . "${dir:-}" | shuf -n "$n" |
@ -0,0 +1,12 @@
@@ -0,0 +1,12 @@
|
||||
#!/bin/sh |
||||
win=$(bspc query -N -n .hidden.window) |
||||
n=$(for w in $win; do |
||||
name=$(xprop -id "$w" WM_CLASS 2>/dev/null | sed -r 's/.+ "(.+)"$/\1/') |
||||
title=$(xprop -id "$w" WM_NAME 2>/dev/null | sed -r 's/.+ "(.+)"$/\1/') |
||||
[ "$name" = "WM_CLASS" ] && echo "node $w" || echo "$name \"$title\"" |
||||
done | rofi -dmenu -no-custom -format i -p 'Unhide: ') |
||||
if [ -n "$n" ]; then |
||||
id=$(echo "$win" | sed -n "$((n+1))p") |
||||
bspc node "$id" -d focused |
||||
bspc node "$id" -g hidden=off |
||||
fi |
@ -0,0 +1,16 @@
@@ -0,0 +1,16 @@
|
||||
#!/bin/sh |
||||
# rofi based powermenu |
||||
|
||||
LOCKSCREEN="trollock -b bg" |
||||
|
||||
case "$(printf %s "\ |
||||
Suspend |
||||
Lock screen |
||||
Reboot |
||||
Power-off |
||||
" | rofi -width 20 -lines 4 -dmenu -no-custom -i -format i -p 'Powermenu: ')" in |
||||
0) $LOCKSCREEN & sudo -n zzz;; |
||||
1) $LOCKSCREEN & xset dpms force off;; |
||||
2) sudo -n reboot;; |
||||
3) sudo -n poweroff;; |
||||
esac |
@ -0,0 +1,2 @@
@@ -0,0 +1,2 @@
|
||||
#!/bin/sh |
||||
rofi -show window -modi window -show-icons -columns 2 -kb-accept-entry 'Return,Alt+Tab' |
@ -0,0 +1,9 @@
@@ -0,0 +1,9 @@
|
||||
#!/bin/sh |
||||
dir=$(xdg-user-dir PICTURES)/screen |
||||
[ -d "$dir" ] || mkdir -p "$dir" |
||||
file=$(date +"%Y-%m-%d_%H:%M:%S").png |
||||
path=$dir/$file |
||||
if maim -u -s "$path"; then |
||||
notify-send --icon "$path" "Screenshot saved" "$path" |
||||
xclip -sel c -t image/png "$path" |
||||
fi |
@ -0,0 +1,50 @@
@@ -0,0 +1,50 @@
|
||||
#!/usr/bin/env elvish |
||||
use re |
||||
|
||||
data = (all | from-json) |
||||
col = $data[colors] |
||||
spec = $data[special] |
||||
wall = $data[wallpaper] |
||||
name = (re:replace '(\..+)?$' '' (path-base $wall)) |
||||
author = (get-env USER) |
||||
|
||||
if (> (count $args) 0) { |
||||
name = $args[0] |
||||
if (> (count $args) 1) { author = $args[1] } |
||||
} |
||||
|
||||
echo meta |
||||
echo ' name*: '$name |
||||
echo ' author: '$author |
||||
echo ' source: pywal' |
||||
echo |
||||
echo color |
||||
echo ' bg: '$spec[background] |
||||
echo ' fg: '$spec[foreground] |
||||
echo ' cursor: '$spec[cursor] |
||||
echo |
||||
echo 'color0: '$col[color0] |
||||
echo 'color8: '$col[color8] |
||||
echo |
||||
echo 'color1: '$col[color1] |
||||
echo 'color9: '$col[color9] |
||||
echo |
||||
echo 'color2: '$col[color2] |
||||
echo 'color10: '$col[color10] |
||||
echo |
||||
echo 'color3: '$col[color3] |
||||
echo 'color11: '$col[color11] |
||||
echo |
||||
echo 'color4: '$col[color4] |
||||
echo 'color12: '$col[color12] |
||||
echo |
||||
echo 'color5: '$col[color5] |
||||
echo 'color13: '$col[color13] |
||||
echo |
||||
echo 'color6: '$col[color6] |
||||
echo 'color14: '$col[color14] |
||||
echo |
||||
echo 'color7: '$col[color7] |
||||
echo 'color15: '$col[color15] |
||||
echo |
||||
echo 'wallpaper*: '(re:replace &literal=$true '^'(put ~) '{{$HOME}}' $wall) |
@ -0,0 +1,2 @@
@@ -0,0 +1,2 @@
|
||||
#!/bin/sh |
||||
cd "$XBPS_DISTDIR" && exec ./xbps-src "$@" |
@ -0,0 +1,40 @@
@@ -0,0 +1,40 @@
|
||||
#!/usr/bin/env elvish |
||||
use re |
||||
c = [&] |
||||
for l [(all)] { |
||||
if (re:match '^(\*\.?|URxvt\*)' $l) { |
||||
echo $l | eawk [_ k v]{ |
||||
c[(re:replace '(^\*\.?|^URxvt\*|:$)' '' $k)] = $v |
||||
} |
||||
} |
||||
} |
||||
echo color |
||||
echo ' bg: '$c[background] |
||||
echo ' fg: '$c[foreground] |
||||
if (has-key $c cursorColor) { |
||||
echo ' cursor: '$c[cursorColor] |
||||
} |
||||
echo |
||||
echo 'color0: '$c[color0] |
||||
echo 'color8: '$c[color8] |
||||
echo |
||||
echo 'color1: '$c[color1] |
||||
echo 'color9: '$c[color9] |
||||
echo |
||||
echo 'color2: '$c[color2] |
||||
echo 'color10: '$c[color10] |
||||
echo |
||||
echo 'color3: '$c[color3] |
||||
echo 'color11: '$c[color11] |
||||
echo |
||||
echo 'color4: '$c[color4] |
||||
echo 'color12: '$c[color12] |
||||
echo |
||||
echo 'color5: '$c[color5] |
||||
echo 'color13: '$c[color13] |
||||
echo |
||||
echo 'color6: '$c[color6] |
||||
echo 'color14: '$c[color14] |
||||
echo |
||||
echo 'color7: '$c[color7] |
||||
echo 'color15: '$c[color15] |
@ -0,0 +1,16 @@
@@ -0,0 +1,16 @@
|
||||
#!/bin/sh |
||||
bspc monitor -d 0 1 2 3 4 5 6 7 8 9 |
||||
|
||||
bspc config border_width 1 |
||||
bspc config window_gap 3 |
||||
bspc config split_ratio 0.5 |
||||
bspc config removal_adjustment longest_side |
||||
bspc config borderless_monocle true |
||||
bspc config gapless_monocle true |
||||
bspc config focus_follows_pointer true |
||||
bspc config click_to_focus button1 |
||||
|
||||
bspc rule -a Nightly desktop='^2' |
||||
bspc rule -a mpv state=floating |
||||
bspc rule -a Peek state=floating |
||||
bspc rule -a kittyfloat state=floating |
@ -0,0 +1,249 @@
@@ -0,0 +1,249 @@
|
||||
use re |
||||
use util |
||||
|
||||
use github.com/xiaq/edit.elv/compl/git |
||||
git:apply |
||||
|
||||
fn overlap-at [a b]{ |
||||
for i [(range 1 (- (count $b) 1))] { |
||||
if (has-value $a $b[$i]) { put $i; return } |
||||
} |
||||
put $false |
||||
} |
||||
|
||||
fn prefix-completer [p a]{ |
||||
edit:completion:arg-completer[$p] = [@cmd]{ |
||||
if (eq (count $cmd) 2) { |
||||
$a $@cmd |
||||
} elif (has-key $edit:completion:arg-completer $cmd[1]) { |
||||
$edit:completion:arg-completer[$cmd[1]] (explode $cmd[1:]) |
||||
} else { |
||||
edit:complete-filename $cmd[-1] |
||||
} |
||||
} |
||||
} |
||||
|
||||
fn complete-directory [a]{ |
||||
dir = (path-dir $a)/ |
||||
if (has-prefix $a $dir) { |
||||
a = (replaces &max=1 $dir '' $a) |
||||
} else { |
||||
dir = '' |
||||
} |
||||
for x [(put $dir*[match-hidden][nomatch-ok]$a*[match-hidden][nomatch-ok])] { |
||||
if (-is-dir $x) { edit:complex-candidate &code-suffix=/ &style='blue;bold' $x } |
||||
} |
||||
} |
||||
|
||||
edit:completion:arg-completer[cd] = [@cmd]{ |
||||
if (eq (count $cmd) 2) { |
||||
complete-directory $cmd[1] |
||||
} |
||||
} |
||||
|
||||
edit:completion:arg-completer[kak] = [@cmd]{ |
||||
if (eq $cmd[-2] -c) { |
||||
kak -l |
||||
} else { |
||||
edit:complete-filename $cmd[-1] |
||||
} |
||||
} |
||||
|
||||
edit:completion:arg-completer[waifu2x-converter-cpp] = [@cmd]{ |
||||
if (has-value [-i --input -o --output] $cmd[-2]) { |
||||
edit:complete-filename $cmd[-1] |
||||
} elif (has-value [-m --mode] $cmd[-2]) { |
||||
put noise scale noise_scale |
||||
} elif (eq $cmd[-2] --noise_level) { |
||||
put 1 2 3 |
||||
} else { |
||||
put --scale_ratio --noise_level --mode --jobs -i -o |
||||
} |
||||
} |
||||
|
||||
kitty-cmds = [] |
||||
kitty-kittens = [] |
||||
|
||||
edit:completion:arg-completer[kitty] = [@cmd]{ |
||||
if (== (count $kitty-cmds) 0) { |
||||
@kitty-cmds = (kitty @ --help | peach [x]{ if (re:match '^ \w' $x) { put $x[2:] } }) |
||||
@kitty-kittens = (pwd=/usr/lib/kitty/kittens fd main.py | peach [x]{ path-dir $x }) |
||||
} |
||||
if (has-value [kitten '+kitten'] $cmd[-2]) { |
||||
explode $kitty-kittens |
||||
} elif (eq $cmd[-2] '@') { |
||||
explode $kitty-cmds |
||||
} else { |
||||
edit:complete-filename $cmd[-1] |
||||
} |
||||
} |
||||
|
||||
edit:completion:arg-completer[sv] = [@cmd]{ |
||||
if (eq (count $cmd) 2) { |
||||
put status up down once pause cont hup alarm interrupt quit kill term 1 2 \ |
||||
exit start try-restart check {force-,}{stop,reload,restart,shutdown} |
||||
} else { |
||||
pwd=/var/service put * |
||||
} |
||||
} |
||||
|
||||
edit:completion:arg-completer[man] = [@cmd]{ |
||||
pwd=/usr/share/man put man*/* | peach [a]{ |
||||
re:replace &literal=$true '\.\dp?$' '' (path-base $a) |
||||
} |
||||
} |
||||
|
||||
edit:completion:arg-completer[kill] = [@cmd]{ |
||||
ps -u (whoami) --no-headers -o pid,command |\ |
||||
eawk [_ p @c]{ edit:complex-candidate &display-suffix=(print ' '$@c) $p } |
||||
} |
||||
|
||||
edit:completion:arg-completer[nimble] = [@cmd]{ |
||||
if (eq (count $cmd) 2) { |
||||
put {un,}install develop check init publish build c cc js test doc{,2} \ |
||||
refresh search list tasks path dump |
||||
if ?(isnimbleproject) { |
||||
nimble tasks 2>/dev/null | eawk [_ a @_]{ put $a } |
||||
} |
||||
} elif (eq $cmd[-2] install) { |
||||
for x (cat ~/.nimble/packages_official.json | from-json) { put $x[name] } |
||||
} elif (eq $cmd[-2] uninstall) { |
||||
pkgs = [&] |
||||
nimble list -i | eawk [_ n @v]{ |
||||
@ver = $@v[:-1] |
||||
ver[0] = $ver[0][1:] |
||||
pkgs[$n] = $ver |
||||
} |
||||
if (has-suffix $cmd[-1] '@') { |
||||
for v $pkgs[$cmd[-1][:-1]] { |
||||
put $cmd[-1]$v |
||||
} |
||||
} else { keys $pkgs } |
||||
} |
||||
} |
||||
|
||||
pijul-cmds = [add apply branches checkout clone credit delete-branch diff dist\ |
||||
generate-completions help init key log ls mv patch pull push\ |
||||
record remove revert rollback show-dependencies sign status tag unrecord] |
||||
|
||||
edit:completion:arg-completer[pijul] = [@cmd]{ |
||||
if (eq (count $cmd) 2) { |
||||
explode $pijul-cmds |
||||
} |
||||
} |
||||
|
||||
neofetch-img = [ascii caca iterm2 jp2a kitty pixterm sixel termpix tycat w3m off] |
||||
neofetch-opts = [] |
||||
|
||||
edit:completion:arg-completer[neofetch] = [@cmd]{ |
||||
if (== (count $neofetch-opts) 0) { |
||||
neofetch-opts = [(_ = ?(neofetch --help | each [x]{ |
||||
if (has-prefix $x ' --') { |
||||
put $x | eawk [_ a @_]{ put $a } |
||||
} |
||||
})) --logo -L -v -vv] |
||||
} |
||||
explode $neofetch-opts |
||||
} |
||||
|
||||
edit:completion:arg-completer[bspc] = [@cmd]{ |
||||
if (eq (count $cmd) 2) { |
||||
put node desktop monitor query wm rule config subscribe quit |
||||
} elif (eq $cmd[1] subscribe) { |
||||
put all report monitor desktop node pointer |
||||
} elif (eq $cmd[1] rule) { |
||||
put --add --remove --list |
||||
} elif (eq $cmd[1] wm) { |
||||
put --dump-state --load-state --add-monitor --adopt-orphans --record-history --get-status |
||||
} elif (eq $cmd[1] query) { |
||||
put --nodes --desktops --monitors --tree |
||||
} |
||||
} |
||||
|
||||
edit:completion:arg-completer[ntr] = [@cmd]{ |
||||
if (not (has-prefix $cmd[-1] '-')) { |
||||
pwd=$E:XDG_CONFIG_HOME/ntr/contexts put ** |
||||
} |
||||
} |
||||
|
||||
edit:completion:arg-completer[update] = [@cmd]{ |
||||
update | each [x]{ if (has-prefix $x "\t") { put $x[1:] } } |
||||
} |
||||
|
||||
edit:completion:arg-completer[xr] = [@cmd]{ |
||||
xpkg -m |
||||
xpkg -O | peach [x]{ edit:complex-candidate &style='red;inverse' $x } |
||||
} |
||||
|
||||
edit:completion:arg-completer[xi] = [@cmd]{ |
||||
pwd=$E:XBPS_DISTDIR/srcpkgs put * |
||||
} |
||||
|
||||
xbps-src-cmds = [] |
||||
xbps-src-arch = [] |
||||
|
||||
edit:completion:arg-completer[xbps-src] = [@cmd]{ |
||||
if (== (count $xbps-src-cmds) 0) { |
||||
@xbps-src-cmds = (xbps-src -h | take 122 | drop 4 | each [x]{ put (re:find &max=1 '^\w+(\-\w+)*' $x)[text] }) |
||||
@xbps-src-arch = (xbps-src -h | take 155 | drop 129)[1:] |
||||
} |
||||
if (eq $cmd[-2] '-a') { |
||||
explode $xbps-src-arch |
||||
} else { |
||||
if (not (overlap-at $xbps-src-cmds $cmd)) { |
||||
explode $xbps-src-cmds |
||||
} else { |
||||
pwd=$E:XBPS_DISTDIR/srcpkgs put * |
||||
} |
||||
} |
||||
} |
||||
|
||||
edit:completion:arg-completer[strat] = [@cmd]{ |
||||
@strata = (brl list) |
||||
has-strat = (overlap-at $strata $cmd) |
||||
if (not $has-strat) { |
||||
explode $strata |
||||
} else { |
||||
# edit:complete-sudo (explode $cmd[(+ $has-strat 1):]) |
||||
} |
||||
} |
||||
|
||||
brl-cmds = [] |
||||
|
||||
edit:completion:arg-completer[brl] = [@cmd]{ |
||||
if (== (count $brl-cmds) 0) { |
||||
@brl-cmds = (brl -h | take 35 | drop 5 | each [x]{ put (re:find &max=1 '^ \w+' $x)[text][2:] }) |
||||
} |
||||
len = (count $cmd) |
||||
if (== $len 2) { |
||||
explode $brl-cmds |
||||
} else { |
||||
c = $cmd[1] |
||||
if (has-value [status enable disable hide show] $c) { |
||||
brl list |
||||
} elif (eq $c fetch) { |
||||
brl fetch -L |
||||
} |
||||
} |
||||
} |
||||
|
||||
edit:completion:arg-completer[promotescript] = [@cmd]{ |
||||
pwd=~/bin put * |
||||
} |
||||
|
||||
edit:completion:arg-completer[edit-script] = $edit:complete-sudo~ |
||||
edit:completion:arg-completer[whereis] = $edit:complete-sudo~ |
||||
edit:completion:arg-completer[which] = $edit:complete-sudo~ |
||||
|
||||
edit:completion:arg-completer[xq] = $edit:completion:arg-completer[xi] |
||||
edit:completion:arg-completer[xqt] = $edit:completion:arg-completer[xi] |
||||
edit:completion:arg-completer[xbps-install] = $edit:completion:arg-completer[xi] |
||||
|
||||
prefixes = [ |
||||
&sudo=$edit:complete-sudo~ |
||||
&strace=$edit:complete-sudo~ |
||||
&time=$edit:complete-sudo~ |
||||
&torify=$edit:complete-sudo~ |
||||
] |
||||
|
||||
for k [(keys $prefixes)] { prefix-completer $k $prefixes[$k] } |
@ -0,0 +1,29 @@
@@ -0,0 +1,29 @@
|
||||
conf = (get-env XDG_CONFIG_HOME) |
||||
dot = (get-env DOTS_DIR) |
||||
ntrtmp = $conf/ntr/templates |
||||
setini = ['-e' 'set buffer filetype ini'] |
||||
fn e [@a]{ kak $@a } |
||||
|
||||
fn profile { e $E:HOME/.profile } |
||||
fn sx { e $conf/sx/sxrc } |
||||
fn git { e $conf/git/config } |
||||
fn xbps-src { e -e 'set buffer filetype sh' $E:XBPS_DISTDIR/etc/conf } |
||||
fn bspwm { e $conf/bspwm/bspwmrc } |
||||
fn sxhkd { e $conf/sxhkd/sxhkdrc; pkill -USR1 -x sxhkd } |
||||
fn polybar { e $ntrtmp/polybar } |
||||
fn rofi { e $conf/rofi/config.rasi } |
||||
fn dunst { e $ntrtmp/dunst } |
||||
fn elvish { pwd=~/.elvish e (fd . -L -e elv | fzy) } |
||||
fn nim { e $conf/nim/config.nims } |
||||
fn min { e $E:HOME/.minrc } |
||||
fn ntr { pwd=$conf/ntr e (fd . -L | fzy) } |
||||
fn splug { e $conf/splug/config.toml } |
||||
fn kitty { e $@setini $conf/kitty/kitty.conf } |
||||
fn kitty-diff { e $@setini $conf/kitty/diff.conf } |
||||
fn kitty-colors { e $@setini $dot/ntr/templates/kitty-colors } |
||||
fn ranger { e $conf/ranger/rc.conf } |
||||
fn rifle { e $conf/ranger/rifle.conf } |
||||
fn kak { e $conf/kak/kakrc } |
||||
fn pqiv { e $conf/pqivrc } |
||||
fn mpv { e $conf/mpv/mpv.conf } |
||||
fn ncmpcpp { e $@setini $conf/ncmpcpp/config } |
@ -0,0 +1,36 @@
@@ -0,0 +1,36 @@
|
||||
branch = '' |
||||
dirty = 0 |
||||
staged = 0 |
||||
untracked = 0 |
||||
ahead = 0 |
||||
behind = 0 |
||||
|
||||
fn refresh-status { |
||||
branch = '' |
||||
dirty = 0 |
||||
staged = 0 |
||||
untracked = 0 |
||||
ahead = 0 |
||||
behind = 0 |
||||
|
||||
_ = ?( |
||||
data = [(git --no-optional-locks status --ignore-submodules --porcelain=v2 -b 2>/dev/null)] |
||||
branch = [(splits ' ' $data[1])][2] |
||||
|
||||
if (has-prefix $data[3] '# branch.ab') { |
||||
ahead behind = (explode [(splits ' ' $data[3])][2:])[1:] |
||||
} |
||||
|
||||
for i $data { |
||||
if (or (has-prefix $i 1) (has-prefix $i 2)) { |
||||
if (eq $i[2] .) { |
||||
dirty = (+ $dirty 1) |
||||
} else { |
||||
staged = (+ $staged 1) |
||||
} |
||||
} elif (has-prefix $i '?') { |
||||
untracked = (+ $untracked 1) |
||||
} |
||||
} |
||||
) |
||||
} |
@ -0,0 +1,7 @@
@@ -0,0 +1,7 @@
|
||||
fn exported [a]{ |
||||
result = [&] |
||||
keys $a | each [x]{ |
||||
result[$x] = $a[$x] |
||||
} |
||||
put $result |
||||
} |
@ -0,0 +1,21 @@
@@ -0,0 +1,21 @@
|
||||
fn calc [@a]{ |
||||
s = [] |
||||
|
||||
for x $a { |
||||
if (eq $x '+') { |
||||
s = [(+ $@s)] |
||||
} elif (or (eq $x '*') (eq $x 'x')) { |
||||
s = [(* $@s)] |
||||
} elif (eq $x '-') { |
||||
i = (- $s[-2] $s[-1]) |
||||
s = [(put $@s | take (- (count $s) 2)) $i] |
||||
} elif (eq $x '/') { |
||||
i = (/ $s[-2] $s[-1]) |
||||
s = [(put $@s | take (- (count $s) 2)) $i] |
||||
} else { |
||||
s = [$@s $x] |
||||
} |
||||
} |
||||
|
||||
put $@s |
||||
} |
@ -0,0 +1,32 @@
@@ -0,0 +1,32 @@
|
||||
use util |
||||
|
||||
start = (date +%s) |
||||
delta = 0 |
||||
s = 0 |
||||
m = 0 |
||||
h = 0 |
||||
composed = '' |
||||
|
||||
fn pad [a]{ if (< $a 10) { put '0'$a } } |
||||
|
||||
util:add-after-readline [_]{ start = (date +%s) } |
||||
util:add-before-readline { |
||||
delta = (- (date +%s) $start) |
||||
h = 0 |
||||
m = 0 |
||||
s = $delta |
||||
if (> $delta 3600) { |
||||
s = (% $delta 60) |
||||
m = (/ (- (% $delta 3600) $s) 60) |
||||
h = (/ (- $delta (* $m 60) $s) 3600) |
||||
composed = (edit:styled ' โฑ'$h':'(util:pad $m 2 &with=0)':'(util:pad $s 2 &with=0) bold) |
||||
} elif (> $delta 60) { |
||||
s = (% $delta 60) |
||||
m = (/ (- $delta $s) 60) |
||||
composed = (edit:styled ' โฑ'$m':'(util:pad $s 2 &with=0) bold) |
||||
} elif (> $delta 5) { |
||||
composed = (edit:styled ' โฑ'$delta bold) |
||||
} else { |
||||
composed = '' |
||||
} |
||||
} |
@ -0,0 +1,66 @@
@@ -0,0 +1,66 @@
|
||||
fn abort [&code=1 a]{ |
||||
echo (styled $a red) |
||||
exit $code |
||||
} |
||||
|
||||
fn set-title [a]{ |
||||
print "\e]0;"$a"\e\\" |
||||
} |
||||
|
||||
fn merge-list [a b]{ |
||||
for c $b { a = [$@a $c] } |
||||
put $a |
||||
} |
||||
|
||||
fn merge-map [a b]{ |
||||
for k $b { a[$k] = $b[$k] } |
||||
put $a |
||||
} |
||||
|
||||
fn if-not-zero [a b]{ |
||||
if (not-eq $a 0) { $b } |
||||
} |
||||
|
||||
fn switch [a b]{ |
||||
$b[$a] |
||||
} |
||||
|
||||
fn pad [a b &with=' ' &left=$true]{ |
||||
p = (repeat (- $b (count $a)) $with | joins '') |
||||
if $left { |
||||
put $p$a |
||||
} else { |
||||
put $a$p |
||||
} |
||||
} |
||||
|
||||
fn add-before-readline [@hooks]{ |
||||
for hook $hooks { |
||||
if (not (has-value $edit:before-readline $hook)) { |
||||
edit:before-readline=[ $@edit:before-readline $hook ] |
||||
} |
||||
} |
||||
} |
||||
|
||||
fn add-after-readline [@hooks]{ |
||||
for hook $hooks { |
||||
if (not (has-value $edit:after-readline $hook)) { |
||||
edit:after-readline=[ $@edit:after-readline $hook ] |
||||
} |
||||
} |
||||
} |
||||
|
||||
fn fold [a b]{ |
||||
s = $a[0] |
||||
for i [(range 1 (count $a))] { |
||||
s = ($b $s $a[$i]) |
||||
} |
||||
put $s |
||||
} |
||||
|
||||
fn randselect [a]{ |
||||
put $a[(randint 0 (count $a))] |
||||
} |
||||
|
||||
fn to-upper-ascii [a]{ if (and (< (ord $a) 123) (> (ord $a) 96)) { chr (- (ord $a) 32) } else { put $a } } |
||||
fn to-lower-ascii [a]{ if (and (< (ord $a) 91 ) (> (ord $a) 64)) { chr (+ (ord $a) 32) } else { put $a } } |
@ -0,0 +1,29 @@
@@ -0,0 +1,29 @@
|
||||
use epm |
||||
use util |
||||
use config |
||||
use module |
||||
|
||||
fn ls [@a]{ e:exa --group-directories-first -s Name $@a } |
||||
fn xqt [a]{ e $E:XBPS_DISTDIR/srcpkgs/$a/template } |
||||
fn xr [@a]{ sudo xbps-remove -R $@a } |
||||
|
||||
-exports- = [&] |
||||
|
||||
|
||||
{ |
||||
use theme |
||||
use completers |
||||
use github.com/xiaq/edit.elv/smart-matcher |
||||
use stack |
||||
-exports- = (module:exported $stack:) |
||||
smart-matcher:apply |
||||
util:add-before-readline { |
||||
util:set-title (tilde-abbr $pwd) >/dev/tty |
||||
} |
||||
util:add-after-readline [a]{ |
||||
if (eq $a '') { print "\r" >/dev/tty; ls >/dev/tty } |
||||
util:set-title (splits ' ' $a | take 1)' '(tilde-abbr $pwd) >/dev/tty |
||||
} |
||||
} |
||||
|
||||
set-env GPG_TTY (tty) |
@ -0,0 +1,25 @@
@@ -0,0 +1,25 @@
|
||||
|
||||
|
||||
user_pref("general.warnOnAboutConfig", false); |
||||
|
||||
user_pref("browser.chrome.errorReporter.enabled", false); |
||||
|
||||
|
||||
user_pref("browser.newtabpage.activity-stream.feeds.section.highlights", false); |
||||
user_pref("browser.newtabpage.activity-stream.feeds.snippets", false); |
||||
user_pref("browser.newtabpage.activity-stream.feeds.topsites", false); |
||||
user_pref("browser.newtabpage.activity-stream.prerender", false); |
||||
user_pref("browser.newtabpage.activity-stream.showSearch", false); |
||||
|
||||
|
||||
user_pref("browser.safebrowsing.malware.enabled", false); |
||||
user_pref("browser.safebrowsing.phishing.enabled", false); |
||||
|
||||
user_pref("browser.search.suggest.enabled", false); |
||||
|
||||
|
||||
user_pref("browser.tabs.closeTabByDblclick", true); |
||||
|
||||
|
||||
user_pref("extensions.formautofill.addresses.enabled", false); |
||||
user_pref("extensions.formautofill.creditCards.enabled", false); |
@ -0,0 +1,14 @@
@@ -0,0 +1,14 @@
|
||||
#TabsToolbar { |
||||
visibility: collapse !important; |
||||
} |
||||
|
||||
#sidebar { |
||||
max-width: none !important; |
||||
min-width: 0px !important; |
||||
} |
||||
#sidebar-box + #sidebar-splitter { |
||||
display: none !important; |
||||
} |
||||
#sidebar-box #sidebar-header { |
||||
visibility: collapse; |
||||
} |
@ -0,0 +1,95 @@
@@ -0,0 +1,95 @@
|
||||
<?xml version="1.0"?> |
||||
<!DOCTYPE fontconfig SYSTEM "fonts.dtd"> |
||||
<fontconfig> |
||||
|
||||
<match target="pattern"> |
||||
<test name="family"> |
||||
<string>Times New Roman</string> |
||||
</test> |
||||
<edit name="family"> |
||||
<string>serif</string> |
||||
</edit> |
||||
</match> |
||||
|
||||
<match target="pattern"> |
||||
<test name="family"> |
||||
<string>Arial</string> |
||||
</test> |
||||
<edit name="family"> |
||||
<string>sans-serif</string> |
||||
</edit> |
||||
</match> |
||||
|
||||
<match target="pattern"> |
||||
<test name="family"> |
||||
<string>Helvetica</string> |
||||
</test> |
||||
<edit name="family"> |
||||
<string>sans-serif</string> |
||||
</edit> |
||||
</match> |
||||
|
||||
<match target="pattern"> |
||||
<test name="family"> |
||||
<string>Verdana</string> |
||||
</test> |
||||
<edit name="family"> |
||||
<string>sans-serif</string> |
||||
</edit> |
||||
</match> |
||||
|
||||
<match target="pattern"> |
||||
<test name="family"> |
||||
<string>Nimbus Sans L</string> |
||||
</test> |
||||
<edit name="family"> |
||||
<string>sans-serif</string> |
||||
</edit> |
||||
</match> |
||||
|
||||
<match target="pattern"> |
||||
<test name="family"> |
||||
<string>Lucida</string> |
||||
</test> |
||||
<edit name="family"> |
||||
<string>sans-serif</string> |
||||
</edit> |
||||
</match> |
||||
|
||||
<match target="pattern"> |
||||
<test name="family"> |
||||
<string>serif</string> |
||||
</test> |
||||
<edit name="family" mode="assign"> |
||||
<string>Liberation Serif</string> |
||||
</edit> |
||||
<edit name="hintstyle" mode="assign"> |
||||
<const>hintslight</const> |
||||
</edit> |
||||
</match> |
||||
|
||||
<match target="pattern"> |
||||
<test name="family"> |
||||
<string>sans-serif</string> |
||||
</test> |
||||
<edit name="family" mode="assign"> |
||||
<string>Liberation Sans</string> |
||||
</edit> |
||||
<edit name="hintstyle" mode="assign"> |
||||
<const>hintslight</const> |
||||
</edit> |
||||
</match> |
||||
|
||||
<match target="pattern"> |
||||
<test name="family"> |
||||
<string>monospace</string> |
||||
</test> |
||||
<edit name="family"> |
||||
<string>Iosevka SS04</string> |
||||
</edit> |
||||
<edit name="hintstyle" mode="assign"> |
||||
<const>hintslight</const> |
||||
</edit> |
||||
</match> |
||||
|
||||
</fontconfig> |
@ -0,0 +1,37 @@
@@ -0,0 +1,37 @@
|
||||
[user] |
||||
email = solitudesf@protonmail.com |
||||
name = SolitudeSF |
||||
signingkey = 789B06817C385387 |
||||
[alias] |
||||
tags = tag -l |
||||
branches = branch -a |
||||
diffdir = difftool --dir-diff |
||||
alias = !fugitive alias |
||||
changelog = !fugitive changelog |
||||
lock = !fugitive lock |
||||
mirror = !fugitive mirror |
||||
open = !fugitive open |
||||
release = !fugitive release |
||||
scrap = !fugitive scrap |
||||
summary = !fugitive summary |
||||
undo = !fugitive undo |
||||
unlock = !fugitive unlock |
||||
unstage = !fugitive unstage |
||||
profile = !fugitive profile |
||||
get = !fugitive mirror |
||||
[commit] |
||||
gpgsign = true |
||||
[gpg] |
||||
program = gpg2 |
||||
[credential] |
||||
helper = store |
||||
[diff] |
||||
tool = kitty |
||||
guitool = kitty.gui |
||||
[difftool] |
||||
prompt = false |
||||
trustExitCode = true |
||||
[difftool "kitty"] |
||||
cmd = kitty +kitten diff $LOCAL $REMOTE |
||||
[difftool "kitty.gui"] |
||||
cmd = kitty kitty +kitten diff $LOCAL $REMOTE |
@ -0,0 +1,184 @@
@@ -0,0 +1,184 @@
|
||||
# Merge and manually source plugins |
||||
eval %sh{ |
||||
cat $(find "$kak_config/autosource" -name '*\.kak') >/tmp/kakmerge.kak |
||||
printf %s 'source /tmp/kakmerge.kak' |
||||
} |
||||
|
||||
# Initialization |
||||
decl -hidden regex curword |
||||
|
||||
set global ui_options ncurses_assistant=none |
||||
set global scrolloff 7,7 |
||||
set global autoreload yes |
||||
set global kitty_window_type os |
||||
set global termcmd 'kitty -1 sh -c' |
||||
set global grepcmd 'rg -iHL --column' |
||||
set global filetree_find_cmd 'fd -L -t f -d 2' |
||||
set global modelinefmt '%opt{modeline_git_branch} %val{bufname} |
||||
%val{cursor_line}:%val{cursor_char_column} {{mode_info}} {{context_info}} |
||||
โ%val{client}โ%val{session}โธ' |
||||
|
||||
unalias global e edit |
||||
alias global e edit-or-dir |
||||
|
||||
face global LineNumbersWrapped black |
||||
|
||||
addhl global/ number-lines -hlcursor -separator ' ' |
||||
addhl global/ column 80 default,rgb:303030 |
||||
addhl global/ regex '\h+$' 0:default,red |
||||
addhl global/ regex \b(TODO|FIXME|XXX|NOTE)\b 0:default+rb |
||||
addhl global/ show-matching |
||||
addhl global/ wrap -word -indent -marker โช |
||||
addhl global/ dynregex '%reg{/}' 0:+u |
||||
addhl global/ dynregex '%opt{curword}' 0:+b |
||||
|
||||
# Keybinds |
||||
map global normal <space> , |
||||
map global normal -docstring 'remove all sels except main' <backspace> <space> |
||||
map global normal -docstring 'remove main sel' <a-backspace> <a-space> |
||||
map global normal -docstring 'comment line' '#' :comment-line<ret> |
||||
map global normal -docstring 'comment block' '<a-#>' :comment-block<ret> |
||||
map global normal -docstring 'delete to end of line' D <a-l>d |
||||
map global normal -docstring 'yank to end of line' Y <a-l>y |
||||
|
||||
map global user -docstring "add phantom selection" f :phantom-sel-add-selection<ret> |
||||
map global user -docstring "clear all phantom selections" <a-f> :phantom-sel-select-all<ret>:phantom-sel-clear<ret> |
||||
map global user -docstring "next phantom selection" F :phantom-sel-iterate-next<ret> |
||||
map global user -docstring "previous phantom selection" <a-F> :phantom-sel-iterate-prev<ret> |
||||
|
||||
map global user -docstring "filetree" t :filetree<ret> |
||||
map global user -docstring 'buffers' <ret> :rofi-buffers<ret> |
||||
|
||||
map global normal -docstring 'select view' <a-%> ':select-view<ret>' |
||||
map global view -docstring 'select view' s '<esc>:select-view<ret>' |
||||
|
||||
map global user -docstring "add mark" m :mark-word<ret> |
||||
map global user -docstring "clear marks" M :mark-clear<ret> |
||||
|
||||
map global user -docstring "expand selection" e :expand<ret> |
||||
map global user -docstring "expand repeat" E :expand-repeat<ret> |
||||
|
||||
map global normal <c-p> ':yank-ring-previous<ret>' |
||||
map global normal <c-n> ':yank-ring-next<ret>' |
||||
map global normal Y ':yank-ring-open<ret>' |
||||
|
||||
declare-user-mode surround |
||||
map global user -docstring "surround mode" s ':enter-user-mode surround<ret>' |
||||
map global surround -docstring 'surround' s ':surround<ret>' |
||||
map global surround -docstring 'change' c ':change-surround<ret>' |
||||
map global surround -docstring 'delete' d ':delete-surround<ret>' |
||||
map global surround -docstring 'select tag' t ':select-surrounding-tag<ret>' |
||||
map global surround -docstring 'auto-pairs surround' a ':auto-pairs-surround<ret>' |
||||
|
||||
declare-user-mode anchor |
||||
map global normal ';' ':enter-user-mode anchor<ret>' |
||||
map global anchor -docstring 'reduce to anchor' a '<a-;>;' |
||||
map global anchor -docstring 'reduce to cursor' c ';' |
||||
map global anchor -docstring 'flip cursor and anchor' f '<a-;>' |
||||
map global anchor -docstring 'ensure anchor after cursor' h '<a-:><a-;>' |
||||
map global anchor -docstring 'ensure cursor after anchor' l '<a-:>' |
||||
map global anchor -docstring 'select cursor and anchor' s '<a-S>' |
||||
|
||||
map global user -docstring "clip-paste after" p '<a-!>xsel -b -o<ret>' |
||||
map global user -docstring "clip-paste before" P '!xsel -b -o<ret>' |
||||
map global user -docstring "clip-paste replace" R '|xsel -b -o<ret>' |
||||
map global user -docstring "clip-yank" y '<a-|>xclip -i -f -sel c<ret>' |
||||
|
||||
map global user -docstring "next error" l :lint-next-error<ret> |
||||
map global user -docstring "previous error" L :lint-previous-error<ret> |
||||
|
||||
# Functions |
||||
def toggle-highlighter -params .. -docstring 'Toggle highlighter' %{ |
||||
try %{ |
||||
addhl window/%arg{@} %arg{@} |
||||
echo -markup {green} %arg{@} |
||||
} catch %{ |
||||
rmhl window/%arg{@} |
||||
echo -markup {red} %arg{@} |
||||
} |
||||
} |
||||
|
||||
def lint-on-write -docstring 'Activate linting on buffer write' %{ |
||||
lint-enable |
||||
hook buffer BufWritePost .* %{ lint } |
||||
} |
||||
|
||||
def rofi-buffers -docstring 'Select an open buffer using Rofi' %{ eval %sh{ |
||||
BUF=$(eval set -- "$kak_buflist"; for i; do echo "$i"; done\ |
||||
| rofi -dmenu -no-custom -p 'Select buffer: ') |
||||
[ -n "$BUF" ] && echo buffer "$BUF" |
||||
} } |
||||
|
||||
def no-tabs -params 0..1 -docstring 'Indent with spaces' %{ |
||||
eval %sh{ [ -n "$1" ] && printf %s " |
||||
set buffer indentwidth $1 |
||||
set buffer tabstop $1 |
||||
set buffer softtabstop $1 |
||||
" } |
||||
exec :expandtab<ret> |
||||
hook buffer InsertKey <space> %{ try %{ |
||||
exec -draft h<a-i><space><a-k>^\h+<ret> |
||||
exec -with-hooks <tab> |
||||
} } |
||||
} |
||||
|
||||
def clean-trailing-whitespace -docstring 'Remove trailing whitespace' %{ |
||||
try %{ exec -draft '%s\h+$<ret>d' } |
||||
} |
||||
|
||||
# Hooks |
||||
hook global WinCreate ^[^*]+$ %{ |
||||
auto-pairs-enable |
||||
} |
||||
|
||||
hook global BufOpenFile .* %{ |
||||
change-directory-current-buffer |
||||
} |
||||
|
||||
hook global NormalIdle .* %{ |
||||
try %{ exec -draft '<a-i>w:palette-status<ret>' } |
||||
} |
||||
|
||||
hook global BufWritePre .* %{ nop %sh{ |
||||
mkdir -p "$(dirname "$kak_buffile")" |
||||
}} |
||||
|
||||
hook global BufWritePost .* %{ git show-diff } |
||||
hook global BufReload .* %{ git show-diff } |
||||
|
||||
hook global NormalIdle .* %{ |
||||
eval -draft %{ try %{ |
||||
exec <space><a-i>w <a-k>\A\w+\z<ret> |
||||
set buffer curword "\b\Q%val{selection}\E\b" |
||||
} catch %{ |
||||
set buffer curword '' |
||||
} } |
||||
} |
||||
|
||||
# Filetype detection |
||||
hook global BufCreate .*srcpkgs/.+/template$ %{ |
||||
set buffer filetype sh |
||||
def xgensum %{ %sh{ xgensum -i "$kak_buffile" } } |
||||
} |
||||
|
||||
hook global BufCreate .*/\.?((sx|xinit)(rc)?|profile) %{ set buffer filetype sh } |
||||
hook global BufCreate .*\.ino %{ set buffer filetype cpp } |
||||
hook global BufCreate .*\.cs %{ addhl window/java } |
||||
|
||||
# Filetype settings |
||||
hook global WinSetOption filetype=sh %{ |
||||
set buffer lintcmd 'shellcheck -x -fgcc' |
||||
lint-on-write |
||||
} |
||||
|
||||
hook global WinSetOption filetype=elvish %{ |
||||
no-tabs 2 |
||||
} |
||||
|
||||
hook global WinSetOption filetype=nim %{ |
||||
set buffer gdb_program 'nim-gdb' |
||||
no-tabs 2 |
||||
# set buffer lintcmd "sh -c 'cp -f $0 $0.nim;nim --stdout --colors:off --hints:off --path:$(dirname ${kak_buffile}) check $0 | sed \"s/(/:/;s/, /:/;s/)/:/\" | sed \":a;N;/\n[buf.nim]/!s/\n//;ta;P;D\"'" |
||||
# set buffer lintcmd "sh -c 'nim --stdout --hints:off check $0 | sed \'s/(/:/;s/, /:/;s/)/:/\''" |
||||
# lint-on-write |
||||
} |
@ -0,0 +1 @@
@@ -0,0 +1 @@
|
||||
/home/solitude/dot/ntr/templates/kitty-colors |
@ -0,0 +1,51 @@
@@ -0,0 +1,51 @@
|
||||
syntax_aliases pyj:py recipe:py |
||||
pygments_style default |
||||
num_context_lines 3 |
||||
diff_cmd auto |
||||
replace_tab_by \x20\x20\x20\x20 |
||||
|
||||
foreground black |
||||
background white |
||||
title_fg black |
||||
title_bg white |
||||
margin_bg #fafbfc |
||||
margin_fg #aaaaaa |
||||
removed_bg #ffeef0 |
||||
highlight_removed_bg #fdb8c0 |
||||
removed_margin_bg #ffdce0 |
||||
added_bg #e6ffed |
||||
highlight_added_bg #acf2bd |
||||
added_margin_bg #cdffd8 |
||||
filler_bg #fafbfc |
||||
hunk_margin_bg #dbedff |
||||
hunk_bg #f1f8ff |
||||
search_bg #444 |
||||
search_fg white |
||||
select_bg #B4D5FE |
||||
select_fg black |
||||
|
||||
map q quit |
||||
map esc quit |
||||
map j scroll_by 1 |
||||
map k scroll_by -1 |
||||
map down scroll_by 1 |
||||
map up scroll_by -1 |
||||
map home scroll_to start |
||||
map end scroll_to end |
||||
map page_down scroll_to next-page |
||||
map page_up scroll_to prev-page |
||||
map space scroll_to next-page |
||||
map n scroll_to next-change |
||||
map p scroll_to prev-change |
||||
map a change_context all |
||||
map = change_context default |
||||
map + change_context 5 |
||||
map - change_context -5 |
||||
map / start_search regex forward |
||||
map ? start_search regex backward |
||||
map . scroll_to next-match |
||||
map , scroll_to prev-match |
||||
map > scroll_to next-match |
||||
map < scroll_to prev-match |
||||
map f start_search substring forward |
||||
map b start_search substring backward |
@ -0,0 +1,220 @@
@@ -0,0 +1,220 @@
|
||||
include colors.conf |
||||
|
||||
font_family Iosevka Term SS04 |
||||
italic_font Iosevka Term SS04 Oblique |
||||
bold_font Iosevka Term SS04 Bold |
||||
bold_italic_font Iosevka Term SS04 Bold Oblique |
||||
font_size 12.0 |
||||
|
||||
adjust_line_height 0 |
||||
adjust_column_width 0 |
||||
box_drawing_scale 0.001, 1, 1.5, 2 |
||||
|
||||
cursor_blink_interval 0.5 |
||||
cursor_stop_blinking_after 15.0 |
||||
|
||||
scrollback_lines 2000 |
||||
scrollback_pager_history_size 10 |
||||
scrollback_pager less --chop-long-lines -R +INPUT_LINE_NUMBER |
||||
|
||||
wheel_scroll_multiplier 5.0 |
||||
click_interval 0.5 |
||||
|
||||
select_by_word_characters :@-./_~?&=%+# |
||||
|
||||
shell elvish |
||||
editor kak |
||||
|
||||
mouse_hide_wait 0 |
||||
focus_follows_mouse yes |
||||
|
||||
enabled_layouts * |
||||
|
||||
# 'c' suffix for cells instead of pixels |
||||
remember_window_size no |
||||
initial_window_width 640 |
||||
initial_window_height 400 |
||||
hide_window_decorations no |
||||
|
||||
repaint_delay 15 |
||||
input_delay 3 |
||||
sync_to_monitor no |
||||
|
||||
visual_bell_duration 0.0 |
||||
enable_audio_bell yes |
||||
window_alert_on_bell yes |
||||
bell_on_tab yes |
||||
|
||||
open_url_modifiers kitty_mod |
||||
open_url_with default |
||||
|
||||
rectangle_select_modifiers ctrl+alt |
||||
|
||||
close_on_child_death no |
||||
copy_on_select no |
||||
allow_remote_control yes |
||||
startup_session none |
||||
clipboard_control write-clipboard write-primary read-clipboard read-primary |
||||
term xterm-kitty |
||||
|
||||
window_border_width 1 |
||||
window_margin_width 0 |
||||
window_padding_width 0 |
||||
|
||||
inactive_text_alpha 1.0 |
||||
|
||||
tab_bar_edge bottom |
||||
tab_bar_margin_width 0 |
||||
# fade | separator |
||||
tab_bar_style separator |
||||
tab_fade 0.15 0.3 0.45 0.8 |
||||
tab_separator " โ" |
||||
|
||||
active_tab_font_style bold-italic |
||||
inactive_tab_font_style normal |
||||
|
||||
url_style double |
||||
|
||||
background_opacity 1.0 |
||||
dynamic_background_opacity no |
||||
dim_opacity 0.75 |
||||
|
||||
cursor_shape beam |
||||
|
||||
# Key mapping |
||||
# http://www.glfw.org/docs/latest/group__keys.html |
||||
# http://www.glfw.org/docs/latest/group__mods.html |
||||
# The name to use is the part after the `GLFW_KEY_` prefix. |
||||
# |
||||
# https://github.com/xkbcommon/libxkbcommon/blob/master/xkbcommon/xkbcommon-keysyms.h |
||||
# The name to use is the part after the `XKB_KEY_` prefix |
||||
|
||||
# + - chord |
||||
# > - sequence |
||||
# no_op - unbind |
||||
# map key combine <separator> action1 <separator> action2 <separator> action3 ... |
||||
kitty_mod ctrl+shift |
||||
|
||||
map ctrl+shift+delete clear_terminal reset active |
||||
map kitty_mod+f9 clear_terminal reset active |
||||
map kitty_mod+f10 clear_terminal clear active |
||||
map kitty_mod+f11 clear_terminal scrollback active |
||||
|
||||
# Clipboard |
||||
map kitty_mod+c copy_to_clipboard |
||||
map kitty_mod+v paste_from_clipboard |
||||
map shift+insert paste_from_selection |
||||
# You can also pass the contents of the current selection to any program using |
||||
# pass_selection_to_program. By default, the system's open program is used, but |
||||
# you can specify your own, for example: |
||||
# map kitty_mod+o pass_selection_to_program firefox |
||||
|
||||
# Scrolling |
||||
map kitty_mod+up scroll_line_up |
||||
map kitty_mod+down scroll_line_down |
||||
map kitty_mod+k scroll_line_up |
||||
map kitty_mod+j scroll_line_down |
||||
map kitty_mod+page_up scroll_page_up |
||||
map kitty_mod+page_down scroll_page_down |
||||
map kitty_mod+home scroll_home |
||||
map kitty_mod+end scroll_end |
||||
map kitty_mod+h show_scrollback |
||||
|
||||
# Window management |
||||
map kitty_mod+enter new_window |
||||
map kitty_mod+w close_window |
||||
map kitty_mod+] next_window |
||||
map kitty_mod+[ previous_window |
||||
map kitty_mod+f move_window_forward |
||||
map kitty_mod+b move_window_backward |
||||
map kitty_mod+` move_window_to_top |
||||
map kitty_mod+1 first_window |
||||
map kitty_mod+2 second_window |
||||
map kitty_mod+3 third_window |
||||
map kitty_mod+4 fourth_window |
||||
map kitty_mod+5 fifth_window |
||||
map kitty_mod+6 sixth_window |
||||
map kitty_mod+7 seventh_window |
||||
map kitty_mod+8 eighth_window |
||||
map kitty_mod+9 ninth_window |
||||
map kitty_mod+0 tenth_window |
||||
|
||||
# Tab management |
||||
map kitty_mod+right next_tab |
||||
map kitty_mod+left previous_tab |
||||
map kitty_mod+t new_tab |
||||
map kitty_mod+q close_tab |
||||
map kitty_mod+l next_layout |
||||
map kitty_mod+. move_tab_forward |
||||
map kitty_mod+, move_tab_backward |
||||
# You can also create shortcuts to go to specific tabs, with 1 being the first tab |
||||
# map ctrl+alt+1 goto_tab 1 |
||||
# map ctrl+alt+2 goto_tab 2 |
||||
|
||||
# Layout management |
||||
# You can create shortcuts to switch to specific layouts |
||||
# map ctrl+alt+1 goto_layout tall |
||||
# map ctrl+alt+2 goto_layout stack |
||||
|
||||
# Font sizes |
||||
# all | current |
||||
map kitty_mod+equal change_font_size all +2.0 |
||||
map kitty_mod+minus change_font_size all -2.0 |
||||
map kitty_mod+backspace change_font_size all 0 |
||||
# map kitty_mod+f6 change_font_size all 10.0 |
||||
# map kitty_mod+f6 change_font_size current 10.0 |
||||
|
||||
# Kittens |
||||
# Open a currently visible URL using the keyboard. The program used to open the |
||||
# URL is specified in open_url_with. |
||||
map kitty_mod+e kitten hints |
||||
# Select a path/filename and insert it into the terminal. Useful, for instance to |
||||
# run git commands on a filename output from a previous git command. |
||||
map kitty_mod+p>f kitten hints --type path --program - |
||||
# Select a path/filename and open it with the default open program. |
||||
map kitty_mod+p>shift+f kitten hints --type path |
||||
# Select a line of text and insert it into the terminal. Use for the |
||||
# output of things like: ls -1 |
||||
map kitty_mod+p>l kitten hints --type line --program - |
||||
# Select words and insert into terminal. |
||||
map kitty_mod+p>w kitten hints --type word --program - |
||||
|
||||
map kitty_mod+f11 toggle_fullscreen |
||||
map kitty_mod+u input_unicode_character |
||||
# Open the kitty shell in a new window/tab/overlay/os_window to control kitty using commands. |
||||
map kitty_mod+f2 edit_config_file |
||||
map kitty_mod+escape kitty_shell overlay |
||||
map kitty_mod+a>m set_background_opacity +0.1 |
||||
map kitty_mod+a>l set_background_opacity -0.1 |
||||
map kitty_mod+a>1 set_background_opacity 1 |
||||
map kitty_mod+a>d set_background_opacity default |
||||
|
||||
# Launching and data passing |
||||
# source: @selection @text @ansi @{,ansi_}{screen,alternate} none |
||||
# target: os_window window tab overlay none |
||||
# new_{window,tab,os_window}{,_with_cwd} $program? $source? |
||||
# pipe $source $target $program |
||||
map f1 pipe @ansi_alternate overlay less +g -R |
||||
# map f2 pipe @selection overlay less +g -R |
||||
map ctrl+alt+enter new_os_window_with_cwd |
||||
map ctrl+g new_tab_with_cwd tig |
||||
|
||||
# Sending arbitrary text on shortcut key presses |
||||
# You can tell kitty to send arbitrary (UTF-8) encoded text to |
||||
# the client program when pressing specified shortcut keys. For example: |
||||
# map ctrl+alt+a send_text all Special text |
||||
# This will send "Special text" when you press the Ctrl+Alt+a key combination. |
||||
# The text to be sent is a python string literal so you can use escapes like |
||||
# \x1b to send control codes or \u21fb to send unicode characters (or you can |
||||
# just input the unicode characters directly as UTF-8 text). The first argument |
||||
# to send_text is the keyboard modes in which to activate the shortcut. The possible |
||||
# values are normal or application or kitty or a comma separated combination of them. |
||||
|