diff --git a/office/.config/task/taskopenrc b/office/.config/task/taskopenrc index d78ee56..9fea550 100644 --- a/office/.config/task/taskopenrc +++ b/office/.config/task/taskopenrc @@ -4,14 +4,14 @@ taskbin = task path_ext = /usr/share/taskopen/scripts [Actions] -note_custom_ext.regex = "^Note\\.(.*)" +note_custom_ext.regex = "^Note\\.?(.*)?" note_custom_ext.command = "$EDITOR ${XDG_DATA_HOME:-$HOME/.local/share}/task/notes/$UUID.$LAST_MATCH" notes.regex = "^Note" notes.command = "$EDITOR ${XDG_DATA_HOME:-$HOME/.local/share}/task/notes/$UUID.md" links.regex = "^https?://" -links.command = "xdg-open $FILE" +links.command = "open $FILE" mail.regex = "^<.*@.*>$" mail.command = "notmuch show mid:${FILE:1:-1}" diff --git a/office/.config/urlview/config b/office/.config/urlview/config index e13370a..c351d87 100644 --- a/office/.config/urlview/config +++ b/office/.config/urlview/config @@ -1 +1 @@ -COMMAND xdg-open +COMMAND open diff --git a/qutebrowser/config/redirects.py b/qutebrowser/config/redirects.py index 417e36c..1eb8ef0 100644 --- a/qutebrowser/config/redirects.py +++ b/qutebrowser/config/redirects.py @@ -46,6 +46,7 @@ redirects = { "yewtu.be", "iv.melmac.space", "iv.datura.network", + "piped.kavin.rocks", ], }, "lbry": { @@ -61,15 +62,28 @@ redirects = { "reddit": { "source": ["reddit.com"], "target": [ - "td.vern.cc", - "teddit.artemislena.eu", - "teddit.bus-hit.me", - "teddit.hostux.net", - "teddit.namazso.eu", - "teddit.net", - "teddit.pussthecat.org", - "teddit.sethforprivacy.com", + "teddit.ggc-project.de", + "teddit.kavin.rocks", "teddit.zaggy.nl", + "teddit.namazso.eu", + "teddit.nautolan.racing", + "teddit.tinfoil-hat.net", + "teddit.domain.glass", + "libreddit.kavin.rocks", + "safereddit.com", + "reddit.invak.id", + "reddit.simo.sh", + "libreddit.strongthany.cc", + "libreddit.domain.glass", + "libreddit.pussthecat.org", + "libreddit.kylrth.com", + "libreddit.privacydev.net", + "l.opnxng.com", + "libreddit.oxymagnesium.com", + "reddit.utsav2.dev", + "libreddit.freedit.eu", + "lr.artemislena.eu", + "snoo.habedieeh.re", ], }, "twitter": { diff --git a/qutebrowser/scripts/recently-downloaded b/qutebrowser/scripts/recently-downloaded index b2a1c18..19dd925 100755 --- a/qutebrowser/scripts/recently-downloaded +++ b/qutebrowser/scripts/recently-downloaded @@ -93,9 +93,9 @@ if [ "${#entries[@]}" -eq 0 ]; then die "Download directory »${DOWNLOAD_DIR}« empty" fi -line=$(printf '%s\n' "${entries[@]}" \ - | crop-first-column \ - | $ROFI_CMD "${ROFI_ARGS[@]}") || true +line=$(printf '%s\n' "${entries[@]}" | + crop-first-column | + $ROFI_CMD "${ROFI_ARGS[@]}") || true if [ -z "$line" ]; then exit 0 fi @@ -111,4 +111,8 @@ fi msg info "Opening »$line« (of type $filetype) with ${application%.desktop}" -xdg-open "$path" & +if type open >/dev/null 2>&1; then + open "$path" & +else + xdg-open "$path" & +fi diff --git a/sh/.config/sh/alias b/sh/.config/sh/alias index 42dda26..bc94a82 100644 --- a/sh/.config/sh/alias +++ b/sh/.config/sh/alias @@ -57,31 +57,15 @@ alias myip="curl -s icanhazip.com" if exist fzf; then # Display fuzzy-searchable history alias fzfhistory="history -l -E -D 0 | fzf --tac --height 20" - fzfman() { + fzman() { man "$(apropos --long "$1" | fzf | awk '{print $2, $1}' | tr -d '()')" } - # Fuzzy search packages to install - if exist yay; then - fzf_pkg_tool=yay - elif exist paru; then - fzf_pkg_tool=paru - elif exist pacman; then - fzf_pkg_tool=pacman - fi - # shellcheck disable=2139 # we *want* this to be done at shell startup instead of dynamically - if [ -n "$fzf_pkg_tool" ]; then - alias fzfyay="$fzf_pkg_tool -Slq | fzf -m --preview '$fzf_pkg_tool -Si {1}' | xargs -ro $fzf_pkg_tool -S" - # Fuzzy uninstall packages - alias fzfyayrns="$fzf_pkg_tool -Qeq | fzf -m --preview '$fzf_pkg_tool -Qi {1}' | xargs -ro $fzf_pkg_tool -Rns" - fi - unset fzf_pkg_tool - # ripgrep-all to fzf search through any documents if exist rga; then - fzfrga() { + fzrga() { RG_PREFIX="rga --files-with-matches" - xdg-open "$( + open "$( FZF_DEFAULT_COMMAND="$RG_PREFIX '$1'" \ fzf --sort --preview="[[ ! -z {} ]] && rga --pretty --context 5 {q} {}" \ --phony -q "$1" \ @@ -90,6 +74,13 @@ if exist fzf; then )" } fi + + # quickly fzy search a sqlite database result + if exist sqlite3; then + fzql() { + sqlite3 -header "$1" "$2" | fzf --header-lines=1 --layout=reverse --multi --prompt='fzql> ' + } + fi fi # vifm diff --git a/sh/.local/bin/open b/sh/.local/bin/open new file mode 100755 index 0000000..e3bed8f --- /dev/null +++ b/sh/.local/bin/open @@ -0,0 +1,8 @@ +#!/usr/bin/env sh +# file opener using your preferred applications + +if exist mimeo; then + mimeo "$1" +elif exist xdg-open; then + xdg-open "$1" +fi diff --git a/terminal/.config/vifm/favicons.vifm b/terminal/.config/vifm/favicons.vifm new file mode 100644 index 0000000..41664ab --- /dev/null +++ b/terminal/.config/vifm/favicons.vifm @@ -0,0 +1,88 @@ +" Ranger devicons for ViFM +" https://github.com/cirala/vifm_devicons +" +" Filetypes/directories + +" Specific directories +set classify+=' :dir:/, :exe:, :reg:, :link:,? :?:, ::../::/, + \  ::.git/::/, + \  ::.config/,,Makefile::/, + \  ::Desktop/::/, + \  ::Documents/::/, + \  ::Development/::/, + \  ::Downloads/::/, + \  ::Dropbox/::/, + \  ::Nextcloud/::/, + \  ::Google\ Drive/::/, + \  ::gitrepos/::/, + \  ::Music/::/, + \  ::Pictures/::/, + \  ::Public/::/, + \  ::Templates/::/, + \  ::Videos/::/, + \  ::Zotero/::/, + \  ::node_modules/::/' + +" Specific files +set classify+=' ::.Xdefaults,,.Xresources,,.bashprofile,,.bash_profile,,.bashrc,,.dmrc,,.d_store,,.fasd,,.gitconfig,,.gitignore,,.jack-settings,,.mime.types,,.nvidia-settings-rc,,.pam_environment,,.profile,,.recently-used,,.selected_editor,,.xinitpurc,,.zprofile,,.yarnc,,.snclirc,,.tmux.conf,,.urlview,,.config,,.ini,,.user-dirs.dirs,,.mimeapps.list,,.offlineimaprc,,.msmtprc,,.Xauthority,,config::/, + \  ::favicon.*,,README,,readme::/, + \  ::.vim,,.vimrc,,.gvimrc,,.vifm::/, + \  ::gruntfile.coffee,,gruntfile.js,,gruntfile.ls::/, + \  ::gulpfile.coffee,,gulpfile.js,,gulpfile.ls::/, + \  ::ledger,,*.beancount::/, + \  ::license,,copyright,,copying,,LICENSE,,COPYRIGHT,,COPYING::/, + \  ::react.jsx::' + +" File extensions +set classify+='λ ::*.ml,,*.mli::/, + \  ::*.styl::/, + \  ::*.scss::/, + \  ::*.py,,*.pyc,,*.pyd,,*.pyo::/, + \  ::*.php::/, + \  ::*.markdown,,*.md::/, + \  ::*.json::/, + \  ::*.js::/, + \  ::*.bmp,,*.gif,,*.ico,,*.jpeg,,*.jpg,,*.png,,*.svg,,*.svgz,,*.tga,,*.tiff,,*.xmb,,*.xcf,,*.xpm,,*.xspf,,*.xwd,,*.cr2,,*.dng,,*.3fr,,*.ari,,*.arw,,*.bay,,*.crw,,*.cr3,,*.cap,,*.data,,*.dcs,,*.dcr,,*.drf,,*.eip,,*.erf,,*.fff,,*.gpr,,*.iiq,,*.k25,,*.kdc,,*.mdc,,*.mef,,*.mos,,*.mrw,,*.obm,,*.orf,,*.pef,,*.ptx,,*.pxn,,*.r3d,,*.raf,,*.raw,,*.rwl,,*.rw2,,*.rwz,,*.sr2,,*.srf,,*.srw,,*.tif,,*.x3f,,*.webp,,*.avif,,*.jxl::/, + \  ::*.ejs,,*.htm,,*.html,,*.slim,,*.xml::/, + \  ::*.mustasche::/, + \  ::*.css,,*.less,,*.bat,,*.conf,,*.ini,,*.rc,,*.yml,,*.cfg::/, + \  ::*.rss::/, + \  ::*.coffee::/, + \  ::*.twig::/, + \  ::*.c++,,*.cpp,,*.cxx,,*.h::/, + \  ::*.cc,,*.c::/, + \  ::*.hs,,*.lhs::/, + \  ::*.lua::/, + \  ::*.jl::/, + \  ::*.go::/, + \  ::*.ts::/, + \  ::*.db,,*.dump,,*.sql::/, + \  ::*.sln,,*.suo::/, + \  ::*.exe::/, + \  ::*.diff,,*.sum,,*.md5,,*.sha512::/, + \  ::*.scala::/, + \  ::*.java,,*.jar::/, + \  ::*.xul::/, + \  ::*.clj,,*.cljc::/, + \  ::*.pl,,*.pm,,*.t::/, + \  ::*.cljs,,*.edn::/, + \  ::*.rb::/, + \  ::*.fish,,*.sh,,*.bash::/, + \  ::*.dart::/, + \  ::*.f#,,*.fs,,*.fsi,,*.fsscript,,*.fsx::/, + \  ::*.rlib,,*.rs::/, + \  ::*.d::/, + \  ::*.erl,,*.hrl::/, + \  ::*.ai::/, + \  ::*.psb,,*.psd::/, + \  ::*.jsx::/, + \  ::*.aac,,*.anx,,*.asf,,*.au,,*.axa,,*.flac,,*.m2a,,*.m4a,,*.mid,,*.midi,,*.mp3,,*.mpc,,*.oga,,*.ogg,,*.ogx,,*.ra,,*.ram,,*.rm,,*.spx,,*.wav,,*.wma,,*.ac3::/, + \  ::*.avi,,*.flv,,*.mkv,,*.mov,,*.mp4,,*.mpeg,,*.mpg,,*.webm,,*.av1::/, + \  ::*.epub,,*.pdf,,*.fb2,,*.djvu::/, + \  ::*.7z,,*.apk,,*.bz2,,*.cab,,*.cpio,,*.deb,,*.gem,,*.gz,,*.gzip,,*.lh,,*.lzh,,*.lzma,,*.rar,,*.rpm,,*.tar,,*.tgz,,*.xz,,*.zip,,*.zst::/, + \  ::*.cbr,,*.cbz::/, + \  ::*.log::/, + \  ::*.doc,,*.docx,,*.adoc::/, + \  ::*.xls,,*.xlsmx::/, + \  ::*.pptx,,*.ppt::/, + \  ::*.sqlite,,*.db::' diff --git a/terminal/.config/vifm/vifmrc b/terminal/.config/vifm/vifmrc index a55a795..0375b97 100644 --- a/terminal/.config/vifm/vifmrc +++ b/terminal/.config/vifm/vifmrc @@ -1,4 +1,4 @@ -" vim: filetype=vifm : set foldmethod=marker foldlevel=0 nomodeline: +" vim: filetype=vim : set foldmethod=marker foldlevel=0 nomodeline: " Sample configuration file for vifm (last updated: 20 July, 2018) " You can edit this file by hand. " The " character at the beginning of a line comments out the line. @@ -23,6 +23,15 @@ set vicmd=nvim " doesn't support progress measuring. set syscalls +" disable 'compatibility' options, by default kept for legacy I suppose? +" Turning it off: +" Makes dd/DD/yy only work on currently highlighted file, use ds/Ds/ys for +" working on selected files (or dS, DS, yS for inversion). +" Makes tab not automatically switch panels. +" Makes permanent filter commands act differently, no clue haven't really made +" use of them yet. +set cpoptions= + " Trash Directory " The default is to move files that are deleted with dd or :d to " the trash directory. If you change this you will not be able to move @@ -31,6 +40,7 @@ set syscalls " This probably shouldn't be an option. set trash set trashdir=$XDG_DATA_HOME/Trash +set confirm-=delete " This is how many directories to store in the directory history. set history=100 @@ -158,20 +168,32 @@ command! mkcd :mkdir %a | cd %a command! syncme :cd %D command! fzfhome : set noquickview - \| let $FZF_PICK = term('locate $HOME | fzf 2>/dev/tty') + \| let $FZF_PICK = term('fd . $HOME | fzf 2>/dev/tty') \| if $FZF_PICK != '' \| execute 'goto' fnameescape($FZF_PICK) \| endif command! fzf : set noquickview - \| let $FZF_PICK = term('find | fzf 2>/dev/tty') + \| let $FZF_PICK = term('fd | fzf 2>/dev/tty') \| if $FZF_PICK != '' \| execute 'goto' fnameescape($FZF_PICK) \| endif -command! fzfcd : set noquickview - \| let $FZF_PICK = term('find -type d | fzf 2>/dev/tty') +command! fzfcdhome : set noquickview + \| let $FZF_PICK = term('fd -td . $HOME | fzf 2>/dev/tty') \| if $FZF_PICK != '' \| execute 'cd' fnameescape($FZF_PICK) \| endif +command! fzfcd : set noquickview + \| let $FZF_PICK = term('fd -td | fzf 2>/dev/tty') + \| if $FZF_PICK != '' + \| execute 'cd' fnameescape($FZF_PICK) + \| endif +" show or hide the devicon prefix for files +command! toggleicons : + \| if &classify == '' + \| source $VIFM/favicons.vifm + \| else + \| set classify='' + \| endif " }}} " vifminfo {{{ " ------------------------------------------------------------------------------ @@ -205,11 +227,15 @@ nmap Q :q " Sample mappings " for now they use space for my leader key - so we can't switch panels with " space, use tab for that -"nnoremap -nnoremap +nmap +nnoremap -" quick find mirroring my vim filefinder -nnoremap f :FZFfind +" switch pane with tab, like cpoption did +nnoremap w + +" scroll through command-line options with C-p/C-n +cnoremap +cnoremap " Start shell in current directory nnoremap s :shell @@ -230,8 +256,8 @@ nnoremap gb :file &l " create a tab nnoremap t :tabnew -" yank current directory path into the clipboard " clip is universal clipper from `sh` module +" yank current directory path into the clipboard nnoremap yd :!echo -n %d | clip %i " yank current file path into the clipboard nnoremap yf :!echo -n %c:p | clip %i @@ -248,12 +274,12 @@ nnoremap A cw nnoremap cw cW nnoremap cW cw -" Open editor to edit vifmrc and apply settings after returning to vifm -nnoremap V :write | edit $MYVIFMRC | restart - " esc quits out of preview mode (it does in vim, why not here?) qnoremap q +" quickly show alternative file opening applications +nnoremap o :file + " Select file and jump in the indicated direction nnoremap J tj nnoremap K tk @@ -269,10 +295,7 @@ nnoremap tN :windo toggle number nnoremap tR :windo toggle relativenumber nnoremap te :execute ':tree! | echo ":tree"' nnoremap tt t - -" zo shows hidden files, mimicking fold open in vim -- why does zc not close -" again? -nnoremap zc zm +nnoremap ti :toggleicons " external commands " extract currently selected file(s) @@ -288,8 +311,10 @@ noremap ,pc :!pdftk %f cat output output.pdf " fzf movements nnoremap f :fzf +nnoremap F :fzfhome nnoremap c :fzfcd -nnoremap F :grep +nnoremap C :fzfcdhome +nnoremap w :grep " preview thumbnails of current folder " select thumbnails with m/M in nsxiv @@ -307,28 +332,14 @@ noremap w : if layoutis('only') \| " }}} -" Classify (Icons) {{{ -" file types -set classify=' :dir:/, :exe:, :reg:, :link:' -" various file names -set classify+=' ::../::, ::*.sh::, ::*.[hc]pp::, ::*.[hc]::, ::/^copying|license$/::, ::.git/,,*.git/::, ::*.epub,,*.fb2,,*.djvu::, ::*.pdf::, ::*.htm,,*.html,,**.[sx]html,,*.xml::' -" archives -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::' -" images -set classify+=' ::*.bmp,,*.gif,,*.jpeg,,*.jpg,,*.ico,,*.png,,*.ppm,,*.svg,,*.svgz,,*.tga,,*.tif,,*.tiff,,*.xbm,,*.xcf,,*.xpm,,*.xspf,,*.xwd::' -" audio -set classify+=' ::*.aac,,*.anx,,*.asf,,*.au,,*.axa,,*.flac,,*.m2a,,*.m4a,,*.mid,,*.midi,,*.mp3,,*.mpc,,*.oga,,*.ogg,,*.ogx,,*.ra,,*.ram,,*.rm,,*.spx,,*.wav,,*.wma,,*.ac3::' -" media -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::' -" office files -set classify+=' ::*.doc,,*.docx::, ::*.xls,,*.xls[mx]::, ::*.pptx,,*.ppt::' -" }}} -" " ------------------------------------------------------------------------------ " Filetypes {{{ " ------------------------------------------------------------------------------ +" give pretty nerdfont-devicon icons to most files +source $VIFM/favicons.vifm + " The file type is for the default programs to be used with " a file extension. " :filetype pattern1,pattern2 defaultprogram,program2 @@ -356,12 +367,13 @@ set classify+=' ::*.doc,,*.docx::, ::*.xls,,*.xls[mx]::, ::*.pptx,,*.pp " program. " Pdf -filextype *.pdf +filextype ,*.pdf \ { view as rich file } \ sioyek %c %i, zathura %c %i &, apvlv %c, xpdf %c, \ { edit text content } \ pdftotext -nopgbrk %c - | nvim -fileviewer *.pdf pdftotext -nopgbrk %c - +filextype ,*.pdf + \ pdftotext -nopgbrk %c - " PostScript filextype *.ps,*.eps,*.ps.gz @@ -453,6 +465,11 @@ filextype *.ora \ {Edit in MyPaint} \ mypaint %f, +" OpenRaster +filetype *.sqlite,*.db + \ {Edit in sqlite3} + \ sqlite3 %f, + " tabular data filextype *.csv \ {Open with visidata} @@ -576,6 +593,9 @@ fileviewer *.md " use custom viewer script for rest fileviewer * vifm-default-viewer %c +" use our own custom opener +filetype * open + " Syntax highlighting in preview " " Explicitly set highlight type for some extensions diff --git a/terminal/.config/wezterm/maps.lua b/terminal/.config/wezterm/maps.lua index 4f749ed..74cc6bd 100644 --- a/terminal/.config/wezterm/maps.lua +++ b/terminal/.config/wezterm/maps.lua @@ -65,6 +65,7 @@ local keys = { }), }, { key = "f", mods = "LEADER", action = act.QuickSelect }, + -- open web link { key = "F", mods = "LEADER", diff --git a/terminal/.config/zsh/.zshrc b/terminal/.config/zsh/.zshrc index 180def1..35d5659 100644 --- a/terminal/.config/zsh/.zshrc +++ b/terminal/.config/zsh/.zshrc @@ -192,14 +192,6 @@ get_var() { set_var() { eval "$1=\"\$2\"" } -dedup_pathvar() { - pathvar_name="$1" - pathvar_value="$(get_var "$pathvar_name")" - deduped_path="$(perl -e 'print join(":",grep { not $seen{$_}++ } split(/:/, $ARGV[0]))' "$pathvar_value")" - set_var "$pathvar_name" "$deduped_path" -} -dedup_pathvar PATH -dedup_pathvar MANPATH unset CONFDIR unset ZSHCONFDIR diff --git a/writing/.config/pubs/pubsrc b/writing/.config/pubs/pubsrc index 018dddd..a47a201 100644 --- a/writing/.config/pubs/pubsrc +++ b/writing/.config/pubs/pubsrc @@ -12,7 +12,7 @@ docsdir = ~/documents/library/doc doc_add = copy # the command to use when opening document files -open_cmd = xdg-open +open_cmd = open # which editor to use when editing bibtex files. # if using a graphical editor, use the --wait or --block option, i.e.: diff --git a/writing/.local/bin/rofi-bib-due b/writing/.local/bin/rofi-bib-due index 2577832..47406e1 100755 --- a/writing/.local/bin/rofi-bib-due +++ b/writing/.local/bin/rofi-bib-due @@ -26,4 +26,4 @@ key=$(echo "$choice" | sed -E 's/.*\((\w+)\)$/\1/') library="$(dirname "$(realpath "$BIBFILE")")/pdf" # find and open the key-associated pdf file -${FILEREADER:-xdg-open} "$(find "$library" -type f -name "$key *.pdf")" +${FILEREADER:-open} "$(find "$library" -type f -name "$key *.pdf")"