2020-01-23 14:25:42 +00:00
|
|
|
# Basic Settings
|
|
|
|
set shell zsh
|
|
|
|
set shellopts '-eu:--shwordsplit'
|
|
|
|
set ifs "\n"
|
|
|
|
set scrolloff 5
|
|
|
|
set wrapscroll
|
|
|
|
set sortby time
|
|
|
|
set info size:time
|
|
|
|
set reverse
|
|
|
|
set incsearch
|
2020-04-14 04:07:37 +00:00
|
|
|
set period 1
|
2020-01-23 14:25:42 +00:00
|
|
|
set color256
|
2020-05-05 22:22:57 +00:00
|
|
|
set preview
|
|
|
|
set previewer lfview
|
2020-04-06 17:07:13 +00:00
|
|
|
# All other settings need to go above this comment because reasons
|
2020-02-29 07:00:08 +00:00
|
|
|
set icons
|
2020-01-23 14:25:42 +00:00
|
|
|
|
|
|
|
%{{
|
|
|
|
w=$(tput cols)
|
|
|
|
if [ $w -le 80 ]; then
|
2020-03-29 19:16:35 +00:00
|
|
|
lf -remote "send $id set ratios 1:1"
|
2020-01-23 14:25:42 +00:00
|
|
|
elif [ $w -le 160 ]; then
|
2020-06-03 14:23:45 +00:00
|
|
|
lf -remote "send $id set ratios 2:2"
|
2020-01-23 14:25:42 +00:00
|
|
|
else
|
2020-06-03 14:23:45 +00:00
|
|
|
lf -remote "send $id set ratios 2:4"
|
2020-01-23 14:25:42 +00:00
|
|
|
fi
|
|
|
|
}}
|
|
|
|
|
|
|
|
# Custom Functions
|
|
|
|
cmd open ${{
|
2020-05-05 22:22:57 +00:00
|
|
|
case $(file --mime-type $f -bL) in
|
2020-06-18 01:38:39 +00:00
|
|
|
text/*|application/json) vix "$f";;
|
2020-05-05 22:22:57 +00:00
|
|
|
image/gif) setsid sxiv-gif $f 2>/dev/null & ;;
|
2020-06-18 01:38:39 +00:00
|
|
|
image/*) setsid sxiv-rifle $f 2>/dev/null & ;;
|
|
|
|
audio/*) mpv $f ;;
|
|
|
|
video/*) setsid mpv $f -quiet >/dev/null 2>&1 & ;;
|
2020-06-23 18:03:54 +00:00
|
|
|
font/ttf) fp -i $f -o /tmp/fontpreview.png & ;;
|
2020-06-18 01:38:39 +00:00
|
|
|
application/x-7z-compressed|application/gz|application/rar|application/tar) atool --list --each -- "$f" | $PAGER ;;
|
|
|
|
application/tar|application/tgz|application/xz|application/zip) atool --list --each -- "$f" | $PAGER ;;
|
|
|
|
application/pdf|application/cbz|application/cbr|application/epub*) setsid zathura $fx >/dev/null 2>&1 & ;;
|
2020-05-05 22:22:57 +00:00
|
|
|
*) for f in $fx; do setsid $OPENER $f > /dev/null 2>&1 & done;;
|
2020-01-23 14:25:42 +00:00
|
|
|
esac
|
|
|
|
}}
|
|
|
|
|
|
|
|
cmd bulkrename ${{
|
2020-06-23 18:03:54 +00:00
|
|
|
old=$(mktemp)
|
|
|
|
new=$(mktemp)
|
|
|
|
[ -n $fs ] && fs=$(ls)
|
|
|
|
printf "$fs\n" > $old
|
|
|
|
printf "$fs\n" > $new
|
|
|
|
$EDITOR $new
|
|
|
|
[ $(cat $new | wc -l) -ne $(cat $old | wc -l) ] && exit
|
|
|
|
paste $old $new | while read names; do
|
|
|
|
src=$(printf $names | cut -f1)
|
|
|
|
dst=$(printf $names | cut -f2)
|
|
|
|
[ $src = $dst ] && continue
|
|
|
|
[ -e $dst ] && continue
|
|
|
|
mv $src $dst
|
|
|
|
done
|
|
|
|
rm $old $new
|
|
|
|
lf -remote "send $id unselect"
|
2020-01-23 14:25:42 +00:00
|
|
|
}}
|
|
|
|
|
2020-03-29 19:16:35 +00:00
|
|
|
# insert
|
|
|
|
cmd rename-insert &{{
|
2020-06-23 18:03:54 +00:00
|
|
|
if [ "$(echo "$fx" | wc -l)" -gt 1 ]; then
|
|
|
|
lf -remote "send $id echo You can't change more than one file name"
|
|
|
|
lf -remote "send $id unselect"
|
|
|
|
else
|
|
|
|
len="$(basename "$f" | wc -m)" # length of selected file/directory
|
|
|
|
for i in $(seq "$len"); do
|
|
|
|
pos="${pos}<left>" # how many times do I have to press <left> in order to get first char
|
|
|
|
done
|
|
|
|
lf -remote "send $id rename"
|
|
|
|
lf -remote "send $id push $pos"
|
|
|
|
fi
|
2020-01-23 14:25:42 +00:00
|
|
|
}}
|
|
|
|
|
2020-03-29 19:16:35 +00:00
|
|
|
# append before ext
|
|
|
|
cmd rename-before-ext &{{
|
2020-06-23 18:03:54 +00:00
|
|
|
if [ "$(echo "$fx" | wc -l)" -gt 1 ]; then
|
|
|
|
lf -remote "send $id echo You can't change more than one file name"
|
|
|
|
lf -remote "send $id unselect"
|
|
|
|
else
|
|
|
|
if [ -d "$f" ]; then
|
|
|
|
lf -remote "send $id rename"
|
|
|
|
else
|
|
|
|
ext_len="$(echo ${f##*.} | wc -m)" # extention length
|
|
|
|
for i in $(seq "$ext_len"); do
|
|
|
|
pos="${pos}<left>"
|
|
|
|
done
|
|
|
|
lf -remote "send $id rename"
|
|
|
|
lf -remote "send $id push "$pos""
|
|
|
|
fi
|
|
|
|
fi
|
2020-01-23 14:25:42 +00:00
|
|
|
}}
|
|
|
|
|
2020-03-29 19:16:35 +00:00
|
|
|
# change its name entirely
|
|
|
|
cmd rename-new &{{
|
2020-06-23 18:03:54 +00:00
|
|
|
if [ "$(echo "$fx" | wc -l)" -gt 1 ]; then
|
|
|
|
lf -remote "send $id echo You can't change more than one file name"
|
|
|
|
lf -remote "send $id unselect"
|
|
|
|
else
|
|
|
|
lf -remote "send $id rename"
|
|
|
|
lf -remote "send $id push <c-u>"
|
|
|
|
fi
|
2020-01-23 14:25:42 +00:00
|
|
|
}}
|
|
|
|
|
2020-04-01 15:47:43 +00:00
|
|
|
cmd paste-rsync &{{
|
2020-06-23 18:03:54 +00:00
|
|
|
load=$(lf -remote 'load')
|
|
|
|
mode=$(echo "$load" | sed -n '1p')
|
|
|
|
list=$(echo "$load" | sed '1d')
|
2020-02-29 07:00:08 +00:00
|
|
|
|
2020-06-23 18:03:54 +00:00
|
|
|
if [ $mode = 'copy']; then
|
|
|
|
rsync -av --ignore-existing --progress $list . \
|
|
|
|
| stdbuf -i0 -o0 -e0 tr '\r' '\n' \
|
|
|
|
| while read line; do
|
|
|
|
lf -remote "send $id echo $line"
|
|
|
|
done
|
|
|
|
elif [ $mode = 'move' ]; then
|
|
|
|
mv -n $list .
|
|
|
|
fi
|
2020-02-29 07:00:08 +00:00
|
|
|
|
2020-06-23 18:03:54 +00:00
|
|
|
lf -remote 'send load'
|
|
|
|
lf -remote 'send clear'
|
2020-02-29 07:00:08 +00:00
|
|
|
}}
|
|
|
|
|
2020-04-01 15:47:43 +00:00
|
|
|
cmd paste-append &{{
|
2020-06-23 18:03:54 +00:00
|
|
|
load=$(lf -remote 'load')
|
|
|
|
mode=$(echo "$load" | sed -n '1p')
|
|
|
|
list=$(echo "$load" | sed '1d')
|
|
|
|
if [ $mode = 'copy' ]; then
|
|
|
|
cp -rn $list .
|
|
|
|
elif [ $mode = 'move' ]; then
|
|
|
|
mv -n $list .
|
|
|
|
fi
|
|
|
|
lf -remote 'send load'
|
|
|
|
lf -remote 'send clear'
|
2020-03-29 19:16:35 +00:00
|
|
|
}}
|
|
|
|
|
2020-04-01 15:47:43 +00:00
|
|
|
cmd paste-overwrite %{{
|
2020-06-23 18:03:54 +00:00
|
|
|
load=$(lf -remote 'load')
|
|
|
|
mode=$(echo "$load" | sed -n '1p')
|
|
|
|
list=$(echo "$load" | sed '1d')
|
|
|
|
if [ $mode = 'copy' ]; then
|
|
|
|
cp -r $list .
|
|
|
|
elif [ $mode = 'move' ]; then
|
|
|
|
mv $list .
|
|
|
|
fi
|
|
|
|
lf -remote 'send load'
|
|
|
|
lf -remote 'send clear'
|
2020-04-01 15:47:43 +00:00
|
|
|
}}
|
2020-03-29 19:16:35 +00:00
|
|
|
|
2020-04-01 15:47:43 +00:00
|
|
|
cmd paste-interactive %{{
|
2020-06-23 18:03:54 +00:00
|
|
|
load=$(lf -remote 'load')
|
|
|
|
mode=$(echo "$load" | sed -n '1p')
|
|
|
|
list=$(echo "$load" | sed '1d')
|
|
|
|
if [ $mode = 'copy' ]; then
|
|
|
|
cp -r $list .
|
|
|
|
elif [ $mode = 'move' ]; then
|
|
|
|
mv $list .
|
|
|
|
fi
|
|
|
|
lf -remote 'send load'
|
|
|
|
lf -remote 'send clear'
|
2020-02-29 07:00:08 +00:00
|
|
|
}}
|
|
|
|
|
|
|
|
cmd fzf_jump ${{
|
2020-06-23 18:03:54 +00:00
|
|
|
res="$(find . -maxdepth 3 -printf '%P\n' | fzf --reverse --header='Jump to location')"
|
|
|
|
if [ -f "$res" ]; then
|
|
|
|
cmd="select"
|
|
|
|
elif [ -d "$res" ]; then
|
|
|
|
cmd="cd"
|
|
|
|
fi
|
2020-02-29 07:00:08 +00:00
|
|
|
|
2020-06-23 18:03:54 +00:00
|
|
|
lf -remote "send $id $cmd \"$res\""
|
2020-03-29 19:16:35 +00:00
|
|
|
}}
|
|
|
|
|
|
|
|
cmd Link %{{
|
2020-06-23 18:03:54 +00:00
|
|
|
lf -remote 'load' | while read file; do
|
|
|
|
if [ ! -n "${mode+1}" ]; then
|
|
|
|
mode="$file"
|
|
|
|
continue
|
|
|
|
fi
|
|
|
|
files+=("$file")
|
|
|
|
done
|
|
|
|
if [ "${#files[@]}" -le 1 ]; then
|
|
|
|
lf -remote "send $id echo no files to link"
|
|
|
|
exit 0
|
|
|
|
fi
|
|
|
|
# symbolicly copy mode is indicating a soft link
|
|
|
|
if [[ "$mode" == copy ]]; then
|
|
|
|
ln -sr $files -t .
|
|
|
|
# while a move mode is indicating a hard link
|
|
|
|
elif [[ "$mode" == move ]]; then
|
|
|
|
ln $files -t .
|
|
|
|
fi
|
2020-03-29 19:16:35 +00:00
|
|
|
}}
|
|
|
|
|
2020-04-28 18:34:58 +00:00
|
|
|
# toggle single column view
|
|
|
|
cmd no_preview :{{
|
2020-06-23 18:03:54 +00:00
|
|
|
set nopreview
|
|
|
|
set ratios 2
|
|
|
|
set info size:time
|
|
|
|
map ~ yes_preview
|
2020-04-28 18:34:58 +00:00
|
|
|
}}
|
2020-06-23 18:03:54 +00:00
|
|
|
|
2020-04-28 18:34:58 +00:00
|
|
|
cmd yes_preview :{{
|
2020-06-23 18:03:54 +00:00
|
|
|
set ratios 2:2
|
|
|
|
set preview
|
|
|
|
set info
|
|
|
|
map ~ no_preview
|
2020-04-01 15:47:43 +00:00
|
|
|
}}
|
|
|
|
|
2020-06-23 18:03:54 +00:00
|
|
|
cmd newfold ${{
|
|
|
|
set -f
|
|
|
|
read newd
|
|
|
|
mkdir $newd
|
|
|
|
mv $fx $newd
|
2020-01-23 14:25:42 +00:00
|
|
|
}}
|
|
|
|
|
|
|
|
# Bindings
|
|
|
|
# Remove some defaults
|
|
|
|
map "'"
|
|
|
|
map '"'
|
2020-04-01 15:47:43 +00:00
|
|
|
map m
|
|
|
|
map n
|
2020-02-29 07:00:08 +00:00
|
|
|
map d
|
|
|
|
map p
|
|
|
|
map w
|
|
|
|
map y
|
|
|
|
map c
|
|
|
|
map /
|
2020-04-01 15:47:43 +00:00
|
|
|
map r
|
2020-01-23 14:25:42 +00:00
|
|
|
|
2020-02-29 07:00:08 +00:00
|
|
|
cmap <esc> cmd-escape
|
|
|
|
|
2020-04-18 15:59:02 +00:00
|
|
|
map <f-2> push A<c-u> # new rename
|
2020-01-23 14:25:42 +00:00
|
|
|
map <f-3> cut
|
|
|
|
map <f-4> copy
|
|
|
|
map <f-5> reload
|
|
|
|
map <f-6> push $touch<space>
|
|
|
|
map <f-7> push $mkdir<space>
|
|
|
|
map <f-8> delete
|
|
|
|
map <f-9> paste
|
|
|
|
|
|
|
|
map <enter> open
|
|
|
|
map <delete> delete
|
2020-04-01 15:47:43 +00:00
|
|
|
map . set hidden!
|
2020-04-28 18:34:58 +00:00
|
|
|
map ~ no_preview
|
2020-04-01 15:47:43 +00:00
|
|
|
map | top
|
|
|
|
map ¿ bottom
|
|
|
|
map R reload
|
|
|
|
map x clear
|
2020-02-29 07:00:08 +00:00
|
|
|
map dd cut
|
2020-04-01 15:47:43 +00:00
|
|
|
map yy copy
|
|
|
|
map yn ${{echo -n $(dirname $f) | xclip -selection clipboard}}
|
|
|
|
map yp ${{echo -n $f | xclip -selection clipboard}}
|
|
|
|
map yn ${{echo -n $(basename $f) | xclip -selection clipboard}}
|
2020-02-29 07:00:08 +00:00
|
|
|
map pp paste
|
2020-04-01 15:47:43 +00:00
|
|
|
map pa paste-append
|
|
|
|
map po paste-overwrite
|
|
|
|
map pi paste-interactive
|
2020-02-29 07:00:08 +00:00
|
|
|
map pr paste-rsync
|
2020-05-05 22:22:57 +00:00
|
|
|
map o &mimeopen $f
|
|
|
|
map O $mimeopen --ask $f
|
|
|
|
map cx $chmod +x "$f"
|
2020-04-01 15:47:43 +00:00
|
|
|
map bg $setbg $f
|
2020-10-12 22:44:04 +00:00
|
|
|
map du %du -sh $f
|
2020-04-01 15:47:43 +00:00
|
|
|
map Y %cp -ri $fs .
|
|
|
|
map D %mv -i $fs .
|
2020-06-23 18:03:54 +00:00
|
|
|
map za $apack "$f".zip $f
|
2020-08-04 15:10:09 +00:00
|
|
|
map zu $file-roller "$f"
|
|
|
|
map zx $atool --each --extract "$f"
|
2020-09-25 17:25:56 +00:00
|
|
|
map zg $hx add $fs
|
Chicos, Medianos, y Grandes
Empezando por los grandes. portee mis scripts de dmenu a rofi ya que
este ultimo ha alcanzado un grado de madurez que considero
satisfactoria. Seguramente haga falta ajustar algunos detalles pero eso
lo ire viendo con el uso.
En cuanto a medianos, afilar el hacha es una ocupacion constante, ojala
me pagaran por eso (creo que ya puse eso en un commit una vez...). Asi
que agregue cosas relevantes para golang, ajuste varios temas de ALE
porque me parecia que no andaban del todo bien, y agregue algunos
archivos que por alguna razon no estaban en el repo.
Siguiendo con los medianos, cambie un par de cosas en la configuracion
de neomutt, como poder tener fechas relativas en el inbox, usar elinks y
suprimir esos mensajes de autoview que eran puro ruido.
Chicos no se, varias cositas aqui y alla. Los cambios de QOL de siempre,
supongo.
Ah, y borre a la mierda el readme de /bin porque era medio cualquiera,
despues voy a ver de crear uno como la gente.
2020-10-21 13:05:09 +00:00
|
|
|
map zf $hx add $fs .
|
2020-06-23 18:03:54 +00:00
|
|
|
map zn newfold
|
2020-01-23 14:25:42 +00:00
|
|
|
|
2020-04-18 15:59:02 +00:00
|
|
|
map i push A<c-a> # at the very beginning
|
2020-03-29 19:16:35 +00:00
|
|
|
map A rename # at the very end
|
2020-04-18 15:59:02 +00:00
|
|
|
map I push A<a-b><c-b>. # before extension
|
2020-03-29 19:16:35 +00:00
|
|
|
map a push A<a-b> # after extension
|
2020-01-23 14:25:42 +00:00
|
|
|
map B bulkrename
|
|
|
|
|
2020-04-28 18:34:58 +00:00
|
|
|
map L :Link
|
2020-06-18 01:38:39 +00:00
|
|
|
map f fzf_jump #goto dir
|
|
|
|
map / $lf -remote "send $id select \"$(FZF_DEFAULT_COMMAND='fd --max-depth=1' fzf)\"" #local dir find
|
|
|
|
map F $find | lf -remote "send $id select $(fzf --reverse --border --margin 2% --inline-info --color border:#005688,bg+:#16252E,fg+:#26c6da,hl+:#ffffff,hl:#26c6da)" #global find
|
2020-01-23 14:25:42 +00:00
|
|
|
|
|
|
|
# Movement
|
2020-12-10 19:06:52 +00:00
|
|
|
map gR cd /
|
2020-01-23 14:25:42 +00:00
|
|
|
map gE cd /etc
|
|
|
|
map gU cd /usr
|
2020-12-10 19:06:52 +00:00
|
|
|
map gM cd /media
|
|
|
|
map gl cd ~/.local/share
|
|
|
|
map gg cd ~/.local/share/go
|
|
|
|
map ga cd ~/.local/apps
|
|
|
|
map gb cd ~/.local/bin
|
2020-01-23 14:25:42 +00:00
|
|
|
map g. cd ~/.config
|
2020-09-25 17:25:56 +00:00
|
|
|
map gn cd ~/.config/nvim
|
|
|
|
map gz cd ~/.config/zsh
|
2020-08-04 15:10:09 +00:00
|
|
|
map gm cd ~/snd/Albums
|
2020-12-10 19:06:52 +00:00
|
|
|
map gd cd ~/doc
|
|
|
|
map gp cd ~/doc/paginas
|
|
|
|
map gv cd ~/vid
|
|
|
|
map ge cd ~/etc
|
|
|
|
map gi cd ~/img
|
2020-04-14 04:07:37 +00:00
|
|
|
map gv cd ~/vid/Learning
|
2020-12-10 19:06:52 +00:00
|
|
|
map gc cd /mnt/cel
|
|
|
|
map gr cd /mnt/remote
|
|
|
|
|
2020-01-23 14:25:42 +00:00
|
|
|
map cg $$EDITOR ~/.config/lf/lfrc
|
2020-04-01 15:47:43 +00:00
|
|
|
map sg source ~/.config/lf/lfrc
|