colorscheme nten16
set vicmd=nvim
set syscalls
view
set history=100
set nofollowlinks
set sortnumbers
set undolevels=100
set norunexec
set timefmt=%m/%d\ %H:%M
set wildmenu
set wildstyle=popup
set suggestoptions=normal,visual,view,otherpane,keys,marks,registers
set ignorecase
set smartcase
set nohlsearch
set incsearch
set scrolloff=4
set trashdir=$HOME/.local/share/Trash/files
set vifminfo=dhistory,chistory,state,shistory,phistory,fhistory,dirstack,registers,bookmarks,bmarks

" === commands
command! zip zip -r %f.zip %f
command! targz tar -czvf %f.tar.gz %f
set rulerformat=

" === Key maps
nmap q ZQ
nnoremap gg ggj
nnoremap ! :shell<cr>
nnoremap w :view<cr>
nnoremap S :sort<cr>
nnoremap se :!$HOME/bin/extract %f &<cr>
nnoremap sa :!zip -r %f.zip %f
nnoremap ss :!tar -czvf %f.tar.gz @f

" === files
filetype *.csv,*.xlsx libreoffice %c %i
fileviewer *.csv sed "s/,,,,/,,-,,/g;s/,,/ /g" %c | column -t | sed "s/ - /  /g" | cut -c -%pw

fileviewer *.html w3m -dump %c
filextype *.html,*.htm qutebrowser %f 2>/dev/null &

filetype <text/*> nvim
fileviewer <text/*> env -uCOLORTERM bat --color always --wrap never --pager never %c -p

filextype *.pdf zathura %c %i &
filetype <audio/*> mocp %c %i &
filetype <video/*> mpv %c %i &

filextype <image/*> sxiv %c %i &
fileviewer <image/*>
	\ kitty icat --place=%pwx%ph@%pxx%py %c 
	\ %pc
	\ kitty icat --clear

filextype *.py nvim %c %i &

fileviewer *.zip,*.jar zip -sf %c
fileviewer *.tgz,*.tar.gz tar -tzf %c
fileviewer *.tar tar -tf %c
fileviewer *.rar unrar v %c
fileviewer *.7z 7z l %c

fileviewer */ ls --color --group-directories-first
fileviewer .*/ ls --color --group-directories-first

filetype * xdg-open %c
fileviewer * file -b %c

" go keys 
nnoremap gh :cd ~<cr>
nnoremap gc :cd ~/Code<cr>
nnoremap gd :cd ~/Documents<cr>
nnoremap gb :cd ~/Documents/Books<cr>
nnoremap gm :cd ~/.dotfiles<cr>
nnoremap gn :cd ~/bin<cr>
nnoremap gz :cd ~/.script<cr>

" === file icons 
set classify='  :dir:/,  :exe:,  :reg:,  :link:'
set classify+='  ::../::,  ::*.sh::,  ::*.[hc]pp::,  ::*.[hc]::,  ::/^copying|license$/::,  ::.git/,,*.git/::,  ::*.epub,,*.fb2,,*.djvu::,  ::*.pdf::,  ::*.htm,,*.html,,**.[sx]html,,*.xml::'
set classify+='  ::*.7z,,*.ace,,*.arj,,*.bz2,,*.cpio,,*.deb,,*.dz,,*.gz,,*.jar,,*.lzh,,*.lzma,,*.rar,,*.rpm,,*.rz,,*.tar,,*.taz,,*.tb2,,*.tbz,,*.tbz2,,*.tgz,,*.tlz,,*.trz,,*.txz,,*.tz,,*.tz2,,*.xz,,*.z,,*.zip,,*.zoo::'
set classify+='  ::*.bmp,,*.gif,,*.jpeg,,*.jpg,,*.ico,,*.png,,*.ppm,,*.svg,,*.svgz,,*.tga,,*.tif,,*.tiff,,*.xbm,,*.xcf,,*.xpm,,*.xspf,,*.xwd::'
set classify+='  ::*.aac,,*.anx,,*.asf,,*.au,,*.axa,,*.flac,,*.m2a,,*.m4a,,*.mid,,*.midi,,*.mp3,,*.mpc,,*.oga,,*.ogg,,*.ogx,,*.ra,,*.ram,,*.rm,,*.spx,,*.wav,,*.wma,,*.ac3::'
set classify+='  ::*.avi,,*.ts,,*.axv,,*.divx,,*.m2v,,*.m4p,,*.m4v,,.mka,,*.mkv,,*.mov,,*.mp4,,*.flv,,*.mp4v,,*.mpeg,,*.mpg,,*.nuv,,*.ogv,,*.pbm,,*.pgm,,*.qt,,*.vob,,*.wmv,,*.xvid::'
set classify+='  ::*.doc,,*.docx::,  ::*.xls,,*.xls[mx]::,  ::*.pptx,,*.ppt::'
