Compare commits

..

No commits in common. "80f2afb1cfa798d4fe05bb649f5980f154130a9e" and "dfaed8c9dde388490bf5d224afd588615abec0e5" have entirely different histories.

12 changed files with 80 additions and 198 deletions

View file

@ -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 = "open $FILE"
links.command = "xdg-open $FILE"
mail.regex = "^<.*@.*>$"
mail.command = "notmuch show mid:${FILE:1:-1}"

View file

@ -1 +1 @@
COMMAND open
COMMAND xdg-open

View file

@ -46,7 +46,6 @@ redirects = {
"yewtu.be",
"iv.melmac.space",
"iv.datura.network",
"piped.kavin.rocks",
],
},
"lbry": {
@ -62,28 +61,15 @@ redirects = {
"reddit": {
"source": ["reddit.com"],
"target": [
"teddit.ggc-project.de",
"teddit.kavin.rocks",
"teddit.zaggy.nl",
"td.vern.cc",
"teddit.artemislena.eu",
"teddit.bus-hit.me",
"teddit.hostux.net",
"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",
"teddit.net",
"teddit.pussthecat.org",
"teddit.sethforprivacy.com",
"teddit.zaggy.nl",
],
},
"twitter": {

View file

@ -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,8 +111,4 @@ fi
msg info "Opening »$line« (of type $filetype) with ${application%.desktop}"
if type open >/dev/null 2>&1; then
open "$path" &
else
xdg-open "$path" &
fi

View file

@ -57,15 +57,31 @@ 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"
fzman() {
fzfman() {
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
fzrga() {
fzfrga() {
RG_PREFIX="rga --files-with-matches"
open "$(
xdg-open "$(
FZF_DEFAULT_COMMAND="$RG_PREFIX '$1'" \
fzf --sort --preview="[[ ! -z {} ]] && rga --pretty --context 5 {q} {}" \
--phony -q "$1" \
@ -74,13 +90,6 @@ 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

View file

@ -1,8 +0,0 @@
#!/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

View file

@ -1,88 +0,0 @@
" 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::'

View file

@ -1,4 +1,4 @@
" vim: filetype=vim : set foldmethod=marker foldlevel=0 nomodeline:
" vim: filetype=vifm : 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,15 +23,6 @@ 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
@ -40,7 +31,6 @@ set cpoptions=
" 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
@ -168,32 +158,20 @@ command! mkcd :mkdir %a | cd %a
command! syncme :cd %D
command! fzfhome : set noquickview
\| let $FZF_PICK = term('fd . $HOME | fzf 2>/dev/tty')
\| let $FZF_PICK = term('locate $HOME | fzf 2>/dev/tty')
\| if $FZF_PICK != ''
\| execute 'goto' fnameescape($FZF_PICK)
\| endif
command! fzf : set noquickview
\| let $FZF_PICK = term('fd | fzf 2>/dev/tty')
\| let $FZF_PICK = term('find | fzf 2>/dev/tty')
\| if $FZF_PICK != ''
\| execute 'goto' fnameescape($FZF_PICK)
\| endif
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')
\| let $FZF_PICK = term('find -type d | 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 {{{
" ------------------------------------------------------------------------------
@ -227,15 +205,11 @@ nmap Q :q<cr>
" Sample mappings
" for now they use space for my leader key - so we can't switch panels with
" space, use tab for that
nmap <space> <nop>
nnoremap <space><space> <nop>
"nnoremap <space> <nop>
nnoremap <space><space> <space>
" switch pane with tab, like cpoption did
nnoremap <tab> <c-w>w
" scroll through command-line options with C-p/C-n
cnoremap <c-p> <s-tab>
cnoremap <c-n> <tab>
" quick find mirroring my vim filefinder
nnoremap <space>f :FZFfind<cr>
" Start shell in current directory
nnoremap s :shell<cr>
@ -256,8 +230,8 @@ nnoremap gb :file &<cr>l
" create a tab
nnoremap <space>t :tabnew<cr>
" clip is universal clipper from `sh` module
" yank current directory path into the clipboard
" clip is universal clipper from `sh` module
nnoremap yd :!echo -n %d | clip %i<cr>
" yank current file path into the clipboard
nnoremap yf :!echo -n %c:p | clip %i<cr>
@ -274,12 +248,12 @@ nnoremap A cw
nnoremap cw cW
nnoremap cW cw
" Open editor to edit vifmrc and apply settings after returning to vifm
nnoremap <space>V :write | edit $MYVIFMRC | restart<cr>
" esc quits out of preview mode (it does in vim, why not here?)
qnoremap <esc> q
" quickly show alternative file opening applications
nnoremap o :file <tab>
" Select file and jump in the indicated direction
nnoremap J tj
nnoremap K tk
@ -295,7 +269,10 @@ nnoremap tN :windo toggle number<cr>
nnoremap tR :windo toggle relativenumber<cr>
nnoremap te :execute ':tree! | echo ":tree"'<cr>
nnoremap tt t
nnoremap ti :toggleicons<cr>
" zo shows hidden files, mimicking fold open in vim -- why does zc not close
" again?
nnoremap zc zm
" external commands
" extract currently selected file(s)
@ -311,10 +288,8 @@ noremap ,pc :!pdftk %f cat output output.pdf
" fzf movements
nnoremap <space>f :fzf<cr>
nnoremap <space>F :fzfhome<cr>
nnoremap <space>c :fzfcd<cr>
nnoremap <space>C :fzfcdhome<cr>
nnoremap <space>w :grep<space>
nnoremap <space>F :grep<space>
" preview thumbnails of current folder
" select thumbnails with m/M in nsxiv
@ -332,14 +307,28 @@ noremap <silent> w : if layoutis('only')
\| <cr>
" }}}
" 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
@ -367,13 +356,12 @@ source $VIFM/favicons.vifm
" program.
" Pdf
filextype <application/pdf>,*.pdf
filextype *.pdf
\ { view as rich file }
\ sioyek %c %i, zathura %c %i &, apvlv %c, xpdf %c,
\ { edit text content }
\ pdftotext -nopgbrk %c - | nvim
filextype <application/pdf>,*.pdf
\ pdftotext -nopgbrk %c -
fileviewer *.pdf pdftotext -nopgbrk %c -
" PostScript
filextype *.ps,*.eps,*.ps.gz
@ -465,11 +453,6 @@ filextype *.ora
\ {Edit in MyPaint}
\ mypaint %f,
" OpenRaster
filetype *.sqlite,*.db
\ {Edit in sqlite3}
\ sqlite3 %f,
" tabular data
filextype *.csv
\ {Open with visidata}
@ -593,9 +576,6 @@ 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

View file

@ -65,7 +65,6 @@ local keys = {
}),
},
{ key = "f", mods = "LEADER", action = act.QuickSelect },
-- open web link
{
key = "F",
mods = "LEADER",

View file

@ -192,6 +192,14 @@ 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

View file

@ -12,7 +12,7 @@ docsdir = ~/documents/library/doc
doc_add = copy
# the command to use when opening document files
open_cmd = open
open_cmd = xdg-open
# which editor to use when editing bibtex files.
# if using a graphical editor, use the --wait or --block option, i.e.:

View file

@ -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:-open} "$(find "$library" -type f -name "$key *.pdf")"
${FILEREADER:-xdg-open} "$(find "$library" -type f -name "$key *.pdf")"