diff --git a/.gitignore b/.gitignore index 18eb675..625a96c 100644 --- a/.gitignore +++ b/.gitignore @@ -40,3 +40,4 @@ colorscheme.yml # taskwarrior taskwarrior/.config/task/task-sync.rc +taskwarrior/.config/task/contexts diff --git a/bash/.bash_profile b/bash/.bash_profile index c6c4f2a..483d4e6 100644 --- a/bash/.bash_profile +++ b/bash/.bash_profile @@ -10,19 +10,33 @@ export XDG_CONFIG_HOME=${XDG_CONFIG_HOME:-"$HOME/.config"} # load global sh env vars [ -f "$XDG_CONFIG_HOME/sh/env" ] && source "$XDG_CONFIG_HOME/sh/env" if [ -d "$XDG_CONFIG_HOME/sh/env.d" ]; then - for _env in "$XDG_CONFIG_HOME/sh/env.d"/*.sh; do - . "$_env" - done - unset _env + for _env in "$XDG_CONFIG_HOME/sh/env.d"/*.sh; do + . "$_env" + done + unset _env +fi +[ -f "$XDG_CONFIG_HOME/bash/env" ] && source "$XDG_CONFIG_HOME/bash/env" +if [ -d "$XDG_CONFIG_HOME/bash/env.d" ]; then + for _env in "$XDG_CONFIG_HOME/bash/env.d"/*.sh; do + . "$_env" + done + unset _env fi # load profile files vars [ -f "$XDG_CONFIG_HOME/sh/profile" ] && source "$XDG_CONFIG_HOME/sh/profile" if [ -d "$XDG_CONFIG_HOME/sh/profile.d" ]; then - for _profile in "$XDG_CONFIG_HOME/sh/profile.d"/*.sh; do - . "$_profile" - done - unset _profile + for _profile in "$XDG_CONFIG_HOME/sh/profile.d"/*.sh; do + . "$_profile" + done + unset _profile +fi +[ -f "$XDG_CONFIG_HOME/bash/profile" ] && source "$XDG_CONFIG_HOME/bash/profile" +if [ -d "$XDG_CONFIG_HOME/bash/profile.d" ]; then + for _profile in "$XDG_CONFIG_HOME/bash/profile.d"/*.sh; do + . "$_profile" + done + unset _profile fi # shellcheck disable=SC1090 diff --git a/bash/.bashrc b/bash/.bashrc index 28ee5e6..230b896 100644 --- a/bash/.bashrc +++ b/bash/.bashrc @@ -1,3 +1,4 @@ +#!/usr/bin/env bash # # ~/.bashrc # diff --git a/bash/.config/bash/env.d/bash-history-xdg.sh b/bash/.config/bash/env.d/bash-history-xdg.sh new file mode 100644 index 0000000..4484941 --- /dev/null +++ b/bash/.config/bash/env.d/bash-history-xdg.sh @@ -0,0 +1,6 @@ +#!/usr/bin/env bash + +export HISTFILE="${XDG_STATE_HOME}/bash/history" + +# bashrc, bash_profile, bash_logout currently unsupported +# see https://savannah.gnu.org/support/?108134 diff --git a/mail/.config/neomutt/settings b/mail/.config/neomutt/settings index 735c43a..0ad0317 100644 --- a/mail/.config/neomutt/settings +++ b/mail/.config/neomutt/settings @@ -61,7 +61,14 @@ set sort = threads set sort_re # thread based on regex below set reply_regex = "^(([Rr][Ee]?(\[[0-9]+\])?: *)?(\[[^]]+\] *)?)*" set quote_regex = "^( {0,4}[>|:#%]| {0,4}[A-Za-z0-9]+[>|]+)+" -set sort_aux = reverse-last-date-received +set sort_aux = last-date-received +#### Thread ordering +set use_threads=reverse +set sort='last-date' +set collapse_all = yes +set uncollapse_new = no +set thread_received = yes +set narrow_tree=no # set date_format = "%z/%m/%d %I:%M%p" # set date_format = "%m/%d" # set index_format = "%4C [%Z] %{%y/%b %d} %-20.20F %s" @@ -88,13 +95,6 @@ set menu_scroll = yes set tilde # show tildes for blank lines unset markers # no + markers for wrapped stuff set wrap = 90 -#### Thread ordering -set use_threads=reverse -set sort='last-date' -set collapse_all = yes -set uncollapse_new = no -set thread_received = yes -set narrow_tree=no # hide headers except for those explicitly unignored ignore * unignore From To Cc Bcc Date Subject Message-ID diff --git a/nvim/.config/nvim/init.lua b/nvim/.config/nvim/init.lua index 3001dfc..ad79d2c 100644 --- a/nvim/.config/nvim/init.lua +++ b/nvim/.config/nvim/init.lua @@ -1,6 +1,5 @@ --- much of this config comes from +-- many ideas for this config come from -- https://github.com/elianiva/dotfiles/ - with much gratitude -local augroup = require("helpers.augroup") local api = vim.api require('settings') @@ -9,34 +8,28 @@ require('look') require('maps') -- Highlight whatever is being yanked -augroup({ - { - 'TextYankPost', '*', - 'silent! lua require"vim.highlight".on_yank{timeout=500}' - } -}, 'highlightyanks') - --- Compile on plugin edits -augroup({{'BufWritePost', 'plugins.lua', 'PackerCompile'}}, 'compilepackages') +vim.api.nvim_create_autocmd({ "TextYankPost" }, { + command = 'silent! lua require"vim.highlight".on_yank{timeout=500}', + desc = "Highlight yanked text whenevery yanking something", + group = vim.api.nvim_create_augroup('highlightyanks', { clear = true }), +}) -- Special setting for editing gopass files - make sure nothing leaks outside the directories it is supposed to -augroup({ - { - 'BufNewFile,BufRead', '/dev/shm/gopass.*', - 'setlocal noswapfile nobackup noundofile nowritebackup viminfo=' - }, { - 'BufNewFile,BufRead', '/dev/shm/pass.?*/?*.txt', - 'setlocal noswapfile nobackup noundofile nowritebackup viminfo=' - }, { - 'BufNewFile,BufRead', '$TMPDIR/pass.?*/?*.txt', - 'setlocal noswapfile nobackup noundofile nowritebackup viminfo=' - }, { - 'BufNewFile,BufRead', '/tmp/pass.?*/?*.txt', - 'setlocal noswapfile nobackup noundofile nowritebackup viminfo=' - } -}, 'passnoleak') - --- fixing neovim opening up at same moment as alacritty (see https://github.com/neovim/neovim/issues/11330) -augroup({{'VimEnter', '*', 'silent exec "!kill -s SIGWINCH $PPID"'}}, 'fixsize') +vim.api.nvim_create_autocmd({ "BufNewFile", "BufRead" }, { + pattern = { "/dev/shm/gopass.*", "/dev/shm/pass.?*/?*.txt", "$TMPDIR/pass.?*/?*.txt", "/tmp/pass.?*/?*.txt" }, + command = 'setlocal noswapfile nobackup noundofile nowritebackup viminfo=', + desc = "Don't leak any information when editing potential password files", + group = vim.api.nvim_create_augroup('passnoleak', { clear = true }), +}) api.nvim_exec('runtime abbrev.vim', false) + +-- fixing neovim opening up at same moment as alacritty (see https://github.com/neovim/neovim/issues/11330) +vim.api.nvim_create_autocmd({ "VimEnter" }, { + callback = function() + local pid, WINCH = vim.fn.getpid(), vim.loop.constants.SIGWINCH + vim.defer_fn(function() vim.loop.kill(pid, WINCH) end, 20) + end, + desc = "Fix neovim sizing issues if opening same time as alacritty", + group = vim.api.nvim_create_augroup('alacritty_fixsize', { clear = true }), +}) diff --git a/nvim/.config/nvim/lua/plug/_format.lua b/nvim/.config/nvim/lua/plug/_format.lua index 815e837..85021e8 100644 --- a/nvim/.config/nvim/lua/plug/_format.lua +++ b/nvim/.config/nvim/lua/plug/_format.lua @@ -54,9 +54,12 @@ local formatters = { require('formatter').setup({logging = false, filetype = formatters}) +-- Format on save: -- gather filetypes to autocorrect for each activated formatter above -local filetype = "" -for k, _ in pairs(formatters) do filetype = filetype .. "," .. k end -augroup({ - {'FileType', filetype, 'autocmd', 'BufWritePost', '', 'FormatWrite'} -}, 'formatonsave') +for k, _ in pairs(formatters) do + vim.api.nvim_create_autocmd({"Filetype " .. k}, { + command = "autocmd BufWritePost FormatWrite", + desc = "Automatically format on write", + group = vim.api.nvim_create_augroup('formatonsave', {clear = true}) + }) +end diff --git a/nvim/.config/nvim/lua/plugins.lua b/nvim/.config/nvim/lua/plugins.lua index 770b1c0..a9ad28b 100644 --- a/nvim/.config/nvim/lua/plugins.lua +++ b/nvim/.config/nvim/lua/plugins.lua @@ -2,15 +2,16 @@ local install_path = vim.fn.stdpath("data") .. "/pack/packer/start/packer.nvim" if vim.fn.empty(vim.fn.glob(install_path)) > 0 then vim.cmd("!git clone https://github.com/wbthomason/packer.nvim " .. - install_path) + install_path) end -vim.api.nvim_exec([[ - augroup Packer - autocmd! - autocmd BufWritePost plugins.lua PackerCompile - augroup END -]], false) +-- Compile on plugin edits +vim.api.nvim_create_autocmd({ "BufWritePost" }, { + pattern = "plugins.lua", + command = "PackerCompile", + desc = "Compile plugins after editing plugin list", + group = vim.api.nvim_create_augroup('compilepackages', { clear = true }) +}) local use = require("packer").use require("packer").startup(function() diff --git a/qutebrowser/.config/qutebrowser/alias.py b/qutebrowser/.config/qutebrowser/alias.py index 60c6a18..0968d5a 100644 --- a/qutebrowser/.config/qutebrowser/alias.py +++ b/qutebrowser/.config/qutebrowser/alias.py @@ -14,9 +14,6 @@ c.aliases["add-shaarli"] = "spawn --userscript shaarli_add.sh" # re-opens the current page on the web archive overview page c.aliases["send-to-archive"] = "open https://web.archive.org/web/{url}" -# sends current page to outline and thus through readability mode -c.aliases["send-to-outline"] = "open https://outline.com/{url}" - # save current page to pdf file c.aliases["save_to_pdf"] = "spawn --userscript pagetopdf.sh" diff --git a/qutebrowser/.config/qutebrowser/maps.py b/qutebrowser/.config/qutebrowser/maps.py index 56061d3..6c09877 100644 --- a/qutebrowser/.config/qutebrowser/maps.py +++ b/qutebrowser/.config/qutebrowser/maps.py @@ -68,7 +68,6 @@ config.bind(";w", "hint links userscript wallabag_add.sh") # add link to wallab config.bind('"s', "add-shaarli", mode="normal") config.bind('"a', "send-to-archive", mode="normal") -config.bind('"o', "send-to-outline", mode="normal") config.bind('"t', "translate-page-google", mode="normal") config.bind('"T', "translate-selection-google", mode="normal") diff --git a/sh/.config/sh/alias b/sh/.config/sh/alias index 2a28d55..a6a247c 100644 --- a/sh/.config/sh/alias +++ b/sh/.config/sh/alias @@ -24,12 +24,12 @@ alias :q="exit" # ls defaults if exist exa; then - alias l="exa -l --git --git-ignore" - alias L="exa -hal --grid --git" + alias l="exa -l --git --git-ignore --group-directories-first" + alias L="exa -hal --grid --git --group-directories-first" # a recursive tree # - usually want to change levels recursed with -L2 -L3 or similar - alias ll="exa --tree -L2" - alias LL="exa -a --tree -L2" + alias ll="exa --tree -L2 --group-directories-first" + alias LL="exa -a --tree -L2 --group-directories-first" else alias l="ls -lhF" alias L="ls -lAhF" diff --git a/sh/.config/sh/env b/sh/.config/sh/env index 8e8a25f..db99a4e 100644 --- a/sh/.config/sh/env +++ b/sh/.config/sh/env @@ -6,9 +6,6 @@ # shellcheck source=xdg [ -f ~/.config/sh/xdg ] && . ~/.config/sh/xdg -# anything on BIN_HOME should be executable form anywhere -export PATH="$PATH:$XDG_BIN_HOME" - ############################### ## BEGIN GLOBAL ENV VARS ## ############################### diff --git a/sh/.config/sh/xdg b/sh/.config/sh/xdg index bfac400..8738649 100644 --- a/sh/.config/sh/xdg +++ b/sh/.config/sh/xdg @@ -18,12 +18,12 @@ test "$XDG_CACHE_HOME" || export XDG_CACHE_HOME="$HOME/.cache" test "$XDG_CONFIG_HOME" || export XDG_CONFIG_HOME="$HOME/.config" test "$XDG_DATA_HOME" || export XDG_DATA_HOME="$HOME/.local/share" +test "$XDG_STATE_HOME" || export XDG_STATE_HOME="$HOME/.local/state" # Desktop environment XDG variables - mimics `xdg-user-dirs` settings, only lowercased and not localized test "$XDG_DESKTOP_DIR" || export XDG_DESKTOP_DIR="$HOME/desktop" test "$XDG_DOCUMENTS_DIR" || export XDG_DOCUMENTS_DIR="$HOME/documents" test "$XDG_DOWNLOAD_DIR" || export XDG_DOWNLOAD_DIR="$HOME/downloads" -test "$XDG_PROJECTS_DIR" || export XDG_PROJECTS_DIR="$HOME/projects" export XDG_MUSIC_DIR="$HOME/media/audio/music" export XDG_PICTURES_DIR="$HOME/pictures" @@ -31,7 +31,10 @@ export XDG_VIDEOS_DIR="$HOME/videos" ## Non-Standard additions # non-standard, is added to path to enable execution of any files herein +test "$XDG_PROJECTS_DIR" || export XDG_PROJECTS_DIR="$HOME/projects" test "$XDG_BIN_HOME" || export XDG_BIN_HOME="$HOME/.local/bin" +# anything on BIN_HOME should be executable form anywhere +export PATH="$PATH:$XDG_BIN_HOME" xdg_isThere() { if [ -e "$1" ] || [ -h "$1" ]; then @@ -64,6 +67,31 @@ xdg_isThere "$XDG_PROJECTS_DIR" || xdg_makeForUser "$XDG_PROJECTS_DIR" unset -f xdg_isThere xdg_makeForUser ## Applications that can be set through environment variables +export ANDROID_HOME="$XDG_DATA_HOME/android" +export ATOM_HOME="$XDG_DATA_HOME/atom" +export CARGO_HOME="$XDG_DATA_HOME/cargo" +export DOCKER_CONFIG="$XDG_CONFIG_HOME/docker" +export GEM_HOME="$XDG_DATA_HOME/gem" +export GEM_SPEC_CACHE="$XDG_CACHE_HOME/gem" +export GNUPGHOME="$XDG_DATA_HOME/gnupg" +export GRADLE_USER_HOME="$XDG_DATA_HOME/gradle" +export GRIPHOME="$XDG_CONFIG_HOME/grip" +export IMAPFILTER_HOME="$XDG_CONFIG_HOME/imapfilter" +export IPYTHONDIR="$XDG_CONFIG_HOME/ipython" +export KDEHOME="$XDG_CONFIG_HOME/kde" +export KODI_DATA="$XDG_DATA_HOME/kodi" +export LESSHISTFILE="XDG_STATE_HOME/lesshst" +export MPLAYER_HOME="$XDG_CONFIG_HOME/mplayer" +export NODE_REPL_HISTORY="$XDG_STATE_HOME/node_repl_history" export NVM_DIR="$XDG_DATA_HOME/nvm" +export PYTHONSTARTUP="$XDG_CONFIG_HOME/python/pythonrc" +export SQLITE_HISTORY="$XDG_STATE_HOME/sqlite_history" +export TEXMFVAR="$XDG_CACHE_HOME/texlive/texmf-var" export TMUX_PLUGIN_MANAGER_PATH="$XDG_DATA_HOME/tmux" +export VAGRANT_HOME="$XDG_DATA_HOME/vagrant" +export WINEPREFIX="$XDG_DATA_HOME/wine" export ZDOTDIR="$XDG_CONFIG_HOME/zsh" +export _JAVA_OPTIONS=-Djava.util.prefs.userRoot="$XDG_CONFIG_HOME"/java + +alias yarn='yarn --use-yarnrc "$XDG_CONFIG_HOME/yarn/config"' +alias wget='wget --hsts-file="$XDG_STATE_HOME/wget-hsts"' diff --git a/taskwarrior/.config/task/taskopenrc b/taskwarrior/.config/task/taskopenrc index 7b5466d..d711088 100644 --- a/taskwarrior/.config/task/taskopenrc +++ b/taskwarrior/.config/task/taskopenrc @@ -4,7 +4,7 @@ path_ext = /usr/share/taskopen/scripts [Actions] notes.regex = "Note" -notes.command = "$EDITOR ${XDG_DATA_HOME:-~/.local/share}/task/notes/$UUID.txt" +notes.command = "$EDITOR ${XDG_DATA_HOME:-~/.local/share}/task/notes/$UUID.md" [CLI] diff --git a/taskwarrior/.config/task/taskrc b/taskwarrior/.config/task/taskrc index 1077e86..2b2f55d 100644 --- a/taskwarrior/.config/task/taskrc +++ b/taskwarrior/.config/task/taskrc @@ -60,6 +60,12 @@ urgency.annotations.coefficient=0 urgency.user.tag.maybe.coefficient=-100.0 urgency.user.tag.next.coefficient=5.0 +# things that are blocking simply have to be done before +# being able to do the blocked thing. This ensures that. +urgency.blocked.coefficient=0.0 +urgency.blocking.coefficient=0.0 +urgency.inherit=1 + # Holidays for calendar include /usr/share/doc/task/rc/holidays.de-DE.rc @@ -69,6 +75,9 @@ include colorscheme # Taskserver sync settings include task-sync.rc +# My personal tw contexts (e.g. work/personal) +include contexts + # try to fix some color weirdness, especially in tmux # color.scheduled=on grey @@ -82,8 +91,4 @@ report._reviewed.columns=uuid report._reviewed.sort=reviewed+,modified+ report._reviewed.filter=( reviewed.none: or reviewed.before:now-6days ) and ( +PENDING or +WAITING ) -# different life contexts -context.arbeit.read=project:arbeit -context.arbeit.write=project:arbeit -context.personal.read=project.hasnt:arbeit news.version=2.6.0 diff --git a/zsh/.config/zsh/.zshrc b/zsh/.config/zsh/.zshrc index 62be501..efd8c82 100644 --- a/zsh/.config/zsh/.zshrc +++ b/zsh/.config/zsh/.zshrc @@ -21,6 +21,7 @@ compinit PLUG_FOLDER="/usr/share/zsh/plugins" source /usr/share/oh-my-zsh/plugins/colored-man-pages/colored-man-pages.plugin.zsh source /usr/share/oh-my-zsh/plugins/command-not-found/command-not-found.plugin.zsh +source /usr/share/fzf/key-bindings.zsh #source /usr/share/nvm/init-nvm.sh [ -e $PLUG_FOLDER/fzf-tab/fzf-tab.plugin.zsh ] && source $PLUG_FOLDER/fzf-tab/fzf-tab.plugin.zsh # these need to be sourced after fzf-tab @@ -30,21 +31,12 @@ source /usr/share/oh-my-zsh/plugins/command-not-found/command-not-found.plugin.z unset PLUG_FOLDER # simple fzf-tab settings -FZF_TAB_COMMAND=( - fzf - --ansi # Enable ANSI color support, necessary for showing groups - --expect='$continuous_trigger,$print_query' # For continuous completion and print query - '--color=hl:$(( $#headers == 0 ? 108 : 255 ))' - --nth=2,3 --delimiter='\x00' # Don't search prefix - --layout=reverse --height='${FZF_TMUX_HEIGHT:=75%}' - --tiebreak=begin -m --bind=tab:down,btab:up,change:top,ctrl-space:toggle --cycle - '--query=$query' # $query will be expanded to query string at runtime. - '--header-lines=$#headers' # $#headers will be expanded to lines of headers at runtime - --print-query -) -zstyle ':fzf-tab:*' command $FZF_TAB_COMMAND +zstyle ":fzf-tab:*" fzf-flags "--ansi" "--expect='$continuous_trigger,$print_query'" "--color=hl:$(($#headers == 0 ? 108 : 255))" "--nth=2,3" "--layout=reverse" "--height=${FZF_TMUX_HEIGHT:-75%}" "--tiebreak=begin" "-m" "--bind=tab:down,btab:up,change:top,ctrl-space:toggle" "--cycle" "--query=$query" "--header-lines=$#headers" "--print-query" + +zstyle ':fzf-tab:*' fzf-command fzf # format colorful groups for different completion actions zstyle ':completion:*:descriptions' format '[%d]' +zstyle ':fzf-tab:*' show-group brief # use input as query string when completing zlua zstyle ':fzf-tab:complete:_zlua:*' query-string input # (experimental, may change in the future) @@ -171,14 +163,14 @@ bindkey '^P' history-beginning-search-backward bindkey '^N' history-beginning-search-forward # search history backwards -bindkey '^r' history-incremental-search-backward +bindkey '^o' history-incremental-search-backward # cycle through history results bindkey -M isearch '^P' history-incremental-search-backward bindkey -M isearch '^N' history-incremental-search-forward # Send command to editor and back for execution zle -N edit-command-line -bindkey -M vicmd '^e' edit-command-line +bindkey '^e' edit-command-line # Deduplicate PATH - remove any duplicate entries from PATH # from: https://unix.stackexchange.com/questions/40749/remove-duplicate-path-entries-with-awk-command diff --git a/zsh/.zshenv b/zsh/.zshenv index 0f2caf2..dd930d3 100644 --- a/zsh/.zshenv +++ b/zsh/.zshenv @@ -3,4 +3,4 @@ # make zsh source the correct directory export XDG_CONFIG_HOME=${XDG_CONFIG_HOME:-"$HOME/.config"} -ZDOTDIR="$XDG_CONFIG_HOME/zsh" +ZDOTDIR="${XDG_CONFIG_HOME:-"$HOME/.config"}/zsh"