mirror of
https://github.com/starr-dusT/dotfiles.git
synced 2025-02-19 19:27:31 -08:00
75 lines
1.3 KiB
Plaintext
75 lines
1.3 KiB
Plaintext
# Basic Settings
|
|
set hidden true
|
|
set ignorecase true
|
|
set icons true
|
|
|
|
# Custom Functions
|
|
cmd mkdir ${{
|
|
printf "Directory Name: "
|
|
read ans
|
|
mkdir $ans
|
|
}}
|
|
|
|
cmd mkfile ${{
|
|
printf "File Name: "
|
|
read ans
|
|
$EDITOR $ans
|
|
}}
|
|
|
|
# Trash bindings
|
|
cmd trash ${{
|
|
files=$(printf "$fx" | tr '\n' ';')
|
|
while [ "$files" ]; do
|
|
file=${files%%;*}
|
|
|
|
trash-put "$(basename "$file")"
|
|
if [ "$files" = "$file" ]; then
|
|
files=''
|
|
else
|
|
files="${files#*;}"
|
|
fi
|
|
done
|
|
}}
|
|
|
|
cmd restore_trash ${{
|
|
trash-restore
|
|
}}
|
|
|
|
# use '<delete>' key for either 'trash' or 'delete' command
|
|
map m
|
|
map D trash
|
|
map mf mkfile
|
|
map md mkdir
|
|
|
|
# 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
|
|
}}
|