Compare commits
2 commits
4212d034a2
...
3c8db2a663
Author | SHA1 | Date | |
---|---|---|---|
3c8db2a663 | |||
b104617de9 |
5 changed files with 74 additions and 0 deletions
|
@ -30,6 +30,9 @@ normal = "block"
|
|||
insert = "bar"
|
||||
select = "underline"
|
||||
|
||||
[editor.file-picker]
|
||||
hidden = false
|
||||
|
||||
[editor.indent-guides]
|
||||
render = true
|
||||
|
||||
|
|
3
dot_config/lf/executable_lf_kitty_clean
Normal file
3
dot_config/lf/executable_lf_kitty_clean
Normal file
|
@ -0,0 +1,3 @@
|
|||
#!/usr/bin/env bash
|
||||
|
||||
kitty +kitten icat --clear --stdin no --silent --transfer-mode file < /dev/null > /dev/tty
|
13
dot_config/lf/executable_lf_kitty_preview
Normal file
13
dot_config/lf/executable_lf_kitty_preview
Normal 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
51
dot_config/lf/lfrc
Normal 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
4
dot_zsh/lf.zsh
Normal file
|
@ -0,0 +1,4 @@
|
|||
LFCD="/usr/share/examples/lf/lfcd.sh"
|
||||
[[ -f "$LFCD" ]] && source "$LFCD"
|
||||
|
||||
bindkey -s '^o' 'lfcd\n'
|
Loading…
Add table
Reference in a new issue