diff --git a/home/.config/lite-xl/init.lua b/home/.config/lite-xl/init.lua index 9583559..7891fb2 100644 --- a/home/.config/lite-xl/init.lua +++ b/home/.config/lite-xl/init.lua @@ -18,11 +18,11 @@ keymap.add { ["ctrl+q"] = "core:quit" } ------------------------------- Fonts ---------------------------------------- -- customize fonts: -style.font = renderer.font.load(HOME .. "/.local/share/fonts/Comic/ComicMono.ttf", 14 * SCALE) -style.big_font = renderer.font.load(HOME .. "/.local/share/fonts/Comic/ComicMono.ttf", 16 * SCALE) -style.code_font = renderer.font.load(HOME .. "/.config/lite-xl/fonts/iosevka-ss14-regular.ttf", 14 * SCALE) -style.icon_font = renderer.font.load("/usr/local/share/lite-xl/fonts/icons.ttf", 18 * SCALE) -style.icon_big_font = renderer.font.load("/usr/local/share/lite-xl/fonts/icons.ttf", 24 * SCALE) +style.font = renderer.font.load(HOME .. "/.config/lite-xl/fonts/iosevka-regular.ttf", 14 * SCALE) +style.big_font = renderer.font.load(HOME .. "/.config/lite-xl/fonts/iosevka-regular.ttf", 16 * SCALE) +style.code_font = renderer.font.load(HOME .. "/.config/lite-xl/fonts/iosevka-regular.ttf", 14 * SCALE) +style.icon_font = renderer.font.load("/usr/share/lite-xl/fonts/icons.ttf", 18 * SCALE) +style.icon_big_font = renderer.font.load("/usr/share/lite-xl/fonts/icons.ttf", 24 * SCALE) local italic = renderer.font.load(HOME .. "/.config/lite-xl/fonts/iosevka-ss14-italic.ttf", 14 * SCALE) style.syntax_fonts["comment"] = italic diff --git a/home/.config/nvim/lua/modules/ui.lua b/home/.config/nvim/lua/modules/ui.lua index ee43cb4..9fc1c63 100644 --- a/home/.config/nvim/lua/modules/ui.lua +++ b/home/.config/nvim/lua/modules/ui.lua @@ -377,7 +377,13 @@ function M.nvimtree_conf() require('nvim-tree').setup { open_on_setup = false, + ignore_ft_on_setup = {'dashboard', 'alpha'}, auto_close = true, + open_on_tab = false, + update_to_buf_dir = { + enable = false, + auto_open = true + }, hijack_cursor = true, update_cwd = true, lsp_diagnostics = true, diff --git a/home/.config/vifm/colors/nord.vifm b/home/.config/vifm/colors/nord.vifm index ecc3085..0e4a137 100644 --- a/home/.config/vifm/colors/nord.vifm +++ b/home/.config/vifm/colors/nord.vifm @@ -11,32 +11,32 @@ highlight /^.*\.(3gp|aac|ac3|ape|asf|avi|dts|flac|flv|it|m3u|m4a|med|mid|midi|mk " highlight /^.*\.(~|$$$|bak|tmp)$/ cterm=none ctermfg=008 ctermbg=default " General highlight -highlight Border cterm=none ctermfg=002 ctermbg=default +highlight Border cterm=none ctermfg=002 ctermbg=default -highlight TopLine cterm=none ctermfg=004 ctermbg=default -highlight TopLineSel cterm=bold ctermfg=004 ctermbg=008 +highlight TopLine cterm=none ctermfg=004 ctermbg=default +highlight TopLineSel cterm=bold ctermfg=004 ctermbg=008 -highlight TabLine cterm=none ctermfg=004 ctermbg=default -highlight TabLineSel cterm=bold,inverse ctermfg=004 ctermbg=default +highlight TabLine cterm=none ctermfg=004 ctermbg=default +highlight TabLineSel cterm=bold,inverse ctermfg=004 ctermbg=default -highlight Win cterm=none ctermfg=015 ctermbg=default -highlight Directory cterm=bold ctermfg=004 ctermbg=default -highlight CurrLine cterm=bold,inverse ctermfg=default ctermbg=default -highlight LineNr cterm=bold ctermfg=004 ctermbg=default -highlight OtherLine cterm=bold ctermfg=default ctermbg=default -highlight Selected cterm=none ctermfg=003 ctermbg=008 +highlight Win cterm=none ctermfg=015 ctermbg=default +highlight Directory cterm=bold ctermfg=004 ctermbg=default +highlight CurrLine cterm=bold,inverse ctermfg=default ctermbg=default +highlight LineNr cterm=bold ctermfg=004 ctermbg=default +highlight OtherLine cterm=bold ctermfg=default ctermbg=default +highlight Selected cterm=none ctermfg=003 ctermbg=008 -highlight JobLine cterm=bold ctermfg=008 ctermbg=015 -highlight StatusLine cterm=none ctermfg=004 ctermbg=default -highlight ErrorMsg cterm=bold ctermfg=001 ctermbg=default -highlight WildMenu cterm=bold ctermfg=003 ctermbg=008 -highlight CmdLine cterm=none ctermfg=default ctermbg=default -highlight SuggestBox cterm=none ctermfg=002 ctermbg=default +highlight JobLine cterm=bold ctermfg=008 ctermbg=015 +highlight StatusLine cterm=none ctermfg=004 ctermbg=default +highlight ErrorMsg cterm=bold ctermfg=001 ctermbg=default +highlight WildMenu cterm=bold ctermfg=003 ctermbg=008 +highlight CmdLine cterm=none ctermfg=default ctermbg=default +highlight SuggestBox cterm=none ctermfg=002 ctermbg=default -highlight Executable cterm=bold ctermfg=002 ctermbg=default -highlight Link cterm=bold ctermfg=006 ctermbg=default -highlight HardLink cterm=bold ctermfg=008 ctermbg=default -highlight BrokenLink cterm=bold ctermfg=001 ctermbg=default -highlight Device cterm=bold,standout ctermfg=000 ctermbg=011 -highlight Fifo cterm=none ctermfg=003 ctermbg=default -highlight Socket cterm=bold ctermfg=005 ctermbg=default +highlight Executable cterm=bold ctermfg=002 ctermbg=default +highlight Link cterm=bold ctermfg=006 ctermbg=default +highlight HardLink cterm=bold ctermfg=008 ctermbg=default +highlight BrokenLink cterm=bold ctermfg=001 ctermbg=default +highlight Device cterm=bold,standout ctermfg=000 ctermbg=011 +highlight Fifo cterm=none ctermfg=003 ctermbg=default +highlight Socket cterm=bold ctermfg=005 ctermbg=default diff --git a/home/.config/vifm/colors/onedark.vifm b/home/.config/vifm/colors/onedark.vifm index cae3613..6178bcc 100644 --- a/home/.config/vifm/colors/onedark.vifm +++ b/home/.config/vifm/colors/onedark.vifm @@ -18,7 +18,7 @@ highlight TopLineSel cterm=none ctermfg=002 ctermbg=default highlight Win cterm=none ctermfg=white ctermbg=default highlight Directory cterm=none ctermfg=004 ctermbg=default -highlight LineNr cterm=bold ctermfg=004 ctermbg=default +highlight LineNr cterm=bold ctermfg=004 ctermbg=default highlight CurrLine cterm=none,inverse ctermfg=default ctermbg=default highlight OtherLine cterm=none ctermfg=default ctermbg=default highlight Selected cterm=none ctermfg=003 ctermbg=008 @@ -28,11 +28,11 @@ highlight StatusLine cterm=none ctermfg=250 ctermbg=default highlight ErrorMsg cterm=none ctermfg=001 ctermbg=default highlight WildMenu cterm=none ctermfg=015 ctermbg=250 highlight CmdLine cterm=none ctermfg=007 ctermbg=default -highlight SuggestBox cterm=none ctermfg=002 ctermbg=default +highlight SuggestBox cterm=none ctermfg=002 ctermbg=default highlight Executable cterm=none ctermfg=002 ctermbg=default highlight Link cterm=none ctermfg=006 ctermbg=default -highlight HardLink cterm=bold ctermfg=008 ctermbg=default +highlight HardLink cterm=bold ctermfg=008 ctermbg=default highlight BrokenLink cterm=none ctermfg=001 ctermbg=default highlight Device cterm=none,standout ctermfg=000 ctermbg=011 highlight Fifo cterm=none ctermfg=003 ctermbg=default diff --git a/home/.config/vifm/scripts/clear_sixel b/home/.config/vifm/scripts/clear_sixel new file mode 100755 index 0000000..f47e615 --- /dev/null +++ b/home/.config/vifm/scripts/clear_sixel @@ -0,0 +1,6 @@ +#!/bin/sh + +# Alternatively just do 'set previewoptions=hardgraphicsclear' in vifmrc +printf '\33[s\33[5A\33[2K\33[u' # see vifm/vifm#588 +clear +exit 0 diff --git a/home/.config/vifm/scripts/preview_kitty b/home/.config/vifm/scripts/preview_kitty index c0e772f..7c2f195 100755 --- a/home/.config/vifm/scripts/preview_kitty +++ b/home/.config/vifm/scripts/preview_kitty @@ -1,19 +1,21 @@ #!/bin/sh +[ -d "$HOME/.cache/vifm" ] || mkdir -p "$HOME/.cache/vifm" + X="$2" Y="$3" WIDTH="$4" HEIGHT="$5" -TMP="/tmp/vifm_thumb.png" +TMP="$HOME/.cache/vifm/thumbnail.$(stat --printf '%n\0%i\0%F\0%s\0%W\0%Y' -- "$(readlink -f "$1")" | sha256sum | awk '{print $1}')" _preview_video() { - ffmpegthumbnailer -i "$1" -o "$TMP" -s 0 - kitty icat --silent --place=${WIDTH}x${HEIGHT}@${X}x${Y} "$TMP" + [ ! -f "${TMP}.jpg" ] && ffmpegthumbnailer -i "$1" -o "${TMP}.jpg" -s 0 + kitty icat --silent --place=${WIDTH}x${HEIGHT}@${X}x${Y} "${TMP}.jpg" } _preview_image() { - convert -- "$1" "$TMP" - kitty icat --silent --place=${WIDTH}x${HEIGHT}@${X}x${Y} "$TMP" + [ ! -f "${TMP}.jpg" ] && convert "$1"'[0]' "${TMP}.jpg" + kitty icat --silent --place=${WIDTH}x${HEIGHT}@${X}x${Y} "${TMP}.jpg" } case "$1" in @@ -29,8 +31,8 @@ case "$1" in image/*) _preview_image "$1" ;; application/font*|application/*opentype|font/*) - genfontimage "$1" "$TMP" - kitty icat --silent --place=${WIDTH}x${HEIGHT}@${X}x${Y} "$TMP" ;; + [ ! -f "${TMP}.jpg" ] && genfontimage "$1" "${TMP}.jpg" + kitty icat --silent --place=${WIDTH}x${HEIGHT}@${X}x${Y} "${TMP}.jpg" ;; video/*) _preview_video "$1" ;; *) diff --git a/home/.config/vifm/scripts/preview_sixel b/home/.config/vifm/scripts/preview_sixel index a489890..a38a083 100755 --- a/home/.config/vifm/scripts/preview_sixel +++ b/home/.config/vifm/scripts/preview_sixel @@ -1,22 +1,68 @@ #!/bin/sh +[ -d "$HOME/.cache/vifm" ] || mkdir -p ~/.cache/vifm + WIDTH="$2" HEIGHT="$3" -TMP="/tmp/vifm_thumb.png" +TMP="$HOME/.cache/vifm/thumbnail.$(stat --printf '%n\0%i\0%F\0%s\0%W\0%Y' -- "$(readlink -f "$1")" | sha256sum | awk '{print $1}')" + +_show_sixel() { + # Stolen from vifm/vifm#419 + pw=$(($2*8)) + ph=$(($3*21)) + + w=$(exiftool -m -p '$ImageWidth' "$1") + h=$(exiftool -m -p '$ImageHeight' "$1") + + height=auto + width=auto + if [ $pw -lt $w ] && [ $ph -lt $h ] + then + newh=$(echo "($h*$pw)/$w" | bc) + # neww=$(echo "($w*$ph)/$h" | bc) + + if [ $newh -le $ph ]; then + width=$pw + else + height=$ph + fi + elif [ $pw -lt $w ] + then + width=$pw + elif [ $ph -lt $h ] + then + height=$ph + fi + + # debugging stuff + # echo pw=$pw ph=$ph + # echo w=$w h=$h + # echo neww=$neww newh=$newh + # exec echo width=$width height=$height + + # account for GNU screen + if [ -n "$STY" ] + then + popt=-P + fi + + exec img2sixel $popt --width=$width --height=$height "$1" # require libsixel + # exec montage "$1" -geometry "${pw}x${ph}" sixel:- # require ImageMagick +} _preview_video() { - ffmpegthumbnailer -i "$1" -o "$TMP" -s 0 - show-sixel "$TMP" ${WIDTH} ${HEIGHT} + [ ! -f "${TMP}.jpg" ] && ffmpegthumbnailer -i "$1" -o "${TMP}.jpg" -s 0 + _show_sixel "${TMP}.jpg" ${WIDTH} ${HEIGHT} } _preview_image() { - convert -- "$1" "$TMP" - show-sixel "$TMP" ${WIDTH} ${HEIGHT} + [ ! -f "${TMP}.jpg" ] && convert -- "$1"'[0]' "${TMP}.jpg" + _show_sixel "${TMP}.jpg" ${WIDTH} ${HEIGHT} } case "$1" in # First check common extensions - *.png|*.jpg|*.bmp|*.jpeg|*.gif|*.xpm) show-sixel "$1" ${WIDTH} ${HEIGHT} ;; + *.png|*.jpg|*.bmp|*.jpeg|*.gif|*.xpm) _show_sixel "$1" ${WIDTH} ${HEIGHT} ;; *.avi|*.mp4|*.wmv|*.dat|*.3gp|*.vob|*.ogv|*.mkv|*.mpe?g|*.fl[icv]|*.m2v|*.webm|*.m?ts|*.r[am]|*.qt|*.divx|*.as[fx]|*.m4v|*.mov) _preview_video "$1" ;; # Then fallback to mimetypes *) @@ -27,8 +73,8 @@ case "$1" in image/*) _preview_image "$1" ;; application/font*|application/*opentype|font/*) - genfontimage "$1" "$TMP" - show-sixel "$TMP" ${WIDTH} ${HEIGHT} ;; + [ ! -f "${TMP}.jpg" ] && genfontimage "$1" "${TMP}.jpg" + _show_sixel "${TMP}.jpg" ${WIDTH} ${HEIGHT} ;; video/*) _preview_video "$1" ;; *) diff --git a/home/.config/vifm/scripts/preview_vifm b/home/.config/vifm/scripts/preview_vifm index 9df46ed..33303fb 100755 --- a/home/.config/vifm/scripts/preview_vifm +++ b/home/.config/vifm/scripts/preview_vifm @@ -34,7 +34,6 @@ case "$1" in then echo "" else - echo "\0" exa -1a --sort=type --color always --icons "$1" fi ;; application/zip | application/x-tar | application/x-rar | application/x-7z-compressed | application/x-xz | application/x-bzip2 | application/x-gzip) @@ -46,8 +45,7 @@ case "$1" in video/*) mediainfo "$1" || exiftool "$1" || fprobe -pretty "$1" 2>&1 ;; text/* | */xml) - # vifm doesn't support 24bit color for now - env -uCOLORTERM bat --style=plain --color=always "$1" ;; + bat --style=plain --color=always "$1" ;; *) echo '----- File Type Classification -----' && file --dereference --brief -- "$1" ;; esac ;; diff --git a/home/.config/vifm/scripts/show-sixel b/home/.config/vifm/scripts/show-sixel deleted file mode 100755 index bf6a34a..0000000 --- a/home/.config/vifm/scripts/show-sixel +++ /dev/null @@ -1,49 +0,0 @@ -#!/bin/sh - -# Stolen from vifm/vifm#419 - -if [ "$#" -ne 3 ] -then - echo "Usage: $0 filename width height" - exit 1 -fi - -pw=$(($2*8)) -ph=$(($3*21)) - -w=$(exiftool -m -p '$ImageWidth' "$1") -h=$(exiftool -m -p '$ImageHeight' "$1") - -height=auto -width=auto -if [ $pw -lt $w ] && [ $ph -lt $h ] -then - newh=$(echo "($h*$pw)/$w" | bc) - # neww=$(echo "($w*$ph)/$h" | bc) - - if [ $newh -le $ph ]; then - width=$pw - else - height=$ph - fi -elif [ $pw -lt $w ] -then - width=$pw -elif [ $ph -lt $h ] -then - height=$ph -fi - -# debugging stuff -# echo pw=$pw ph=$ph -# echo w=$w h=$h -# echo neww=$neww newh=$newh -# exec echo width=$width height=$height - -# account for GNU screen -if [ -n "$STY" ] -then - popt=-P -fi - -exec img2sixel $popt --width=$width --height=$height "$1" diff --git a/home/.config/vifm/vifmrc b/home/.config/vifm/vifmrc index 1ae02d8..1221530 100644 --- a/home/.config/vifm/vifmrc +++ b/home/.config/vifm/vifmrc @@ -5,7 +5,7 @@ set vicmd=nvim " Preview by default view -" set previewoptions=graphicsdelay:50000,hardgraphicsclear +set previewoptions=graphicsdelay:50000,hardgraphicsclear " This makes vifm perform file operations on its own instead of relying on " standard utilities like `cp`. While using `cp` and alike is a more universal @@ -25,7 +25,7 @@ set number set trash " This is how many directories to store in the directory history. -set history=100 +set history=1000 " Automatically resolve symbolic links on l or Enter (only for files). set nofollowlinks @@ -42,7 +42,7 @@ set undolevels=100 " Use Vim's format of help file (has highlighting and "hyperlinks"). " If you would rather use a plain text help file set novimhelp. -set vimhelp +set novimhelp " If you would like to run an executable file when you " press return on the file name set this. @@ -99,7 +99,7 @@ set slowfs=curlftpfs " set milleroptions=lsize:1,csize:3 " Set custom status line look -set statusline=" %t%[ -> %T%]%= %A %10u:%-7g %5E %5a %20d " +set statusline=' %t%[ -> %T%]%= %A %10u:%-7g %5E %5a %20d ' " Set custom ruler line look set rulerformat='%2l/%S%[ +%x%]' @@ -137,6 +137,7 @@ command! make !!make %a command! mkcd :mkdir %a | cd %a command! vgrep nvim "+grep %a" command! reload :write | restart +command! exif exiftool -all= -overwrite_original %f " fzf file command! fzf : let $FZF_RES = term('fzf --preview-window left --preview "$HOME/.local/bin/garbage/preview {} 2>/dev/null" 2>&0') @@ -211,7 +212,7 @@ filextype *.avi,*.mp4,*.wmv,*.dat,*.3gp,*.ogv,*.mkv,*.mpg,*.mpeg,*.vob, filextype *.html,*.htm,*.xhtml \ firefox %f &, \ qutebrowser %f &, -filetype *.html,*.htm,*.xhtml lynx %f +filetype *.html,*.htm,*.xhtml nvim %f " Object filetype *.o nm %f | less @@ -310,30 +311,27 @@ filextype *.pro qtcreator %f & " mbox filetype *.mbox neomutt -f -" Directories -filextype */ - \ pcmanfm %f &, -filextype [\.]*/ - \ pcmanfm %f &, - " filextype * xdg-open " ------------------------------------------------------------------------------ -" if $TERM == 'foot' -" fileviewer ,