Compare commits

...

2 commits

Author SHA1 Message Date
3c8db2a663
lf: add config 2025-07-10 11:51:40 +02:00
b104617de9
helix: show hidden files 2025-07-10 11:51:40 +02:00
5 changed files with 74 additions and 0 deletions

View file

@ -30,6 +30,9 @@ normal = "block"
insert = "bar" insert = "bar"
select = "underline" select = "underline"
[editor.file-picker]
hidden = false
[editor.indent-guides] [editor.indent-guides]
render = true render = true

View file

@ -0,0 +1,3 @@
#!/usr/bin/env bash
kitty +kitten icat --clear --stdin no --silent --transfer-mode file < /dev/null > /dev/tty

View file

@ -0,0 +1,13 @@
#!/usr/bin/env bash
file=$1
w=$2
h=$3
x=$4
y=$5
if [[ "$( file -Lb --mime-type "$file")" =~ ^image ]]; then
kitty +kitten icat --silent --stdin no --transfer-mode file --place "${w}x${h}@${x}x${y}" "$file" < /dev/null > /dev/tty
exit 1
fi
# pistol "$file"

51
dot_config/lf/lfrc Normal file
View file

@ -0,0 +1,51 @@
# kitty previewer
set previewer ~/.config/lf/lf_kitty_preview
set cleaner ~/.config/lf/lf_kitty_clean
# extract the current file with the right command
# (xkcd link: https://xkcd.com/1168/)
cmd extract ${{
set -f
case $f in
*.tar.bz|*.tar.bz2|*.tbz|*.tbz2) tar xjvf $f;;
*.tar.gz|*.tgz) tar xzvf $f;;
*.tar.xz|*.txz) tar xJvf $f;;
*.zip) unzip $f;;
*.rar) unrar x $f;;
*.7z) 7z x $f;;
esac
}}
# compress current file or selected files with tar and gunzip
cmd tar ${{
set -f
mkdir $1
cp -r $fx $1
tar czf $1.tar.gz $1
rm -rf $1
}}
# compress current file or selected files with zip
cmd zip ${{
set -f
mkdir $1
cp -r $fx $1
zip -r $1.zip $1
rm -rf $1
}}
# zoxide
cmd cd %{{
result="$(zoxide query --exclude $PWD $@ | sed 's/\\/\\\\/g;s/"/\\"/g')"
lf -remote "send $id cd \"$result\""
}}
cmd cdi ${{
result="$(zoxide query -i | sed 's/\\/\\\\/g;s/"/\\"/g')"
lf -remote "send $id cd \"$result\""
}}
cmd on-cd &{{
zoxide add "$PWD"
}}

4
dot_zsh/lf.zsh Normal file
View file

@ -0,0 +1,4 @@
LFCD="/usr/share/examples/lf/lfcd.sh"
[[ -f "$LFCD" ]] && source "$LFCD"
bindkey -s '^o' 'lfcd\n'