Preview script updated to match fzf

This commit is contained in:
Neptune 2020-05-23 02:31:50 +02:00
parent da47f3acfc
commit 2c5ddd353f
13 changed files with 134 additions and 1751 deletions

View file

@ -68,5 +68,3 @@ xsetwacom set $(xsetwacom --list devices | awk '/Pen stylus/ { if ($7 == "id:")
dunst -config "$HOME/.config/dunst/dunstrc" &
xow &
xbanish &

View file

@ -6,7 +6,7 @@ killall -q polybar
# Wait until the processes have been shut down
while pgrep -x polybar >/dev/null; do sleep 1; done
# Launch bar1
wal -R
polybar bar1 &
polybar bar2 &

View file

@ -43,7 +43,7 @@ alias torrent='aria2c --bt-metadata-only=true --bt-save-metadata=true'
## Navigation
alias ls='exa' # ls with colors
alias r='vimfmrun'
alias r='vifm'
## Git
alias g:a='git add -A'

View file

@ -243,7 +243,7 @@ open_url_modifiers kitty_mod
#: The modifier keys to press when clicking with the mouse on URLs to
#: open the URL
open_url_with default
open_url_with qutebrowser
#: The program with which to open URLs that are clicked on. The
#: special value default means to use the operating system's default

View file

@ -161,7 +161,7 @@ let g:deoplete#sources#clang#libclang_path= '/usr/lib/libclang.so'
let g:deoplete#sources#clang#clang_header= '/usr/lib/clang'
let g:deoplete#enable_at_startup = 1
let g:deoplete#enable_debug = 1
let g:deoplete#enable_profile = 1
" let g:deoplete#enable_profile = 1
" Doxygen comment type
let g:DoxygenToolkit_commentType = "C++"

View file

@ -0,0 +1,114 @@
#!/usr/bin/env bash
X="$2"
Y="$3"
WIDTH="$4"
HEIGHT="$5"
TMP="/tmp/vifm-preview"
# Create temporary working directory if the directory structure doesn't exist
function maketemp() {
if [ ! -d "$(dirname "$TMP$1")" ]; then
mkdir -p "$(dirname "$TMP$1")"
fi
}
function fileclean() {
if [ -f "$TMP$1.png" ]; then
rm -f "$TMP$1.png"
elif [ -d "$TMP$1/" ]; then
rm -rf "$TMP$1/"
fi
}
function previewclear() {
kitty +kitten icat --transfer-mode=file --silent --clear
}
function text() {
bat --pager=never --wrap never --style="changes" --color="always" "$1" -p
}
function torrent() {
aria2c --show-files "$1"
}
function archive() {
atool -l -q "$1" | tail -n +2 | awk -F' ' '{print $NF}'
}
function draw() {
kitty +kitten icat --transfer-mode=file --silent --align=left --place=${WIDTH}x${HEIGHT}@${X}x${Y} "$1"
}
function image() {
draw "$1"
}
function audio() {
maketemp "$1"
if [ ! -f "$TMP$1.png" ]; then
# https://ffmpeg.org/ffmpeg-filters.html#showspectrum-1
ffmpeg -loglevel 0 -y -i "$1" -lavfi "showspectrumpic=s=hd480:legend=0:gain=5:color=intensity" "$TMP$1.png"
fi
draw "$TMP$1.png"
}
function video() {
maketemp "$1"
if [ ! -f "$TMP$1.png" ]; then
ffmpegthumbnailer -i "$1" -o "$TMP$1.png" -s 1024 -q 10
fi
draw "$TMP$1.png"
}
function pdf() {
maketemp "$1"
if [ ! -f "$TMP$1.png" ]; then
pdftoppm -png -singlefile "$1" "$TMP$1" -scale-to 1024
fi
draw "$TMP$1.png"
}
function epub() {
maketemp "$1"
if [ ! -f "$TMP$1.png" ]; then
epub-thumbnailer "$1" "$TMP$1.png" 1024
fi
draw "$TMP$1.png"
}
function main() {
mimetype=$(file -b --mime-type "$1")
previewclear
if [ $mimetype != "inode/directory" ]; then
fileclean "$1"
fi
case $mimetype in
application/epub*)
epub "$1";;
application/pdf)
pdf "$1";;
application/x-bittorrent)
torrent "$1";;
application/zip | application/x-tar | *rar )
archive "$1";;
audio/*)
audio "$1";;
image/*)
image "$1";;
text/*)
text "$1";;
video/*)
video "$1";;
inode/directory)
exa --color always "$1";;
*);;
esac
}
main "$1"

View file

@ -1,146 +0,0 @@
#!/usr/bin/env bash
readonly ID_PREVIEW="preview"
# PLAY_GIF="yes"
# By enabling this option the GIF will be animated, by leaving it commented like it
# is now will make the gif previews behave the same way as video previews.
AUTO_REMOVE="yes"
# By enabling this option the script will remove the preview file after it is drawn
# and by doing so the preview will always be up-to-date with the file.
# This however, requires more CPU and therefore affects the overall performance.
# The messy code below is for moving pages in pdf files in the vifm file preview by
# utilizing the < and > keys which will be bound to `vifmimg inc` or `vifmimg dec`.
PDF_PAGE_CONFIG="$HOME/.config/vifm/vifmimgpdfpage"
PDF_FILE_CONFIG="$HOME/.config/vifm/vifmimgpdffile"
PDF_PAGE=1
PDF_FILE=""
# Initialize the variables and required files
[[ -f "$PDF_PAGE_CONFIG" ]] && PDF_PAGE=$(cat $PDF_PAGE_CONFIG) || touch $PDF_PAGE_CONFIG
[[ -f "$PDF_FILE_CONFIG" ]] && PDF_FILE=$(cat $PDF_FILE_CONFIG) || touch $PDF_FILE_CONFIG
# Create temporary working directory if the directory structure doesn't exist
if [[ ! -d "/tmp$PWD/" ]]; then
mkdir -p "/tmp$PWD/"
fi
function inc() {
VAL="$(cat $PDF_PAGE_CONFIG)"
echo "$(expr $VAL + 1)" > $PDF_PAGE_CONFIG
}
function dec() {
VAL="$(cat $PDF_PAGE_CONFIG)"
echo "$(expr $VAL - 1)" > $PDF_PAGE_CONFIG
if [[ $VAL -le 0 ]]; then
echo 0 > $PDF_PAGE_CONFIG
fi
}
function previewclear() {
kitty +kitten icat --transfer-mode=file --silent --clear
}
function fileclean() {
if [[ -f "/tmp$PWD/$6.png" ]]; then
rm -f "/tmp$PWD/$6.png"
elif [[ -d "/tmp$PWD/$6/" ]]; then
rm -rf "/tmp$PWD/$6/"
fi
}
function preview() {
kitty +kitten icat -z=-1 --transfer-mode=file --silent --place=${4}x${5}@${2}x${3} "$PWD/$6"
}
function previewvideo() {
if [[ ! -f "/tmp$PWD/$6.png" ]]; then
ffmpegthumbnailer -i "$PWD/$6" -o "/tmp$PWD/$6.png" -s 0 -q 10
fi
kitty +kitten icat -z=-1 --transfer-mode=file --silent --place=${4}x${5}@${2}x${3} "/tmp$PWD/$6.png"
}
function previewepub() {
if [[ ! -f "/tmp$PWD/$6.png" ]]; then
epub-thumbnailer "$6" "/tmp$PWD/$6.png" 1024
fi
kitty +kitten icat -z=-1 --transfer-mode=file --silent --place=${4}x${5}@${2}x${3} "/tmp$PWD/$6.png"
}
function previewaudio() {
if [[ ! -f "/tmp${PWD}/$6.png" ]]; then
ffmpeg -i "$6" "/tmp${PWD}/$6.png" -y &> /dev/null
fi
kitty +kitten icat -z=-1 --transfer-mode=file --silent --place=${4}x${5}@${2}x${3} "/tmp$PWD/$6.png"
}
function previewfont() {
if [[ ! -f "/tmp${PWD}/$6.png" ]]; then
fontpreview -i "$6" -o "/tmp${PWD}/$6.png"
fi
kitty +kitten icat -z=-1 --transfer-mode=file --silent --place=${4}x${5}@${2}x${3} "/tmp$PWD/$6.png"
}
function previewgif() {
if [[ ! -d "/tmp$PWD/$6/" ]]; then
mkdir -p "/tmp$PWD/$6/"
convert -coalesce "$PWD/$6" "/tmp$PWD/$6/$6.png"
fi
if [[ ! -z "$PLAY_GIF" ]]; then
for frame in $(ls -1 /tmp$PWD/$6/$6*.png | sort -V); do
kitty +kitten icat -z=-1 --transfer-mode=file --silent --place=${4}x${5}@${2}x${3} "$frame"
# Sleep between frames to make the animation smooth.
sleep .07
done
else
kitty +kitten icat -z=-1 --transfer-mode=file --silent --place=${4}x${5}@${2}x${3} "/tmp$PWD/$6/$6-0.png"
fi
}
function previewpdf() {
if [[ ! "$6" == "$PDF_FILE" ]]; then
PDF_PAGE=1
echo 1 > $PDF_PAGE_CONFIG
rm -f "/tmp$PWD/$6.png"
fi
if [[ ! "$PDF_PAGE" == "1" ]] && [[ -f "/tmp$PWD/$6.png" ]]; then
rm -f "/tmp$PWD/$6.png"
fi
if [[ ! -f "/tmp$PWD/$6.png" ]]; then
pdftoppm -png -f $PDF_PAGE -singlefile "$6" "/tmp$PWD/$6"
fi
echo "$6" > $PDF_FILE_CONFIG
kitty +kitten icat -z=-1 --transfer-mode=file --silent --place=${4}x${5}@${2}x${3} "/tmp$PWD/$6.png"
}
function previewmagick() {
if [[ ! -f "/tmp$PWD/$6.png" ]]; then
convert -thumbnail $(identify -format "%wx%h" "$6") "$PWD/$6" "/tmp$PWD/$6.png"
fi
kitty +kitten icat -z=-1 --transfer-mode=file --silent --place=${4}x${5}@${2}x${3} "/tmp$PWD/$6.png"
}
function main() {
case "$1" in
"inc") inc "$@" ;;
"dec") dec "$@" ;;
"clear") previewclear "$@" ;;
"clean") fileclean "$@" ;;
"draw") preview "$@" ;;
"videopreview") previewvideo "$@" ;;
"epubpreview") previewepub "$@" ;;
"gifpreview") previewgif "$@" ;;
"pdfpreview") previewpdf "$@" ;;
"magickpreview") previewmagick "$@" ;;
"audiopreview") previewaudio "$@" ;;
"fontpreview") previewfont "$@" ;;
"*") echo "Unknown command: '$@'" ;;
esac
}
main "$@"

View file

@ -1,177 +0,0 @@
#!/usr/bin/env bash
readonly ID_PREVIEW="preview"
# PLAY_GIF="yes"
# By enabling this option the GIF will be animated, by leaving it commented like it
# is now will make the gif previews behave the same way as video previews.
AUTO_REMOVE="yes"
# By enabling this option the script will remove the preview file after it is drawn
# and by doing so the preview will always be up-to-date with the file.
# This however, requires more CPU and therefore affects the overall performance.
# The messy code below is for moving pages in pdf files in the vifm file preview by
# utilizing the < and > keys which will be bound to `vifmimg inc` or `vifmimg dec`.
PDF_PAGE_CONFIG="$HOME/.config/vifm/vifmimgpdfpage"
PDF_FILE_CONFIG="$HOME/.config/vifm/vifmimgpdffile"
PDF_PAGE=1
PDF_FILE=""
# Initialize the variables and required files
[[ -f "$PDF_PAGE_CONFIG" ]] && PDF_PAGE=$(cat $PDF_PAGE_CONFIG) || touch $PDF_PAGE_CONFIG
[[ -f "$PDF_FILE_CONFIG" ]] && PDF_FILE=$(cat $PDF_FILE_CONFIG) || touch $PDF_FILE_CONFIG
# Create temporary working directory if the directory structure doesn't exist
if [[ ! -d "/tmp$PWD/" ]]; then
mkdir -p "/tmp$PWD/"
fi
function inc() {
VAL="$(cat $PDF_PAGE_CONFIG)"
echo "$(expr $VAL + 1)" > $PDF_PAGE_CONFIG
}
function dec() {
VAL="$(cat $PDF_PAGE_CONFIG)"
echo "$(expr $VAL - 1)" > $PDF_PAGE_CONFIG
if [[ $VAL -le 0 ]]; then
echo 0 > $PDF_PAGE_CONFIG
fi
}
function previewclear() {
declare -p -A cmd=([action]=remove [identifier]="$ID_PREVIEW") \
> "$FIFO_UEBERZUG"
}
function fileclean() {
if [[ -f "/tmp$PWD/$6.png" ]]; then
rm -f "/tmp$PWD/$6.png"
elif [[ -d "/tmp$PWD/$6/" ]]; then
rm -rf "/tmp$PWD/$6/"
fi
}
function preview() {
declare -p -A cmd=([action]=add [identifier]="$ID_PREVIEW"
[x]="$2" [y]="$3" [width]="$4" [height]="$5" \
[path]="$PWD/$6") \
> "$FIFO_UEBERZUG"
}
function previewvideo() {
if [[ ! -f "/tmp$PWD/$6.png" ]]; then
ffmpegthumbnailer -i "$PWD/$6" -o "/tmp$PWD/$6.png" -s 0 -q 10
fi
declare -p -A cmd=([action]=add [identifier]="$ID_PREVIEW"
[x]="$2" [y]="$3" [width]="$4" [height]="$5" \
[path]="/tmp$PWD/$6.png") \
> "$FIFO_UEBERZUG"
}
function previewepub() {
if [[ ! -f "/tmp$PWD/$6.png" ]]; then
epub-thumbnailer "$6" "/tmp$PWD/$6.png" 1024
fi
declare -p -A cmd=([action]=add [identifier]="$ID_PREVIEW"
[x]="$2" [y]="$3" [width]="$4" [height]="$5" \
[path]="/tmp$PWD/$6.png") \
> "$FIFO_UEBERZUG"
}
function previewaudio() {
if [[ ! -f "/tmp${PWD}/$6.png" ]]; then
ffmpeg -i "$6" "/tmp${PWD}/$6.png" -y &> /dev/null
fi
declare -p -A cmd=([action]=add [identifier]="$ID_PREVIEW"
[x]="$2" [y]="$3" [width]="$4" [height]="$5" \
[path]="/tmp${PWD}/$6.png") \
> "$FIFO_UEBERZUG"
}
function previewfont() {
if [[ ! -f "/tmp${PWD}/$6.png" ]]; then
fontpreview -i "$6" -o "/tmp${PWD}/$6.png"
fi
declare -p -A cmd=([action]=add [identifier]="$ID_PREVIEW"
[x]="$2" [y]="$3" [width]="$4" [height]="$5" \
[path]="/tmp${PWD}/$6.png") \
> "$FIFO_UEBERZUG"
}
function previewgif() {
if [[ ! -d "/tmp$PWD/$6/" ]]; then
mkdir -p "/tmp$PWD/$6/"
convert -coalesce "$PWD/$6" "/tmp$PWD/$6/$6.png"
fi
if [[ ! -z "$PLAY_GIF" ]]; then
for frame in $(ls -1 /tmp$PWD/$6/$6*.png | sort -V); do
declare -p -A cmd=([action]=add [identifier]="$ID_PREVIEW"
[x]="$2" [y]="$3" [width]="$4" [height]="$5" \
[path]="$frame") \
> "$FIFO_UEBERZUG"
# Sleep between frames to make the animation smooth.
sleep .07
done
else
declare -p -A cmd=([action]=add [identifier]="$ID_PREVIEW"
[x]="$2" [y]="$3" [width]="$4" [height]="$5" \
[path]="/tmp$PWD/$6/$6-0.png") \
> "$FIFO_UEBERZUG"
fi
}
function previewpdf() {
if [[ ! "$6" == "$PDF_FILE" ]]; then
PDF_PAGE=1
echo 1 > $PDF_PAGE_CONFIG
rm -f "/tmp$PWD/$6.png"
fi
if [[ ! "$PDF_PAGE" == "1" ]] && [[ -f "/tmp$PWD/$6.png" ]]; then
rm -f "/tmp$PWD/$6.png"
fi
if [[ ! -f "/tmp$PWD/$6.png" ]]; then
pdftoppm -png -f $PDF_PAGE -singlefile "$6" "/tmp$PWD/$6"
fi
echo "$6" > $PDF_FILE_CONFIG
declare -p -A cmd=([action]=add [identifier]="$ID_PREVIEW"
[x]="$2" [y]="$3" [width]="$4" [height]="$5" \
[path]="/tmp$PWD/$6.png") \
> "$FIFO_UEBERZUG"
}
function previewmagick() {
if [[ ! -f "/tmp$PWD/$6.png" ]]; then
convert -thumbnail $(identify -format "%wx%h" "$6") "$PWD/$6" "/tmp$PWD/$6.png"
fi
declare -p -A cmd=([action]=add [identifier]="$ID_PREVIEW"
[x]="$2" [y]="$3" [width]="$4" [height]="$5" \
[path]="/tmp$PWD/$6.png") \
> "$FIFO_UEBERZUG"
}
function main() {
case "$1" in
"inc") inc "$@" ;;
"dec") dec "$@" ;;
"clear") previewclear "$@" ;;
"clean") fileclean "$@" ;;
"draw") preview "$@" ;;
"videopreview") previewvideo "$@" ;;
"epubpreview") previewepub "$@" ;;
"gifpreview") previewgif "$@" ;;
"pdfpreview") previewpdf "$@" ;;
"magickpreview") previewmagick "$@" ;;
"audiopreview") previewaudio "$@" ;;
"fontpreview") previewfont "$@" ;;
"*") echo "Unknown command: '$@'" ;;
esac
}
main "$@"

View file

@ -1 +1 @@
1
9

File diff suppressed because it is too large Load diff

View file

@ -1,181 +0,0 @@
# You can edit this file by hand, but it's recommended not to do that.
# Marks:
# Bookmarks:
# Left window history (oldest to newest):
d/home/jojo
Pictures
2
d/home/jojo/Pictures
..
0
d/home/jojo
Books
5
d/home/jojo/Books
Officially Translated Light Novels
1
d/home/jojo/Books/Officially Translated Light Novels
My Next Life as a Villainess
25
d/home/jojo/Books/Officially Translated Light Novels/My Next Life as a Villainess
My Next Life as a Villainess - Volume 04 [J-Novel Club][Kobo].epub
1
d/home/jojo/bin
src
1
d/home/jojo/bin/src
materia-kde
17
d/home/jojo/bin/src/materia-kde
Kvantum
4
d/home/jojo/bin/src/materia-kde/Kvantum
..
0
d/home/jojo/bin/src/materia-kde
konsole
7
d/home/jojo/Projects
gitlab.com
2
d/home/jojo/Projects/gitlab.com
sourplum-sogeti
1
d/home/jojo/Projects/gitlab.com/sourplum-sogeti
note
1
d/oldhome/jojo
Projects
25
d/oldhome/jojo/Projects
gitlab.com
2
d/oldhome/jojo/Projects/gitlab.com
sourplum
1
d/oldhome/jojo/Projects/gitlab.com/sourplum
thesis
2
d/oldhome/jojo/Projects/gitlab.com/sourplum/thesis
notes.adoc
3
d/home/jojo/Projects/gitlab.com/sourplum-sogeti/formation/day1
patch
2
d/home/jojo/Projects/gitlab.com/sourplum-sogeti/formation/day1/patch
cedric.patch
1
d/home/jojo/Projects/gitlab.com/sourplum-sogeti/formation/day1
supervisord.conf
1
d/home/jojo
Downloads
1
d/home/jojo/Videos
霹靂狼煙之《九輪燎原》片頭曲【一笑天下】-HxFQ1QYvvFI.mkv
5
d/home/jojo
ArchiveVideos
1
d/home/jojo/ArchiveVideos
DaiconIV
1
d/home/jojo/ArchiveVideos/DaiconIV
..
0
d/home/jojo/ArchiveVideos
DaiconIV
1
d/home/jojo/ArchiveVideos/DaiconIV
DaiconIV.mp4
2
d/home/jojo/Videos
金光布袋戲Mv - 飄渺無極(劍無極武戲曲)-3VAyb70NLnM.mkv
4
d/home/jojo
ArchiveVideos
2
d/home/jojo/ArchiveVideos
DaiconIV
4
d/home/jojo/.void-packages/srcpkgs
bibata-cursor-theme
4
d/home/jojo/.void-packages/srcpkgs/bibata-cursor-theme
template
1
d/home/jojo/.void-packages/srcpkgs
bspwm-round-corners
5
d/home/jojo/.void-packages/srcpkgs/bspwm-round-corners
template
1
# Right window history (oldest to newest):
D/home/jojo
0
D/home/jojo/bin
0
D/home/jojo/Projects
0
D/oldhome/jojo
0
D/home/jojo/Projects/gitlab.com/sourplum-sogeti/formation/day1
0
D/home/jojo
0
D/home/jojo/Videos
0
D/home/jojo
0
D/home/jojo/.void-packages/srcpkgs
0
# Command line history (oldest to newest):
:filter pdf
:sort
# Search history (oldest to newest):
/villa
# Prompt history (oldest to newest):
# Local filter history (oldest to newest):
# Registers:
""/home/jojo/.local/share/vifm/Trash/000_run.sh
# Directory stack (oldest to newest):
# Trash content:
t/home/jojo/.local/share/vifm/Trash/000_patch
/home/jojo/Projects/gitlab.com/sourplum-sogeti/formation/day1/patch
t/home/jojo/.local/share/vifm/Trash/000_README.md
/home/jojo/Projects/gitlab.com/sourplum-sogeti/formation/day1/README.md
t/home/jojo/.local/share/vifm/Trash/000_compile.sh
/home/jojo/Projects/gitlab.com/sourplum-sogeti/formation/day1/compile.sh
t/home/jojo/.local/share/vifm/Trash/000_run.sh
/home/jojo/Projects/gitlab.com/sourplum-sogeti/formation/day1/run.sh
# State:
fpdf
i1
[.1
[F
F
I1
].1
]F
s0

View file

@ -1,133 +0,0 @@
# You can edit this file by hand, but it's recommended not to do that.
# Marks:
# Bookmarks:
# Left window history (oldest to newest):
d/home/jojo
Pictures
2
d/home/jojo/Pictures
..
0
d/home/jojo
Books
5
d/home/jojo/Books
Officially Translated Light Novels
1
d/home/jojo/Books/Officially Translated Light Novels
My Next Life as a Villainess
25
d/home/jojo/Books/Officially Translated Light Novels/My Next Life as a Villainess
My Next Life as a Villainess - Volume 04 [J-Novel Club][Kobo].epub
1
d/home/jojo/bin
src
1
d/home/jojo/bin/src
materia-kde
17
d/home/jojo/bin/src/materia-kde
Kvantum
4
d/home/jojo/bin/src/materia-kde/Kvantum
..
0
d/home/jojo/bin/src/materia-kde
konsole
7
d/home/jojo/Projects
gitlab.com
2
d/home/jojo/Projects/gitlab.com
sourplum-sogeti
1
d/home/jojo/Projects/gitlab.com/sourplum-sogeti
note
1
d/oldhome/jojo
Projects
25
d/oldhome/jojo/Projects
gitlab.com
2
d/oldhome/jojo/Projects/gitlab.com
sourplum
1
d/oldhome/jojo/Projects/gitlab.com/sourplum
thesis
2
d/oldhome/jojo/Projects/gitlab.com/sourplum/thesis
notes.adoc
3
d/home/jojo/Projects/gitlab.com/sourplum-sogeti/formation/day1
patch
2
d/home/jojo/Projects/gitlab.com/sourplum-sogeti/formation/day1/patch
cedric.patch
1
d/home/jojo/Projects/gitlab.com/sourplum-sogeti/formation/day1
supervisord.conf
1
d/home/jojo
Downloads
1
# Right window history (oldest to newest):
D/home/jojo
0
D/home/jojo/bin
0
D/home/jojo/Projects
0
D/oldhome/jojo
0
D/home/jojo/Projects/gitlab.com/sourplum-sogeti/formation/day1
0
D/home/jojo
0
# Command line history (oldest to newest):
:filter pdf
:sort
# Search history (oldest to newest):
/villa
# Prompt history (oldest to newest):
# Local filter history (oldest to newest):
# Registers:
""/home/jojo/.local/share/vifm/Trash/000_run.sh
# Directory stack (oldest to newest):
# Trash content:
t/home/jojo/.local/share/vifm/Trash/000_patch
/home/jojo/Projects/gitlab.com/sourplum-sogeti/formation/day1/patch
t/home/jojo/.local/share/vifm/Trash/000_README.md
/home/jojo/Projects/gitlab.com/sourplum-sogeti/formation/day1/README.md
t/home/jojo/.local/share/vifm/Trash/000_compile.sh
/home/jojo/Projects/gitlab.com/sourplum-sogeti/formation/day1/compile.sh
t/home/jojo/.local/share/vifm/Trash/000_run.sh
/home/jojo/Projects/gitlab.com/sourplum-sogeti/formation/day1/run.sh
# State:
fpdf
i1
[.1
[F
F
I1
].1
]F
s0

View file

@ -77,7 +77,7 @@ if !has('win')
endif
" Things that should be stored in vifminfo
set vifminfo=dhistory,chistory,state,shistory,phistory,fhistory,dirstack,registers,bookmarks,bmarks
set vifminfo=
" Dont show delete confirmation
" set confirm-=delete
@ -137,6 +137,12 @@ set rulerformat=
" You can also add %CLEAR if you want to clear screen before running FUSE
" program.
" Dont show preview on ../ as this confuses me at times
" fileview ../ %pc echo >/dev/null
" All
fileviewer <*>
\ preview %c:p %px %py %pw %ph
" CSV/Excel
filetype *.csv,*.xlsx libreoffice %c %i
@ -148,83 +154,37 @@ filextype *.html,*.htm qutebrowser %f 2>/dev/null &
" Text based files
filetype <text/*> nvim
fileviewer <text/*> env -uCOLORTERM bat --color always --wrap never --pager never %c -p
" PDFs
filextype *.pdf llpp %c %i &
fileviewer *.pdf
\ vifmimg pdfpreview %px %py %pw %ph %c
\ %pc
\ vifmimg clear
" ePUBs
filextype *.epub llpp %c %i &
fileviewer *.epub
\ vifmimg epubpreview %px %py %pw %ph %c
\ %pc
\ vifmimg clear
" Fonts
fileviewer <font/*>
\ vifmimg font %px %py %pw %ph %c
\ %pc
\ vifmimg clear
" Audios
filetype <audio/*> mpv %c %i &
fileviewer <audio/*>
\ vifmimg audio %px %py %pw %ph %c
\ %pc
\ vifmimg clear
" Videos
filetype <video/*> mpv %c %i &
fileviewer <video/*>
\ vifmimg videopreview %px %py %pw %ph %c
\ %pc
\ vifmimg clear
" Gif
fileviewer *.gif
\ vifmimg gifpreview %px %py %pw %ph %c
\ %pc
\ vifmimg clear
fileviewer *.bmp
\ vifmimg draw %px %py %pw %ph %c
\ %pc
\ vifmimg clear
" Images
filextype <image/*> imv %c &
fileviewer <image/*>
\ vifmimg draw %px %py %pw %ph %c
\ %pc
\ vifmimg clear
" Archives
fileviewer *.zip,*.jar,*.war,*.ear,*.oxt zip -sf %c
fileviewer *.tgz,*.tar.gz tar -tzf %c
fileviewer *.tar.bz2,*.tbz2 tar -tjf %c
fileviewer *.tar.txz,*.txz xz --list %c
fileviewer *.tar tar -tf %c
fileviewer *.rar unrar v %c
fileviewer *.7z 7z l %c
" Dont show preview on ../ as this confuses me at times
fileview ../ echo >/dev/null
" Show ls in the preview window, it creates a similar look as ranger.
" The default directory tree thing is really messy
fileviewer */ ls --color
fileviewer .*/ ls --color
" fileviewer *.zip,*.jar,*.war,*.ear,*.oxt zip -sf %c
" fileviewer *.tgz,*.tar.gz tar -tzf %c
" fileviewer *.tar.bz2,*.tbz2 tar -tjf %c
" fileviewer *.tar.txz,*.txz xz --list %c
" fileviewer *.tar tar -tf %c
" fileviewer *.rar unrar v %c
" fileviewer *.7z 7z l %c
" Other files
" Using xdg-open to open the highlighted file with a compatible program and
" the reason why I am using "file" to preview other files is so that "vifm"
" does not lag when trying "cat" the file
filetype * xdg-open %c
fileviewer * file -b %c
" fileviewer * file -b %c
" }}}