dotfiles

Obligatory dotfiles repo
git clone git://git.danielmoch.com/dotfiles.git
Log | Files | Refs

commit 676942a3a8fb3534b60a86e18d2d4a12739ba57a
Author: Daniel Moch <daniel@danielmoch.com>
Date:   Sat, 23 Dec 2017 13:10:33 -0500

Initial commit

Diffstat:
A.bash_logout | 3+++
A.bash_profile | 5+++++
A.bashrc | 114+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
A.config/bash/git-prompt.sh | 534+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
A.config/bash/truecolor_test.sh | 100+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
A.config/forecastio/org.djmoch.forecastio.plist | 20++++++++++++++++++++
A.config/forecastio/weather.py | 52++++++++++++++++++++++++++++++++++++++++++++++++++++
A.config/git/config | 19+++++++++++++++++++
A.config/git/ignore | 12++++++++++++
A.config/homebrew/brew_leaves.txt | 19+++++++++++++++++++
A.config/homebrew/brew_leaves_head.txt | 1+
A.config/homebrew/brew_setup.sh | 28++++++++++++++++++++++++++++
A.config/htop/htoprc | 26++++++++++++++++++++++++++
A.config/iterm/apprentice.itermcolors | 344+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
A.config/khard/khard.conf | 41+++++++++++++++++++++++++++++++++++++++++
A.config/mutt/colors | 151++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
A.config/mutt/gpg | 88+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
A.config/mutt/mailcap | 1+
A.config/mutt/smime | 102+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
A.config/pacman/makepkg.conf | 20++++++++++++++++++++
A.config/pudb/pudb.cfg | 18++++++++++++++++++
A.config/pudb/saved-breakpoints-3.6 | 1+
A.config/terminfo/tmux.terminfo | 7+++++++
A.config/tmux/bin/battery_indicator.sh | 42++++++++++++++++++++++++++++++++++++++++++
A.config/tmux/bin/login-shell | 10++++++++++
A.config/tmux/bin/tm | 30++++++++++++++++++++++++++++++
A.config/tmux/bin/tmux-copy.sh | 16++++++++++++++++
A.config/tmux/bin/tmux-paste.sh | 16++++++++++++++++
A.config/tmux/theme.sh | 59+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
A.gnupg/gpg-agent.conf | 4++++
A.gnupg/gpg.conf | 9+++++++++
A.inputrc | 14++++++++++++++
A.local/bin/dviprint | 7+++++++
A.local/bin/sncli-export | 2++
A.local/bin/tmux-session | 95+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
A.local/bin/xlock-off | 2++
A.minttyrc | 31+++++++++++++++++++++++++++++++
A.muttrc | 49+++++++++++++++++++++++++++++++++++++++++++++++++
A.pylintrc | 262+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
A.rainbow_config.json | 43+++++++++++++++++++++++++++++++++++++++++++
A.snclirc | 47+++++++++++++++++++++++++++++++++++++++++++++++
A.ssh/config | 14++++++++++++++
A.tmux.conf | 112+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
A.vim/after/ftplugin/crontab.vim | 2++
A.vim/after/ftplugin/cs.vim | 1+
A.vim/after/ftplugin/css.vim | 1+
A.vim/after/ftplugin/gitcommit.vim | 1+
A.vim/after/ftplugin/help.vim | 1+
A.vim/after/ftplugin/java.vim | 10++++++++++
A.vim/after/ftplugin/markdown.vim | 2++
A.vim/after/ftplugin/python.vim | 8++++++++
A.vim/after/ftplugin/text.vim | 2++
A.vim/after/ftplugin/vim.vim | 2++
A.vim/after/ftplugin/yaml.vim | 1+
A.vim/after/syntax/html.vim | 24++++++++++++++++++++++++
A.vim/gvimrc | 9+++++++++
A.vim/pack/update_plugins | 16++++++++++++++++
A.vim/skel/mit.skel | 23+++++++++++++++++++++++
A.vim/skel/reserved.skel | 3+++
A.vim/vimrc | 379+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
60 files changed, 3055 insertions(+), 0 deletions(-)

diff --git a/.bash_logout b/.bash_logout @@ -0,0 +1,3 @@ +# +# ~/.bash_logout +# diff --git a/.bash_profile b/.bash_profile @@ -0,0 +1,5 @@ +# +# ~/.bash_profile +# + +[[ -f ~/.bashrc ]] && . ~/.bashrc diff --git a/.bashrc b/.bashrc @@ -0,0 +1,114 @@ +# If not running interactively, don't do anything +[[ $- != *i* ]] && return + +if [[ -f ~/.bashrc.local ]] +then + source ~/.bashrc.local +fi + +export EDITOR=vim +export GOPATH=~/.go + +# Turn on colors +export LSCOLORS=ExFxBxDxCxegedabagacad + +# Configure GPG and start the agent if it isn't already running +if command -v gpg-connect-agent > /dev/null 2>&1 +then + gpg-connect-agent /bye > /dev/null 2>&1 +fi + +# Configure GPG as an SSH key provider +export GPG_TTY=$(tty) +unset SSH_AGENT_PID +if [[ -S $HOME/.gnupg/S.gpg-agent.ssh ]] +then + export SSH_AUTH_SOCK=$HOME/.gnupg/S.gpg-agent.ssh +elif [[ -S /run/user/$UID/gnupg/S.gpg-agent.ssh ]] +then + export SSH_AUTH_SOCK="/run/user/$UID/gnupg/S.gpg-agent.ssh" +fi + +# Git command line configuration +GIT_PS1_SHOWDIRTYSTATE=1 +GIT_PS1_SHOWUNTRACKEDFILES=1 +source ~/.config/bash/git-prompt.sh + +# Customize the prompt +export PS1='\[\033[34m\]\u\[\033[m\]@\[\033[32m\]\h:\[\033[m\]\W\[\033[31m\]$(__git_ps1 " (%s)")\[\033[m\]\$ ' + +if [[ -d ~/.cargo/bin ]] +then + export PATH=$PATH:~/.cargo/bin +fi + +if [[ -d ~/.go/bin ]] +then + export PATH=$PATH:~/.go/bin +fi + +if [[ -d ~/.local/bin ]] +then + export PATH=~/.local/bin:$PATH +fi + +# Configure Homebrew +if command -v brew > /dev/null 2>&1 +then + export HOMEBREW_NO_ANALYTICS=1 + export HOMEBREW_NO_INSECURE_REDIRECT=1 + export HOMEBREW_CASK_OPTS=--require-sha\ --appdir=~/Applications + export HOMEBREW_NO_AUTO_UPDATE=1 + export PATH=$(brew --prefix)/bin:$PATH + if [ -f $(brew --prefix)/etc/bash_completion ] + then + source $(brew --prefix)/etc/bash_completion + fi +fi + +if [[ -f /usr/share/bash_completion/bash_completion ]] +then + source /usr/share/bash_completion/bash_completion +fi + +# Make life easier +alias tas=tmux\ attach-session\ -t +alias tns=tmux\ new-session\ -s +alias tls=tmux\ list-sessions +if [[ $OSTYPE == "darwin"* ]] +then + alias jackd="jackd -d coreaudio > /dev/null 2>&1 &" +fi + +ix() +{ + local opts + local OPTIND + [ -f "$HOME/.netrc" ] && opts='-n' + while getopts ":hd:i:n:" x; do + case $x in + h) echo "ix [-d ID] [-i ID] [-n N] [opts]"; return;; + d) $echo curl $opts -X DELETE ix.io/$OPTARG; return;; + i) opts="$opts -X PUT"; local id="$OPTARG";; + n) opts="$opts -F read:1=$OPTARG";; + esac + done + shift $(($OPTIND - 1)) + [ -t 0 ] && + { + local filename="$1" + shift + [ "$filename" ] && + { + curl $opts -F f:1=@"$filename" $* ix.io/$id + return + } + echo "^C to cancel, ^D to send." + } + curl $opts -F f:1='<-' $* ix.io/$id +} + +if command -v archey3 > /dev/null 2>&1 && [[ -z "$TMUX" ]] +then + archey3 +fi diff --git a/.config/bash/git-prompt.sh b/.config/bash/git-prompt.sh @@ -0,0 +1,534 @@ +# bash/zsh git prompt support +# +# Copyright (C) 2006,2007 Shawn O. Pearce <spearce@spearce.org> +# Distributed under the GNU General Public License, version 2.0. +# +# This script allows you to see repository status in your prompt. +# +# To enable: +# +# 1) Copy this file to somewhere (e.g. ~/.git-prompt.sh). +# 2) Add the following line to your .bashrc/.zshrc: +# source ~/.git-prompt.sh +# 3a) Change your PS1 to call __git_ps1 as +# command-substitution: +# Bash: PS1='[\u@\h \W$(__git_ps1 " (%s)")]\$ ' +# ZSH: setopt PROMPT_SUBST ; PS1='[%n@%m %c$(__git_ps1 " (%s)")]\$ ' +# the optional argument will be used as format string. +# 3b) Alternatively, for a slightly faster prompt, __git_ps1 can +# be used for PROMPT_COMMAND in Bash or for precmd() in Zsh +# with two parameters, <pre> and <post>, which are strings +# you would put in $PS1 before and after the status string +# generated by the git-prompt machinery. e.g. +# Bash: PROMPT_COMMAND='__git_ps1 "\u@\h:\w" "\\\$ "' +# will show username, at-sign, host, colon, cwd, then +# various status string, followed by dollar and SP, as +# your prompt. +# ZSH: precmd () { __git_ps1 "%n" ":%~$ " "|%s" } +# will show username, pipe, then various status string, +# followed by colon, cwd, dollar and SP, as your prompt. +# Optionally, you can supply a third argument with a printf +# format string to finetune the output of the branch status +# +# The repository status will be displayed only if you are currently in a +# git repository. The %s token is the placeholder for the shown status. +# +# The prompt status always includes the current branch name. +# +# In addition, if you set GIT_PS1_SHOWDIRTYSTATE to a nonempty value, +# unstaged (*) and staged (+) changes will be shown next to the branch +# name. You can configure this per-repository with the +# bash.showDirtyState variable, which defaults to true once +# GIT_PS1_SHOWDIRTYSTATE is enabled. +# +# You can also see if currently something is stashed, by setting +# GIT_PS1_SHOWSTASHSTATE to a nonempty value. If something is stashed, +# then a '$' will be shown next to the branch name. +# +# If you would like to see if there're untracked files, then you can set +# GIT_PS1_SHOWUNTRACKEDFILES to a nonempty value. If there're untracked +# files, then a '%' will be shown next to the branch name. You can +# configure this per-repository with the bash.showUntrackedFiles +# variable, which defaults to true once GIT_PS1_SHOWUNTRACKEDFILES is +# enabled. +# +# If you would like to see the difference between HEAD and its upstream, +# set GIT_PS1_SHOWUPSTREAM="auto". A "<" indicates you are behind, ">" +# indicates you are ahead, "<>" indicates you have diverged and "=" +# indicates that there is no difference. You can further control +# behaviour by setting GIT_PS1_SHOWUPSTREAM to a space-separated list +# of values: +# +# verbose show number of commits ahead/behind (+/-) upstream +# name if verbose, then also show the upstream abbrev name +# legacy don't use the '--count' option available in recent +# versions of git-rev-list +# git always compare HEAD to @{upstream} +# svn always compare HEAD to your SVN upstream +# +# You can change the separator between the branch name and the above +# state symbols by setting GIT_PS1_STATESEPARATOR. The default separator +# is SP. +# +# By default, __git_ps1 will compare HEAD to your SVN upstream if it can +# find one, or @{upstream} otherwise. Once you have set +# GIT_PS1_SHOWUPSTREAM, you can override it on a per-repository basis by +# setting the bash.showUpstream config variable. +# +# If you would like to see more information about the identity of +# commits checked out as a detached HEAD, set GIT_PS1_DESCRIBE_STYLE +# to one of these values: +# +# contains relative to newer annotated tag (v1.6.3.2~35) +# branch relative to newer tag or branch (master~4) +# describe relative to older annotated tag (v1.6.3.1-13-gdd42c2f) +# tag relative to any older tag (v1.6.3.1-13-gdd42c2f) +# default exactly matching tag +# +# If you would like a colored hint about the current dirty state, set +# GIT_PS1_SHOWCOLORHINTS to a nonempty value. The colors are based on +# the colored output of "git status -sb" and are available only when +# using __git_ps1 for PROMPT_COMMAND or precmd. +# +# If you would like __git_ps1 to do nothing in the case when the current +# directory is set up to be ignored by git, then set +# GIT_PS1_HIDE_IF_PWD_IGNORED to a nonempty value. Override this on the +# repository level by setting bash.hideIfPwdIgnored to "false". + +# check whether printf supports -v +__git_printf_supports_v= +printf -v __git_printf_supports_v -- '%s' yes >/dev/null 2>&1 + +# stores the divergence from upstream in $p +# used by GIT_PS1_SHOWUPSTREAM +__git_ps1_show_upstream () +{ + local key value + local svn_remote svn_url_pattern count n + local upstream=git legacy="" verbose="" name="" + + svn_remote=() + # get some config options from git-config + local output="$(git config -z --get-regexp '^(svn-remote\..*\.url|bash\.showupstream)$' 2>/dev/null | tr '\0\n' '\n ')" + while read -r key value; do + case "$key" in + bash.showupstream) + GIT_PS1_SHOWUPSTREAM="$value" + if [[ -z "${GIT_PS1_SHOWUPSTREAM}" ]]; then + p="" + return + fi + ;; + svn-remote.*.url) + svn_remote[$((${#svn_remote[@]} + 1))]="$value" + svn_url_pattern="$svn_url_pattern\\|$value" + upstream=svn+git # default upstream is SVN if available, else git + ;; + esac + done <<< "$output" + + # parse configuration values + for option in ${GIT_PS1_SHOWUPSTREAM}; do + case "$option" in + git|svn) upstream="$option" ;; + verbose) verbose=1 ;; + legacy) legacy=1 ;; + name) name=1 ;; + esac + done + + # Find our upstream + case "$upstream" in + git) upstream="@{upstream}" ;; + svn*) + # get the upstream from the "git-svn-id: ..." in a commit message + # (git-svn uses essentially the same procedure internally) + local -a svn_upstream + svn_upstream=($(git log --first-parent -1 \ + --grep="^git-svn-id: \(${svn_url_pattern#??}\)" 2>/dev/null)) + if [[ 0 -ne ${#svn_upstream[@]} ]]; then + svn_upstream=${svn_upstream[${#svn_upstream[@]} - 2]} + svn_upstream=${svn_upstream%@*} + local n_stop="${#svn_remote[@]}" + for ((n=1; n <= n_stop; n++)); do + svn_upstream=${svn_upstream#${svn_remote[$n]}} + done + + if [[ -z "$svn_upstream" ]]; then + # default branch name for checkouts with no layout: + upstream=${GIT_SVN_ID:-git-svn} + else + upstream=${svn_upstream#/} + fi + elif [[ "svn+git" = "$upstream" ]]; then + upstream="@{upstream}" + fi + ;; + esac + + # Find how many commits we are ahead/behind our upstream + if [[ -z "$legacy" ]]; then + count="$(git rev-list --count --left-right \ + "$upstream"...HEAD 2>/dev/null)" + else + # produce equivalent output to --count for older versions of git + local commits + if commits="$(git rev-list --left-right "$upstream"...HEAD 2>/dev/null)" + then + local commit behind=0 ahead=0 + for commit in $commits + do + case "$commit" in + "<"*) ((behind++)) ;; + *) ((ahead++)) ;; + esac + done + count="$behind $ahead" + else + count="" + fi + fi + + # calculate the result + if [[ -z "$verbose" ]]; then + case "$count" in + "") # no upstream + p="" ;; + "0 0") # equal to upstream + p="=" ;; + "0 "*) # ahead of upstream + p=">" ;; + *" 0") # behind upstream + p="<" ;; + *) # diverged from upstream + p="<>" ;; + esac + else + case "$count" in + "") # no upstream + p="" ;; + "0 0") # equal to upstream + p=" u=" ;; + "0 "*) # ahead of upstream + p=" u+${count#0 }" ;; + *" 0") # behind upstream + p=" u-${count% 0}" ;; + *) # diverged from upstream + p=" u+${count#* }-${count% *}" ;; + esac + if [[ -n "$count" && -n "$name" ]]; then + __git_ps1_upstream_name=$(git rev-parse \ + --abbrev-ref "$upstream" 2>/dev/null) + if [ $pcmode = yes ] && [ $ps1_expanded = yes ]; then + p="$p \${__git_ps1_upstream_name}" + else + p="$p ${__git_ps1_upstream_name}" + # not needed anymore; keep user's + # environment clean + unset __git_ps1_upstream_name + fi + fi + fi + +} + +# Helper function that is meant to be called from __git_ps1. It +# injects color codes into the appropriate gitstring variables used +# to build a gitstring. +__git_ps1_colorize_gitstring () +{ + if [[ -n ${ZSH_VERSION-} ]]; then + local c_red='%F{red}' + local c_green='%F{green}' + local c_lblue='%F{blue}' + local c_clear='%f' + else + # Using \[ and \] around colors is necessary to prevent + # issues with command line editing/browsing/completion! + local c_red='\[\e[31m\]' + local c_green='\[\e[32m\]' + local c_lblue='\[\e[1;34m\]' + local c_clear='\[\e[0m\]' + fi + local bad_color=$c_red + local ok_color=$c_green + local flags_color="$c_lblue" + + local branch_color="" + if [ $detached = no ]; then + branch_color="$ok_color" + else + branch_color="$bad_color" + fi + c="$branch_color$c" + + z="$c_clear$z" + if [ "$w" = "*" ]; then + w="$bad_color$w" + fi + if [ -n "$i" ]; then + i="$ok_color$i" + fi + if [ -n "$s" ]; then + s="$flags_color$s" + fi + if [ -n "$u" ]; then + u="$bad_color$u" + fi + r="$c_clear$r" +} + +__git_eread () +{ + local f="$1" + shift + test -r "$f" && read "$@" <"$f" +} + +# __git_ps1 accepts 0 or 1 arguments (i.e., format string) +# when called from PS1 using command substitution +# in this mode it prints text to add to bash PS1 prompt (includes branch name) +# +# __git_ps1 requires 2 or 3 arguments when called from PROMPT_COMMAND (pc) +# in that case it _sets_ PS1. The arguments are parts of a PS1 string. +# when two arguments are given, the first is prepended and the second appended +# to the state string when assigned to PS1. +# The optional third parameter will be used as printf format string to further +# customize the output of the git-status string. +# In this mode you can request colored hints using GIT_PS1_SHOWCOLORHINTS=true +__git_ps1 () +{ + # preserve exit status + local exit=$? + local pcmode=no + local detached=no + local ps1pc_start='\u@\h:\w ' + local ps1pc_end='\$ ' + local printf_format=' (%s)' + + case "$#" in + 2|3) pcmode=yes + ps1pc_start="$1" + ps1pc_end="$2" + printf_format="${3:-$printf_format}" + # set PS1 to a plain prompt so that we can + # simply return early if the prompt should not + # be decorated + PS1="$ps1pc_start$ps1pc_end" + ;; + 0|1) printf_format="${1:-$printf_format}" + ;; + *) return $exit + ;; + esac + + # ps1_expanded: This variable is set to 'yes' if the shell + # subjects the value of PS1 to parameter expansion: + # + # * bash does unless the promptvars option is disabled + # * zsh does not unless the PROMPT_SUBST option is set + # * POSIX shells always do + # + # If the shell would expand the contents of PS1 when drawing + # the prompt, a raw ref name must not be included in PS1. + # This protects the user from arbitrary code execution via + # specially crafted ref names. For example, a ref named + # 'refs/heads/$(IFS=_;cmd=sudo_rm_-rf_/;$cmd)' might cause the + # shell to execute 'sudo rm -rf /' when the prompt is drawn. + # + # Instead, the ref name should be placed in a separate global + # variable (in the __git_ps1_* namespace to avoid colliding + # with the user's environment) and that variable should be + # referenced from PS1. For example: + # + # __git_ps1_foo=$(do_something_to_get_ref_name) + # PS1="...stuff...\${__git_ps1_foo}...stuff..." + # + # If the shell does not expand the contents of PS1, the raw + # ref name must be included in PS1. + # + # The value of this variable is only relevant when in pcmode. + # + # Assume that the shell follows the POSIX specification and + # expands PS1 unless determined otherwise. (This is more + # likely to be correct if the user has a non-bash, non-zsh + # shell and safer than the alternative if the assumption is + # incorrect.) + # + local ps1_expanded=yes + [ -z "${ZSH_VERSION-}" ] || [[ -o PROMPT_SUBST ]] || ps1_expanded=no + [ -z "${BASH_VERSION-}" ] || shopt -q promptvars || ps1_expanded=no + + local repo_info rev_parse_exit_code + repo_info="$(git rev-parse --git-dir --is-inside-git-dir \ + --is-bare-repository --is-inside-work-tree \ + --short HEAD 2>/dev/null)" + rev_parse_exit_code="$?" + + if [ -z "$repo_info" ]; then + return $exit + fi + + local short_sha="" + if [ "$rev_parse_exit_code" = "0" ]; then + short_sha="${repo_info##*$'\n'}" + repo_info="${repo_info%$'\n'*}" + fi + local inside_worktree="${repo_info##*$'\n'}" + repo_info="${repo_info%$'\n'*}" + local bare_repo="${repo_info##*$'\n'}" + repo_info="${repo_info%$'\n'*}" + local inside_gitdir="${repo_info##*$'\n'}" + local g="${repo_info%$'\n'*}" + + if [ "true" = "$inside_worktree" ] && + [ -n "${GIT_PS1_HIDE_IF_PWD_IGNORED-}" ] && + [ "$(git config --bool bash.hideIfPwdIgnored)" != "false" ] && + git check-ignore -q . + then + return $exit + fi + + local r="" + local b="" + local step="" + local total="" + if [ -d "$g/rebase-merge" ]; then + __git_eread "$g/rebase-merge/head-name" b + __git_eread "$g/rebase-merge/msgnum" step + __git_eread "$g/rebase-merge/end" total + if [ -f "$g/rebase-merge/interactive" ]; then + r="|REBASE-i" + else + r="|REBASE-m" + fi + else + if [ -d "$g/rebase-apply" ]; then + __git_eread "$g/rebase-apply/next" step + __git_eread "$g/rebase-apply/last" total + if [ -f "$g/rebase-apply/rebasing" ]; then + __git_eread "$g/rebase-apply/head-name" b + r="|REBASE" + elif [ -f "$g/rebase-apply/applying" ]; then + r="|AM" + else + r="|AM/REBASE" + fi + elif [ -f "$g/MERGE_HEAD" ]; then + r="|MERGING" + elif [ -f "$g/CHERRY_PICK_HEAD" ]; then + r="|CHERRY-PICKING" + elif [ -f "$g/REVERT_HEAD" ]; then + r="|REVERTING" + elif [ -f "$g/BISECT_LOG" ]; then + r="|BISECTING" + fi + + if [ -n "$b" ]; then + : + elif [ -h "$g/HEAD" ]; then + # symlink symbolic ref + b="$(git symbolic-ref HEAD 2>/dev/null)" + else + local head="" + if ! __git_eread "$g/HEAD" head; then + return $exit + fi + # is it a symbolic ref? + b="${head#ref: }" + if [ "$head" = "$b" ]; then + detached=yes + b="$( + case "${GIT_PS1_DESCRIBE_STYLE-}" in + (contains) + git describe --contains HEAD ;; + (branch) + git describe --contains --all HEAD ;; + (tag) + git describe --tags HEAD ;; + (describe) + git describe HEAD ;; + (* | default) + git describe --tags --exact-match HEAD ;; + esac 2>/dev/null)" || + + b="$short_sha..." + b="($b)" + fi + fi + fi + + if [ -n "$step" ] && [ -n "$total" ]; then + r="$r $step/$total" + fi + + local w="" + local i="" + local s="" + local u="" + local c="" + local p="" + + if [ "true" = "$inside_gitdir" ]; then + if [ "true" = "$bare_repo" ]; then + c="BARE:" + else + b="GIT_DIR!" + fi + elif [ "true" = "$inside_worktree" ]; then + if [ -n "${GIT_PS1_SHOWDIRTYSTATE-}" ] && + [ "$(git config --bool bash.showDirtyState)" != "false" ] + then + git diff --no-ext-diff --quiet || w="*" + git diff --no-ext-diff --cached --quiet || i="+" + if [ -z "$short_sha" ] && [ -z "$i" ]; then + i="#" + fi + fi + if [ -n "${GIT_PS1_SHOWSTASHSTATE-}" ] && + git rev-parse --verify --quiet refs/stash >/dev/null + then + s="$" + fi + + if [ -n "${GIT_PS1_SHOWUNTRACKEDFILES-}" ] && + [ "$(git config --bool bash.showUntrackedFiles)" != "false" ] && + git ls-files --others --exclude-standard --directory --no-empty-directory --error-unmatch -- ':/*' >/dev/null 2>/dev/null + then + u="%${ZSH_VERSION+%}" + fi + + if [ -n "${GIT_PS1_SHOWUPSTREAM-}" ]; then + __git_ps1_show_upstream + fi + fi + + local z="${GIT_PS1_STATESEPARATOR-" "}" + + # NO color option unless in PROMPT_COMMAND mode + if [ $pcmode = yes ] && [ -n "${GIT_PS1_SHOWCOLORHINTS-}" ]; then + __git_ps1_colorize_gitstring + fi + + b=${b##refs/heads/} + if [ $pcmode = yes ] && [ $ps1_expanded = yes ]; then + __git_ps1_branch_name=$b + b="\${__git_ps1_branch_name}" + fi + + local f="$w$i$s$u" + local gitstring="$c$b${f:+$z$f}$r$p" + + if [ $pcmode = yes ]; then + if [ "${__git_printf_supports_v-}" != yes ]; then + gitstring=$(printf -- "$printf_format" "$gitstring") + else + printf -v gitstring -- "$printf_format" "$gitstring" + fi + PS1="$ps1pc_start$gitstring$ps1pc_end" + else + printf -- "$printf_format" "$gitstring" + fi + + return $exit +} diff --git a/.config/bash/truecolor_test.sh b/.config/bash/truecolor_test.sh @@ -0,0 +1,100 @@ +#!/bin/bash +# This file was originally taken from iterm2 https://github.com/gnachman/iTerm2/blob/master/tests/24-bit-color.sh +# +# This file echoes a bunch of 24-bit color codes +# to the terminal to demonstrate its functionality. +# The foreground escape sequence is ^[38;2;<r>;<g>;<b>m +# The background escape sequence is ^[48;2;<r>;<g>;<b>m +# <r> <g> <b> range from 0 to 255 inclusive. +# The escape sequence ^[0m returns output to default + +setBackgroundColor() +{ + #printf '\x1bPtmux;\x1b\x1b[48;2;%s;%s;%sm' $1 $2 $3 + printf '\x1b[48;2;%s;%s;%sm' $1 $2 $3 +} + +resetOutput() +{ + echo -en "\x1b[0m\n" +} + +# Gives a color $1/255 % along HSV +# Who knows what happens when $1 is outside 0-255 +# Echoes "$red $green $blue" where +# $red $green and $blue are integers +# ranging between 0 and 255 inclusive +rainbowColor() +{ + let h=$1/43 + let f=$1-43*$h + let t=$f*255/43 + let q=255-t + + if [ $h -eq 0 ] + then + echo "255 $t 0" + elif [ $h -eq 1 ] + then + echo "$q 255 0" + elif [ $h -eq 2 ] + then + echo "0 255 $t" + elif [ $h -eq 3 ] + then + echo "0 $q 255" + elif [ $h -eq 4 ] + then + echo "$t 0 255" + elif [ $h -eq 5 ] + then + echo "255 0 $q" + else + # execution should never reach here + echo "0 0 0" + fi +} + +for i in `seq 0 127`; do + setBackgroundColor $i 0 0 + echo -en " " +done +resetOutput +for i in `seq 255 -1 128`; do + setBackgroundColor $i 0 0 + echo -en " " +done +resetOutput + +for i in `seq 0 127`; do + setBackgroundColor 0 $i 0 + echo -n " " +done +resetOutput +for i in `seq 255 -1 128`; do + setBackgroundColor 0 $i 0 + echo -n " " +done +resetOutput + +for i in `seq 0 127`; do + setBackgroundColor 0 0 $i + echo -n " " +done +resetOutput +for i in `seq 255 -1 128`; do + setBackgroundColor 0 0 $i + echo -n " " +done +resetOutput + +for i in `seq 0 127`; do + setBackgroundColor `rainbowColor $i` + echo -n " " +done +resetOutput +for i in `seq 255 -1 128`; do + setBackgroundColor `rainbowColor $i` + echo -n " " +done +resetOutput diff --git a/.config/forecastio/org.djmoch.forecastio.plist b/.config/forecastio/org.djmoch.forecastio.plist @@ -0,0 +1,20 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> +<plist version="1.0"> + <dict> + <key>Label</key> + <string>org.djmoch.forecastio</string> + <key>WorkingDirectory</key> + <string>HOME/Library/org.djmoch.forecastio</string> + <key>Program</key> + <string>HOME/Library/org.djmoch.forecastio/weather.py</string> + <key>StandardOutPath</key> + <string>HOME/Library/Logs/org.djmoch.forecastio.log</string> + <key>StandardErrorPath</key> + <string>HOME/Library/Logs/org.djmoch.forecastio.log</string> + <key>RunAtLoad</key> + <true/> + <key>StartInterval</key> + <integer>300</integer> + </dict> +</plist> diff --git a/.config/forecastio/weather.py b/.config/forecastio/weather.py @@ -0,0 +1,52 @@ +#!/usr/bin/env python3 +# -*- coding: utf-8 -*- +from datetime import datetime +import math +from os import environ +import sys +import forecastio +import requests + +def generate_forecast(): + error = False + + try: + # I keep my api key for forecast.io in a separate text file so I don't accidentally publish it anywhere. + with open('forecastio_api.txt', 'r') as apifile: + api_key = apifile.read() + api_key = api_key.strip() + + # Resolving location from IP is always going to be a best guess, but it's better than hardcoding location data + latitude, longitude = requests.get('https://ipinfo.io').json()['loc'].split(',') + + # Now we're ready to actually get the weather + forecast = forecastio.load_forecast(api_key, latitude, longitude) + + current_temp = forecast.currently() + day = forecast.daily() + + temp = str(current_temp.temperature) + " F" + high = str(int(math.ceil(day.data[0].temperatureMax))) + low = str(int(math.ceil(day.data[0].temperatureMin))) + + with open('current_forecast.txt', 'w') as outfile: + outfile.write(temp + ", " + str(current_temp.summary) + ", " + high +"/"+low + " F") + except requests.packages.urllib3.exceptions.NewConnectionError: + error = True + if DEBUG: + sys.stdout.writelines(datetime.now().strftime("%m/%d/%Y %I:%M:%S:") + " Could not connect. Will try again \ + in 5 minutes.\n") + + if DEBUG and not error: + sys.stdout.writelines(datetime.now().strftime("%m/%d/%Y %I:%M:%S:") + " Successfully updated weather\n") + +if __name__ == '__main__': + try: + if environ['DEBUG']: + DEBUG = True + except KeyError: + DEBUG = False + + if DEBUG: + sys.stdout.writelines(datetime.now().strftime("%m/%d/%Y %I:%M:%S:") + " Updating weather\n") + generate_forecast() diff --git a/.config/git/config b/.config/git/config @@ -0,0 +1,19 @@ +[user] + email = daniel@danielmoch.com + name = Daniel Moch + signingkey = 84BDDD43 +[core] + excludesfile = ~/.config/git/ignore +[commit] + gpgSign = true +[push] + default = simple +[diff] + tool = vimdiff +[difftool] + prompt = false +[merge] + tool = vimdiff +[mergetool] + prompt = false +[gpg] diff --git a/.config/git/ignore b/.config/git/ignore @@ -0,0 +1,12 @@ +*.class +*.pyc +*.pyo +*/.git/* +.git +__pycache__ +.project +.pydevproject +*.sqlite3 +.DS_Store +tags +.netrwhist diff --git a/.config/homebrew/brew_leaves.txt b/.config/homebrew/brew_leaves.txt @@ -0,0 +1,19 @@ +bash-completion +newsboat +blueutil +docker-compose +gnupg +htop +irssi +mutt +nmap +node +pandoc +pinentry-mac +python +python3 +reattach-to-user-namespace +ruby +tmux +w3m +wget diff --git a/.config/homebrew/brew_leaves_head.txt b/.config/homebrew/brew_leaves_head.txt @@ -0,0 +1 @@ +universal-ctags/universal-ctags/universal-ctags diff --git a/.config/homebrew/brew_setup.sh b/.config/homebrew/brew_setup.sh @@ -0,0 +1,28 @@ +#!/usr/bin/env bash +function __mkbrewdir() +{ + if [[ -d "/usr/local/$1" ]] + then + echo "Directory /usr/local/$1 already exists" + return + else + echo "Creating directory /usr/local/$1" + mkdir /usr/local/$1 + fi + chown $LOGNAME:admin /usr/local/$1 +} + +/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)" +echo "Reassigning directories to $LOGNAME. May need $USER password again." +sudo __mkbrewdir "Caskroom" +sudo __mkbrewdir "Cellar" +sudo __mkbrewdir "Frameworks" +sudo __mkbrewdir "Homebrew" +sudo __mkbrewdir "bin" +sudo __mkbrewdir "etc" +sudo __mkbrewdir "include" +sudo __mkbrewdir "lib" +sudo __mkbrewdir "opt" +sudo __mkbrewdir "sbin" +sudo __mkbrewdir "share" +sudo __mkbrewdir "var" diff --git a/.config/htop/htoprc b/.config/htop/htoprc @@ -0,0 +1,26 @@ +# Beware! This file is rewritten by htop when settings are changed in the interface. +# The parser is also very primitive, and not human-friendly. +fields=0 48 17 18 38 39 40 2 46 47 49 1 +sort_key=48 +sort_direction=1 +hide_threads=0 +hide_kernel_threads=1 +hide_userland_threads=0 +shadow_other_users=0 +show_thread_names=0 +show_program_path=1 +highlight_base_name=0 +highlight_megabytes=1 +highlight_threads=1 +tree_view=0 +header_margin=1 +detailed_cpu_time=0 +cpu_count_from_zero=0 +update_process_names=0 +account_guest_in_cpu_meter=0 +color_scheme=0 +delay=15 +left_meters=AllCPUs Memory Swap +left_meter_modes=1 1 1 +right_meters=Tasks LoadAverage Uptime +right_meter_modes=2 2 2 diff --git a/.config/iterm/apprentice.itermcolors b/.config/iterm/apprentice.itermcolors @@ -0,0 +1,344 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> +<plist version="1.0"> +<dict> + <key>Ansi 0 Color</key> + <dict> + <key>Alpha Component</key> + <real>1</real> + <key>Blue Component</key> + <real>0.084129750728607178</real> + <key>Color Space</key> + <string>Calibrated</string> + <key>Green Component</key> + <real>0.084128305315971375</real> + <key>Red Component</key> + <real>0.084130816161632538</real> + </dict> + <key>Ansi 1 Color</key> + <dict> + <key>Alpha Component</key> + <real>1</real> + <key>Blue Component</key> + <real>0.30066829919815063</real> + <key>Color Space</key> + <string>Calibrated</string> + <key>Green Component</key> + <real>0.29062080383300781</real> + <key>Red Component</key> + <real>0.61822432279586792</real> + </dict> + <key>Ansi 10 Color</key> + <dict> + <key>Alpha Component</key> + <real>1</real> + <key>Blue Component</key> + <real>0.45524013042449951</real> + <key>Color Space</key> + <string>Calibrated</string> + <key>Green Component</key> + <real>0.63277435302734375</real> + <key>Red Component</key> + <real>0.4602293074131012</real> + </dict> + <key>Ansi 11 Color</key> + <dict> + <key>Alpha Component</key> + <real>1</real> + <key>Blue Component</key> + <real>0.62614059448242188</real> + <key>Color Space</key> + <string>Calibrated</string> + <key>Green Component</key> + <real>1</real> + <key>Red Component</key> + <real>1</real> + </dict> + <key>Ansi 12 Color</key> + <dict> + <key>Alpha Component</key> + <real>1</real> + <key>Blue Component</key> + <real>0.80612444877624512</real> + <key>Color Space</key> + <string>Calibrated</string> + <key>Green Component</key> + <real>0.62016493082046509</real> + <key>Red Component</key> + <real>0.49107584357261658</real> + </dict> + <key>Ansi 13 Color</key> + <dict> + <key>Alpha Component</key> + <real>1</real> + <key>Blue Component</key> + <real>0.62415337562561035</real> + <key>Color Space</key> + <string>Calibrated</string> + <key>Green Component</key> + <real>0.4482349157333374</real> + <key>Red Component</key> + <real>0.45452475547790527</real> + </dict> + <key>Ansi 14 Color</key> + <dict> + <key>Alpha Component</key> + <real>1</real> + <key>Blue Component</key> + <real>0.62421411275863647</real> + <key>Color Space</key> + <string>Calibrated</string> + <key>Green Component</key> + <real>0.62970733642578125</real> + <key>Red Component</key> + <real>0.31124210357666016</real> + </dict> + <key>Ansi 15 Color</key> + <dict> + <key>Alpha Component</key> + <real>1</real> + <key>Blue Component</key> + <real>1</real> + <key>Color Space</key> + <string>Calibrated</string> + <key>Green Component</key> + <real>1</real> + <key>Red Component</key> + <real>1</real> + </dict> + <key>Ansi 2 Color</key> + <dict> + <key>Alpha Component</key> + <real>1</real> + <key>Blue Component</key> + <real>0.30018818378448486</real> + <key>Color Space</key> + <string>Calibrated</string> + <key>Green Component</key> + <real>0.46211796998977661</real> + <key>Red Component</key> + <real>0.30495160818099976</real> + </dict> + <key>Ansi 3 Color</key> + <dict> + <key>Alpha Component</key> + <real>1</real> + <key>Blue Component</key> + <real>0.30050134658813477</real> + <key>Color Space</key> + <string>Calibrated</string> + <key>Green Component</key> + <real>0.45947587490081787</real> + <key>Red Component</key> + <real>0.45523005723953247</real> + </dict> + <key>Ansi 4 Color</key> + <dict> + <key>Alpha Component</key> + <real>1</real> + <key>Blue Component</key> + <real>0.62397897243499756</real> + <key>Color Space</key> + <string>Calibrated</string> + <key>Green Component</key> + <real>0.45092964172363281</real> + <key>Red Component</key> + <real>0.30397921800613403</real> + </dict> + <key>Ansi 5 Color</key> + <dict> + <key>Alpha Component</key> + <real>1</real> + <key>Blue Component</key> + <real>0.45450478792190552</real> + <key>Color Space</key> + <string>Calibrated</string> + <key>Green Component</key> + <real>0.29346776008605957</real> + <key>Red Component</key> + <real>0.2995016872882843</real> + </dict> + <key>Ansi 6 Color</key> + <dict> + <key>Alpha Component</key> + <real>1</real> + <key>Blue Component</key> + <real>0.45471268892288208</real> + <key>Color Space</key> + <string>Calibrated</string> + <key>Green Component</key> + <real>0.45759275555610657</real> + <key>Red Component</key> + <real>0.30455631017684937</real> + </dict> + <key>Ansi 7 Color</key> + <dict> + <key>Alpha Component</key> + <real>1</real> + <key>Blue Component</key> + <real>0.34850135445594788</real> + <key>Color Space</key> + <string>Calibrated</string> + <key>Green Component</key> + <real>0.34849545359611511</real> + <key>Red Component</key> + <real>0.34850585460662842</real> + </dict> + <key>Ansi 8 Color</key> + <dict> + <key>Alpha Component</key> + <real>1</real> + <key>Blue Component</key> + <real>0.20521116256713867</real> + <key>Color Space</key> + <string>Calibrated</string> + <key>Green Component</key> + <real>0.20520767569541931</real> + <key>Red Component</key> + <real>0.20521381497383118</real> + </dict> + <key>Ansi 9 Color</key> + <dict> + <key>Alpha Component</key> + <real>1</real> + <key>Blue Component</key> + <real>0.032203890383243561</real> + <key>Color Space</key> + <string>Calibrated</string> + <key>Green Component</key> + <real>0.44771304726600647</real> + <key>Red Component</key> + <real>0.98966044187545776</real> + </dict> + <key>Background Color</key> + <dict> + <key>Alpha Component</key> + <real>1</real> + <key>Blue Component</key> + <real>0.1118292510509491</real> + <key>Color Space</key> + <string>Calibrated</string> + <key>Green Component</key> + <real>0.11182737350463867</real> + <key>Red Component</key> + <real>0.1118306964635849</real> + </dict> + <key>Badge Color</key> + <dict> + <key>Alpha Component</key> + <real>0.5</real> + <key>Blue Component</key> + <real>0.0</real> + <key>Color Space</key> + <string>Calibrated</string> + <key>Green Component</key> + <real>0.0</real> + <key>Red Component</key> + <real>1</real> + </dict> + <key>Bold Color</key> + <dict> + <key>Alpha Component</key> + <real>1</real> + <key>Blue Component</key> + <real>1</real> + <key>Color Space</key> + <string>Calibrated</string> + <key>Green Component</key> + <real>1</real> + <key>Red Component</key> + <real>1</real> + </dict> + <key>Cursor Color</key> + <dict> + <key>Alpha Component</key> + <real>1</real> + <key>Blue Component</key> + <real>0.68256843090057373</real> + <key>Color Space</key> + <string>Calibrated</string> + <key>Green Component</key> + <real>0.6825568675994873</real> + <key>Red Component</key> + <real>0.68257731199264526</real> + </dict> + <key>Cursor Guide Color</key> + <dict> + <key>Alpha Component</key> + <real>0.25</real> + <key>Blue Component</key> + <real>1</real> + <key>Color Space</key> + <string>Calibrated</string> + <key>Green Component</key> + <real>0.9100000262260437</real> + <key>Red Component</key> + <real>0.64999997615814209</real> + </dict> + <key>Cursor Text Color</key> + <dict> + <key>Alpha Component</key> + <real>1</real> + <key>Blue Component</key> + <real>1</real> + <key>Color Space</key> + <string>Calibrated</string> + <key>Green Component</key> + <real>1</real> + <key>Red Component</key> + <real>1</real> + </dict> + <key>Foreground Color</key> + <dict> + <key>Alpha Component</key> + <real>1</real> + <key>Blue Component</key> + <real>0.68256843090057373</real> + <key>Color Space</key> + <string>Calibrated</string> + <key>Green Component</key> + <real>0.6825568675994873</real> + <key>Red Component</key> + <real>0.68257731199264526</real> + </dict> + <key>Link Color</key> + <dict> + <key>Alpha Component</key> + <real>1</real> + <key>Blue Component</key> + <real>0.67799997329711914</real> + <key>Color Space</key> + <string>Calibrated</string> + <key>Green Component</key> + <real>0.27000001072883606</real> + <key>Red Component</key> + <real>0.023000000044703484</real> + </dict> + <key>Selected Text Color</key> + <dict> + <key>Alpha Component</key> + <real>1</real> + <key>Blue Component</key> + <real>0.1118292510509491</real> + <key>Color Space</key> + <string>Calibrated</string> + <key>Green Component</key> + <real>0.11182737350463867</real> + <key>Red Component</key> + <real>0.1118306964635849</real> + </dict> + <key>Selection Color</key> + <dict> + <key>Alpha Component</key> + <real>1</real> + <key>Blue Component</key> + <real>0.80612444877624512</real> + <key>Color Space</key> + <string>Calibrated</string> + <key>Green Component</key> + <real>0.62016493082046509</real> + <key>Red Component</key> + <real>0.49107584357261658</real> + </dict> +</dict> +</plist> diff --git a/.config/khard/khard.conf b/.config/khard/khard.conf @@ -0,0 +1,41 @@ +# example configuration file for khard version >= 0.11.0 +# place it under $HOME/.config/khard/khard.conf + +[addressbooks] +[[nextcloud]] +path = ~/.local/share/contacts/nextcloud/Contacts + +[general] +debug = no +default_action = list +editor = vim +merge_editor = vimdiff + +[contact table] +# display names by first or last name: first_name / last_name +display = first_name +# group by address book: yes / no +group_by_addressbook = no +# reverse table ordering: yes / no +reverse = no +# append nicknames to name column: yes / no +show_nicknames = no +# show uid table column: yes / no +show_uids = yes +# sort by first or last name: first_name / last_name +sort = last_name + +[vcard] +# extend contacts with your own private objects +# these objects are stored with a leading "X-" before the object name in the vcard files +# every object label may only contain letters, digits and the - character +# example: +# private_objects = Jabber, Skype, Twitter +private_objects = Jabber, Skype, Twitter +# preferred vcard version: 3.0 / 4.0 +preferred_version = 3.0 +# Look into source vcf files to speed up search queries: yes / no +search_in_source_files = no +# skip unparsable vcard files: yes / no +skip_unparsable = no + diff --git a/.config/mutt/colors b/.config/mutt/colors @@ -0,0 +1,151 @@ +# vim: filetype=muttrc + +# +# +# make sure that you are using mutt linked against slang, not ncurses, or +# suffer the consequences of weird color issues. use "mutt -v" to check this. + +# custom body highlights ----------------------------------------------- +# highlight my name and other personally relevant strings +#color body color136 color235 "(ethan|schoonover)" +# custom index highlights ---------------------------------------------- +# messages which mention my name in the body +#color index color136 color235 "~b \"phil(_g|\!| gregory| gold)|pgregory\" !~N !~T !~F !~p !~P" +#color index J_cream color230 "~b \"phil(_g|\!| gregory| gold)|pgregory\" ~N !~T !~F !~p !~P" +#color index color136 color37 "~b \"phil(_g|\!| gregory| gold)|pgregory\" ~T !~F !~p !~P" +#color index color136 J_magent "~b \"phil(_g|\!| gregory| gold)|pgregory\" ~F !~p !~P" +## messages which are in reference to my mails +#color index J_magent color235 "~x \"(mithrandir|aragorn)\\.aperiodic\\.net|thorin\\.hillmgt\\.com\" !~N !~T !~F !~p !~P" +#color index J_magent color230 "~x \"(mithrandir|aragorn)\\.aperiodic\\.net|thorin\\.hillmgt\\.com\" ~N !~T !~F !~p !~P" +#color index J_magent color37 "~x \"(mithrandir|aragorn)\\.aperiodic\\.net|thorin\\.hillmgt\\.com\" ~T !~F !~p !~P" +#color index J_magent color160 "~x \"(mithrandir|aragorn)\\.aperiodic\\.net|thorin\\.hillmgt\\.com\" ~F !~p !~P" + +# for background in 16 color terminal, valid background colors include: +# base03, bg, black, any of the non brights + +# basic colors --------------------------------------------------------- +color normal color250 color235 +color error color208 color235 +color tilde color250 color235 +color message color250 color235 +color markers color250 color235 +color attachment color103 color235 +color search color250 color235 +#color status J_black J_status +color status color235 color101 +color indicator color235 color110 +color tree color108 color235 # arrow in threads + +# basic monocolor screen +mono bold bold +mono underline underline +mono indicator reverse +mono error bold + +# index ---------------------------------------------------------------- + +#color index color160 color235 "~D(!~p|~p)" # deleted +#color index color235 color235 ~F # flagged +#color index color166 color235 ~= # duplicate messages +#color index color240 color235 "~A!~N!~T!~p!~Q!~F!~D!~P" # the rest +#color index J_base color235 "~A~N!~T!~p!~Q!~F!~D" # the rest, new +color index color250 color235 "~A" # all messages +color index color131 color235 "~E" # expired messages +color index color231 color235 "~N" # new messages +color index color250 color235 "~O" # old messages +color index color103 color235 "~Q" # messages that have been replied to +color index color242 color235 "~R" # read messages +color index color231 color235 "~U" # unread messages +color index color231 color235 "~U~$" # unread, unreferenced messages +color index color242 color235 "~v" # messages part of a collapsed thread +color index color242 color235 "~P" # messages from me +color index color110 color235 "~p!~F" # messages to me +color index color110 color235 "~N~p!~F" # new messages to me +color index color110 color235 "~U~p!~F" # unread messages to me +color index color242 color235 "~R~p!~F" # messages to me +color index color108 color235 "~F" # flagged messages +color index color108 color235 "~F~p" # flagged messages to me +color index color108 color235 "~N~F" # new flagged messages +color index color108 color235 "~N~F~p" # new flagged messages to me +color index color108 color235 "~U~F~p" # new flagged messages to me +color index color235 color131 "~D" # deleted messages +color index color242 color235 "~v~(!~N)" # collapsed thread with no unread +color index color250 color235 "~v~(~N)" # collapsed thread with some unread +color index color242 color235 "~N~v~(~N)" # collapsed thread with unread parent +# statusbg used to indicated flagged when foreground color shows other status +# for collapsed thread +color index color108 color235 "~v~(~F)!~N" # collapsed thread with flagged, no unread +color index color250 color235 "~v~(~F~N)" # collapsed thread with some unread & flagged +color index color108 color235 "~N~v~(~F~N)" # collapsed thread with unread parent & flagged +color index color108 color235 "~N~v~(~F)" # collapsed thread with unread parent, no unread inside, but some flagged +color index color242 color235 "~v~(~p)" # collapsed thread with unread parent, no unread inside, some to me directly +color index color235 color131 "~v~(~D)" # thread with deleted (doesn't differentiate between all or partial) +#color index color136 color235 "~(~N)" # messages in threads with some unread +#color index color64 color235 "~S" # superseded messages +#color index color160 color235 "~T" # tagged messages +#color index color166 color160 "~=" # duplicated messages + +# message headers ------------------------------------------------------ + +#color header color240 color235 "^" +color hdrdefault color250 color235 +color header color231 color235 "^(From)" +color header color231 color235 "^(Subject)" + +# body ----------------------------------------------------------------- + +color quoted color14 color235 +color quoted1 color103 color235 +color quoted2 color108 color235 +color quoted3 color131 color235 +color quoted4 color229 color235 + +color signature color250 color235 +color bold color231 color235 +color underline color231 color235 +color normal color250 color235 +# +color body color250 color235 "[;:][-o][)/(|]" # emoticons +color body color231 color235 "[;:][)(|]" # emoticons +color body color231 color235 "[*]?((N)?ACK|CU|LOL|SCNR|BRB|BTW|CWYL|\ + |FWIW|vbg|GD&R|HTH|HTHBE|IMHO|IMNSHO|\ + |IRL|RTFM|ROTFL|ROFL|YMMV)[*]?" +color body color231 color235 "[ ][*][^*]*[*][ ]?" # more emoticon? +color body color231 color235 "[ ]?[*][^*]*[*][ ]" # more emoticon? + +## pgp + +color body color231 color131 "(BAD signature)" +color body color103 color235 "(Good signature)" +color body color103 color235 "^gpg: Good signature .*" +color body color242 color235 "^gpg: " +color body color231 color131 "^gpg: BAD signature from.*" +mono body bold "^gpg: Good signature" +mono body bold "^gpg: BAD signature from.*" + +# yes, an insance URL regex +color body color110 color235 "([a-z][a-z0-9+-]*://(((([a-z0-9_.!~*'();:&=+$,-]|%[0-9a-f][0-9a-f])*@)?((([a-z0-9]([a-z0-9-]*[a-z0-9])?)\\.)*([a-z]([a-z0-9-]*[a-z0-9])?)\\.?|[0-9]+\\.[0-9]+\\.[0-9]+\\.[0-9]+)(:[0-9]+)?)|([a-z0-9_.!~*'()$,;:@&=+-]|%[0-9a-f][0-9a-f])+)(/([a-z0-9_.!~*'():@&=+$,-]|%[0-9a-f][0-9a-f])*(;([a-z0-9_.!~*'():@&=+$,-]|%[0-9a-f][0-9a-f])*)*(/([a-z0-9_.!~*'():@&=+$,-]|%[0-9a-f][0-9a-f])*(;([a-z0-9_.!~*'():@&=+$,-]|%[0-9a-f][0-9a-f])*)*)*)?(\\?([a-z0-9_.!~*'();/?:@&=+$,-]|%[0-9a-f][0-9a-f])*)?(#([a-z0-9_.!~*'();/?:@&=+$,-]|%[0-9a-f][0-9a-f])*)?|(www|ftp)\\.(([a-z0-9]([a-z0-9-]*[a-z0-9])?)\\.)*([a-z]([a-z0-9-]*[a-z0-9])?)\\.?(:[0-9]+)?(/([-a-z0-9_.!~*'():@&=+$,]|%[0-9a-f][0-9a-f])*(;([-a-z0-9_.!~*'():@&=+$,]|%[0-9a-f][0-9a-f])*)*(/([-a-z0-9_.!~*'():@&=+$,]|%[0-9a-f][0-9a-f])*(;([-a-z0-9_.!~*'():@&=+$,]|%[0-9a-f][0-9a-f])*)*)*)?(\\?([-a-z0-9_.!~*'();/?:@&=+$,]|%[0-9a-f][0-9a-f])*)?(#([-a-z0-9_.!~*'();/?:@&=+$,]|%[0-9a-f][0-9a-f])*)?)[^].,:;!)? \t\r\n<>\"]" +# and a heavy handed email regex +color body color110 color235 "((@(([0-9a-z-]+\\.)*[0-9a-z-]+\\.?|#[0-9]+|\\[[0-9]?[0-9]?[0-9]\\.[0-9]?[0-9]?[0-9]\\.[0-9]?[0-9]?[0-9]\\.[0-9]?[0-9]?[0-9]\\]),)*@(([0-9a-z-]+\\.)*[0-9a-z-]+\\.?|#[0-9]+|\\[[0-9]?[0-9]?[0-9]\\.[0-9]?[0-9]?[0-9]\\.[0-9]?[0-9]?[0-9]\\.[0-9]?[0-9]?[0-9]\\]):)?[0-9a-z_.+%$-]+@(([0-9a-z-]+\\.)*[0-9a-z-]+\\.?|#[0-9]+|\\[[0-2]?[0-9]?[0-9]\\.[0-2]?[0-9]?[0-9]\\.[0-2]?[0-9]?[0-9]\\.[0-2]?[0-9]?[0-9]\\])" + +# Various smilies and the like +#color body color230 color235 "<[Gg]>" # <g> +#color body color230 color235 "<[Bb][Gg]>" # <bg> +#color body color136 color235 " [;:]-*[})>{(<|]" # :-) etc... +# *bold* +#color body color33 color235 "(^|[[:space:][:punct:]])\\*[^*]+\\*([[:space:][:punct:]]|$)" +#mono body bold "(^|[[:space:][:punct:]])\\*[^*]+\\*([[:space:][:punct:]]|$)" +# _underline_ +#color body color33 color235 "(^|[[:space:][:punct:]])_[^_]+_([[:space:][:punct:]]|$)" +#mono body underline "(^|[[:space:][:punct:]])_[^_]+_([[:space:][:punct:]]|$)" +# /italic/ (Sometimes gets directory names) +#color body color33 color235 "(^|[[:space:][:punct:]])/[^/]+/([[:space:][:punct:]]|$)" +#mono body underline "(^|[[:space:][:punct:]])/[^/]+/([[:space:][:punct:]]|$)" + +# Border lines. +#color body color33 color235 "( *[-+=#*~_]){6,}" + +#folder-hook . "color status J_black J_status " +#folder-hook gmail/inbox "color status J_black color136 " +#folder-hook gmail/important "color status J_black color136 " + diff --git a/.config/mutt/gpg b/.config/mutt/gpg @@ -0,0 +1,88 @@ +# vim: ft=muttrc +# +# Command formats for gpg. +# +# This version uses gpg-2comp from +# http://70t.de/download/gpg-2comp.tar.gz +# +# $Id$ +# +# %p The empty string when no passphrase is needed, +# the string "PGPPASSFD=0" if one is needed. +# +# This is mostly used in conditional % sequences. +# +# %f Most PGP commands operate on a single file or a file +# containing a message. %f expands to this file's name. +# +# %s When verifying signatures, there is another temporary file +# containing the detached signature. %s expands to this +# file's name. +# +# %a In "signing" contexts, this expands to the value of the +# configuration variable $pgp_sign_as. You probably need to +# use this within a conditional % sequence. +# +# %r In many contexts, mutt passes key IDs to pgp. %r expands to +# a list of key IDs. + +# Note that we explicitly set the comment armor header since GnuPG, when used +# in some localiaztion environments, generates 8bit data in that header, thereby +# breaking PGP/MIME. + +# decode application/pgp +set pgp_decode_command="gpg --status-fd=2 %?p?--passphrase-fd 0? --no-verbose --quiet --batch --output - %f" + +# verify a pgp/mime signature +set pgp_verify_command="gpg --status-fd=2 --no-verbose --quiet --batch --output - --verify %s %f" + +# decrypt a pgp/mime attachment +set pgp_decrypt_command="gpg --status-fd=2 %?p?--passphrase-fd 0? --no-verbose --quiet --batch --output - %f" + +# create a pgp/mime signed attachment +# set pgp_sign_command="gpg-2comp --comment '' --no-verbose --batch --output - %?p?--passphrase-fd 0? --armor --detach-sign --textmode %?a?-u %a? %f" +set pgp_sign_command="gpg --no-verbose --batch --quiet --output - %?p?--passphrase-fd 0? --armor --detach-sign --textmode %?a?-u %a? %f" + +# create a application/pgp signed (old-style) message +# set pgp_clearsign_command="gpg-2comp --comment '' --no-verbose --batch --output - %?p?--passphrase-fd 0? --armor --textmode --clearsign %?a?-u %a? %f" +set pgp_clearsign_command="gpg --no-verbose --batch --quiet --output - %?p?--passphrase-fd 0? --armor --textmode --clearsign %?a?-u %a? %f" + +# create a pgp/mime encrypted attachment +# set pgp_encrypt_only_command="pgpewrap gpg-2comp -v --batch --output - --encrypt --textmode --armor --always-trust -- -r %r -- %f" +set pgp_encrypt_only_command="pgpewrap gpg --batch --quiet --no-verbose --output - --encrypt --textmode --armor --always-trust -- -r %r -- %f" + +# create a pgp/mime encrypted and signed attachment +# set pgp_encrypt_sign_command="pgpewrap gpg-2comp %?p?--passphrase-fd 0? -v --batch --output - --encrypt --sign %?a?-u %a? --armor --always-trust -- -r %r -- %f" +set pgp_encrypt_sign_command="pgpewrap gpg %?p?--passphrase-fd 0? --batch --quiet --no-verbose --textmode --output - --encrypt --sign %?a?-u %a? --armor --always-trust -- -r %r -- %f" + +# import a key into the public key ring +set pgp_import_command="gpg --no-verbose --import %f" + +# export a key from the public key ring +set pgp_export_command="gpg --no-verbose --export --armor %r" + +# verify a key +set pgp_verify_key_command="gpg --verbose --batch --fingerprint --check-sigs %r" + +# read in the public key ring +set pgp_list_pubring_command="gpg --no-verbose --batch --quiet --with-colons --with-fingerprint --with-fingerprint --list-keys %r" + +# read in the secret key ring +set pgp_list_secring_command="gpg --no-verbose --batch --quiet --with-colons --with-fingerprint --with-fingerprint --list-secret-keys %r" + +# fetch keys +# set pgp_getkeys_command="pkspxycwrap %r" + +# pattern for good signature - may need to be adapted to locale! + +# set pgp_good_sign="^gpgv?: Good signature from " + +# OK, here's a version which uses gnupg's message catalog: +# set pgp_good_sign="`gettext -d gnupg -s 'Good signature from "' | tr -d '"'`" + +# This version uses --status-fd messages +set pgp_good_sign="^\\[GNUPG:\\] GOODSIG" + +# pattern to verify a decryption occurred +set pgp_decryption_okay="^\\[GNUPG:\\] DECRYPTION_OKAY" + diff --git a/.config/mutt/mailcap b/.config/mutt/mailcap @@ -0,0 +1 @@ +text/html; w3m -I %{charset} -T text/html; copiousoutput; diff --git a/.config/mutt/smime b/.config/mutt/smime @@ -0,0 +1,102 @@ +# vim: ft=muttrc +## The following options are only available if you have +## compiled in S/MIME support + +# If you compiled mutt with support for both PGP and S/MIME, PGP +# will be the default method unless the following option is set +# set smime_is_default + +# Uncomment this if you don't want to set labels for certificates you add. +# unset smime_ask_cert_label + +# Passphrase expiration +set smime_timeout=300 + +# Global crypto options -- these affect PGP operations as well. +set crypt_autosign = yes +set crypt_replyencrypt = yes +set crypt_replysign = yes +set crypt_replysignencrypted = yes +set crypt_verify_sig = yes + +# Section A: Key Management. + +# The (default) keyfile for signing/decrypting. Uncomment the following +# line and replace the keyid with your own. +set smime_default_key="12345678.0" + +# Uncomment to make mutt ask what key to use when trying to decrypt a message. +# It will use the default key above (if that was set) else. +# unset smime_decrypt_use_default_key + +# Path to a file or directory with trusted certificates +set smime_ca_location="/usr/local/etc/openssl/cert.pem" + +# Path to where all known certificates go. (must exist!) +set smime_certificates="~/.mutt/smime/certificates" + +# Path to where all private keys go. (must exist!) +set smime_keys="~/.mutt/smime/keys" + +# These are used to extract a certificate from a message. +# First generate a PKCS#7 structure from the message. +set smime_pk7out_command="openssl smime -verify -in %f -noverify -pk7out" + +# Extract the included certificate(s) from a PKCS#7 structure. +set smime_get_cert_command="openssl pkcs7 -print_certs -in %f" + +# Extract the signer's certificate only from a S/MIME signature (sender verification) +set smime_get_signer_cert_command="openssl smime -verify -in %f -noverify -signer %c -out /dev/null" + +# This is used to get the email address the certificate was issued to. +set smime_get_cert_email_command="openssl x509 -in %f -noout -email" + +# Add a certificate to the database using smime_keys. +set smime_import_cert_command="smime_keys add_cert %f" + + + +# Sction B: Outgoing messages + +# Algorithm to use for encryption. +# valid choices are aes128, aes192, aes256, rc2-40, rc2-64, rc2-128, des, des3 +set smime_encrypt_with="aes256" + +# Encrypt a message. Input file is a MIME entity. +set smime_encrypt_command="openssl smime -encrypt -%a -outform DER -in %f %c" + +# Algorithm for the signature message digest. +# Valid choices are md5, sha1, sha224, sha256, sha384, sha512. +set smime_sign_digest_alg="sha256" + +# Sign. +set smime_sign_command="openssl smime -sign -md %d -signer %c -inkey %k -passin stdin -in %f -certfile %i -outform DER" + + + +#Section C: Incoming messages + +# Decrypt a message. Output is a MIME entity. +set smime_decrypt_command="openssl smime -decrypt -passin stdin -inform DER -in %f -inkey %k -recip %c" + +# Verify a signature of type multipart/signed +set smime_verify_command="openssl smime -verify -inform DER -in %s %C -content %f" + +# Verify a signature of type application/x-pkcs7-mime +set smime_verify_opaque_command="\ +openssl smime -verify -inform DER -in %s %C || \ +openssl smime -verify -inform DER -in %s -noverify 2>/dev/null" + + + +# Section D: Alternatives + +# Sign. If you wish to NOT include the certificate your CA used in signing +# your public key, use this command instead. +# set smime_sign_command="openssl smime -sign -md %d -signer %c -inkey %k -passin stdin -in %f -outform DER" +# +# In order to verify the signature only and skip checking the certificate chain: +# +# set smime_verify_command="openssl smime -verify -inform DER -in %s -content %f -noverify" +# set smime_verify_opaque_command="openssl smime -verify -inform DER -in %s -noverify" +# diff --git a/.config/pacman/makepkg.conf b/.config/pacman/makepkg.conf @@ -0,0 +1,20 @@ +######################################################################### +# PACKAGE OUTPUT +######################################################################### +# +# Default: put built package and cached source in build directory +# +#-- Destination: specify a fixed directory where all packages will be placed +#PKGDEST=/home/packages +#-- Source cache: specify a fixed directory where source files will be cached +#SRCDEST=/home/sources +#-- Source packages: specify a fixed directory where all src packages will be placed +#SRCPKGDEST=/home/srcpackages +#-- Log files: specify a fixed directory where all log files will be placed +#LOGDEST=/home/makepkglogs +#-- Packager: name/email of the person or organization building packages +PACKAGER="Daniel Moch <daniel@danielmoch.com>" +#-- Specify a key to use for package signing +GPGKEY="84BDDD43" + +# vim: set ft=sh ts=2 sw=2 et: diff --git a/.config/pudb/pudb.cfg b/.config/pudb/pudb.cfg @@ -0,0 +1,18 @@ +[pudb] +breakpoints_weight = 1 +current_stack_frame = top +custom_shell = +custom_stringifier = +custom_theme = +display = auto +line_numbers = True +prompt_on_quit = True +seen_welcome = e033 +shell = internal +sidebar_width = 0.5 +stack_weight = 1 +stringifier = type +theme = dark vim +variables_weight = 1 +wrap_variables = True + diff --git a/.config/pudb/saved-breakpoints-3.6 b/.config/pudb/saved-breakpoints-3.6 @@ -0,0 +1 @@ +b /usr/bin/archey3:665 diff --git a/.config/terminfo/tmux.terminfo b/.config/terminfo/tmux.terminfo @@ -0,0 +1,7 @@ +xterm-256color|xterm with italics support, + ritm=\E[23m, sitm=\E[3m, + use=xterm-256color, + +tmux-256color|tmux with 256 colors, + ritm=\E[23m, rmso=\E[27m, sitm=\E[3m, smso=\E[7m, + use=screen-256color, diff --git a/.config/tmux/bin/battery_indicator.sh b/.config/tmux/bin/battery_indicator.sh @@ -0,0 +1,42 @@ +#!/usr/bin/env bash +# modified from http://ficate.com/blog/2012/10/15/battery-life-in-the-land-of-tmux/ + +SMILE='☻ ' + +uname=$(uname -s) + +case $uname in + *Linux*) + if [[ $(acpi | wc -l) -eq 2 ]] + then + current_charge=$(acpi | awk 'getline' | awk '{print $4}' | sed 's~%~~' | sed 's~,~~') + else + current_charge=$(acpi | awk '{print $4}' | sed 's~%~~' | sed 's~,~~') + fi + total_charge=100 + ;; + *Darwin*) + battery_info=`ioreg -rc AppleSmartBattery` + current_charge=$(echo $battery_info | grep -o '"CurrentCapacity" = [0-9]\+' | awk '{print $3}') + total_charge=$(echo $battery_info | grep -o '"MaxCapacity" = [0-9]\+' | awk '{print $3}') + ;; + *CYGWIN*) + current_charge=$(wmic path Win32_Battery Get EstimatedChargeRemaining /format:list 2>/dev/null | grep '[^[:blank:]]' | cut -d= -f2) + total_charge=100 + ;; + *) + echo "no battery status" +esac + +charged_slots=$(echo "((($current_charge/$total_charge)*10)/3)+1" | bc -l | cut -d '.' -f 1) +if [[ $charged_slots -gt 3 ]]; then + charged_slots=3 +fi + +echo -n '#[fg=colour108]' +for i in `seq 1 $charged_slots`; do echo -n "$SMILE"; done + +if [[ $charged_slots -lt 3 ]]; then + echo -n '#[fg=colour131]' + for i in `seq 1 $(echo "3-$charged_slots" | bc)`; do echo -n "$SMILE"; done +fi diff --git a/.config/tmux/bin/login-shell b/.config/tmux/bin/login-shell @@ -0,0 +1,10 @@ +#!/usr/bin/env bash + +shell=$(basename "$SHELL") + +# check if reattach-to-user-namespace is available +if [ -n "$(command -v reattach-to-user-namespace)" ]; then + reattach-to-user-namespace -l "$shell" +else + exec "$shell -l" +fi diff --git a/.config/tmux/bin/tm b/.config/tmux/bin/tm @@ -0,0 +1,30 @@ +#!/bin/sh + +# abort if we're already inside a TMUX session +[ "$TMUX" == "" ] || exit 0 +# startup a "default" session if non currently exists +# tmux has-session -t _default || tmux new-session -s _default -d + +# present menu for user to choose which workspace to open +PS3="Please choose your session: " +options=($(tmux list-sessions -F "#S" 2>/dev/null) "New Session" "zsh") +echo "Available sessions" +echo "------------------" +echo " " +select opt in "${options[@]}" +do + case $opt in + "New Session") + read -p "Enter new session name: " SESSION_NAME + tmux new -s "$SESSION_NAME" + break + ;; + "zsh") + zsh --login + break;; + *) + tmux attach-session -t $opt + break + ;; + esac +done diff --git a/.config/tmux/bin/tmux-copy.sh b/.config/tmux/bin/tmux-copy.sh @@ -0,0 +1,16 @@ +#!/usr/bin/env bash +uname=$(uname -s) + +case $uname in + *Darwin*) + reattach-to-user-namespace pbcopy + ;; + *CYGWIN*) + cat > /dev/clipboard + ;; + *Linux*) + xclip -selection clipboard + ;; + *) + return +esac diff --git a/.config/tmux/bin/tmux-paste.sh b/.config/tmux/bin/tmux-paste.sh @@ -0,0 +1,16 @@ +#!/usr/bin/env bash +uname=$(uname -s) + +case $uname in + *Darwin*) + reattach-to-user-namespace pbpaste + ;; + *CYGWIN*) + cat /dev/clipboard + ;; + *Linux*) + xclip -o + ;; + *) + return +esac diff --git a/.config/tmux/theme.sh b/.config/tmux/theme.sh @@ -0,0 +1,59 @@ +#### COLOUR + +tm_icon="👍" +tm_color_active=colour67 +tm_color_inactive=colour242 +tm_color_feature=colour131 +tm_active_border_color=colour67 + +# separators +tm_separator_left_bold="◀" +tm_separator_left_thin="❮" +tm_separator_right_bold="▶" +tm_separator_right_thin="❯" + +set -g status-left-length 32 +set -g status-right-length 150 +set -g status-interval 5 + + +# default statusbar colors +# set-option -g status-bg colour0 +set-option -g status-fg $tm_color_active +set-option -g status-bg default +set-option -g status-attr default + +# default window title colors +set-window-option -g window-status-fg $tm_color_inactive +set-window-option -g window-status-bg default +set -g window-status-format "#I #W" + +# active window title colors +set-window-option -g window-status-current-fg $tm_color_active +set-window-option -g window-status-current-bg default +set-window-option -g window-status-current-format "#[bold]#I #W" + +# pane border +set-option -g pane-border-fg $tm_color_inactive +set-option -g pane-active-border-fg $tm_active_border_color + +# message text +set-option -g message-bg default +set-option -g message-fg $tm_color_active + +# pane number display +set-option -g display-panes-active-colour $tm_color_active +set-option -g display-panes-colour $tm_color_inactive + +# clock +set-window-option -g clock-mode-colour $tm_color_active + +tm_weather="#[fg=$tm_color_feature]#(cat ~/.config/forecastio/current_forecast.txt)" +tm_battery="#(~/.config/tmux/bin/battery_indicator.sh)" + +tm_date="#[fg=$tm_color_inactive] %R %d %b" +tm_host="#[fg=$tm_color_feature,bold]#h" +tm_session_name="#[fg=$tm_color_feature,bold]$tm_icon #S" + +set -g status-left $tm_session_name' ' +set -g status-right $tm_battery' '$tm_weather' '$tm_date' '$tm_host diff --git a/.gnupg/gpg-agent.conf b/.gnupg/gpg-agent.conf @@ -0,0 +1,4 @@ +default-cache-ttl 600 +max-cache-ttl 7200 +pinentry-program /usr/bin/pinentry +enable-ssh-support diff --git a/.gnupg/gpg.conf b/.gnupg/gpg.conf @@ -0,0 +1,9 @@ +no-emit-version +keyserver hkp://pgp.mit.edu +auto-key-locate keyserver +default-key 72A97F7072DDCE28058DEF30323C9F1784BDDD43 +require-cross-certification +keyserver-options auto-key-retrieve +cert-digest-algo SHA512 +default-preference-list SHA512 SHA384 SHA256 SHA224 AES256 AES192 AES CAST5 ZLIB BZIP2 ZIP Uncompressed +personal-digest-preferences SHA512 SHA384 SHA256 SHA224 diff --git a/.inputrc b/.inputrc @@ -0,0 +1,14 @@ +# Single-tab completion +set show-all-if-ambiguous on + +# Right arrow to cycle through possible completions +Control-Space: menu-complete + +# Up arrow will try to complete from my history +"\e[A": history-search-backward + +# Make completion behavior for symlinked directories the same as regular directories +set mark-symlinked-directories on + +# My speakers are almost always muted, so use the visual bell instead +set bell-style visible diff --git a/.local/bin/dviprint b/.local/bin/dviprint @@ -0,0 +1,7 @@ +#!/usr/bin/env bash +if [[ -n "$1" ]] +then + dvips -o - $1 | lpr +else + echo "error: no file name given" >&2 +fi diff --git a/.local/bin/sncli-export b/.local/bin/sncli-export @@ -0,0 +1,2 @@ +#!/usr/bin/env bash +awk 'BEGIN{getline; getline}{print}' > ~/Downloads/$1 diff --git a/.local/bin/tmux-session b/.local/bin/tmux-session @@ -0,0 +1,95 @@ +#!/usr/bin/env bash +if [[ "$1" == "-r" ]] +then + for line in $(tmux list-sessions -F "#S") + do + session=$(echo $line | sed 's~:~~') + echo $session + case $session in + iterm) + tmux setw -t $session:1 main-pane-width $(($(tput cols) - 80)) + tmux selectl -t $session:1 main-vertical + ;; + code) + tmux setw -t $session:1 main-pane-width $(($(tput cols) - 80)) + tmux selectl -t $session:1 main-vertical + ;; + chat) + tmux setw -t $session:1 main-pane-width $(($(tput cols) - 30)) + tmux selectl -t $session:1 main-vertical + ;; + *) + return + esac + done + exit +fi + +if tmux list-sessions 2> /dev/null | grep $1 > /dev/null 2>&1 +then + tmux attach-session -t $1 + exit +fi +if echo $1 | grep iterm > /dev/null 2>&1 +then + name=iterm + tmux new-session -d -x $(tput cols) -y $(tput lines) -s $name vim + tmux rename-window -t $name:1 code + tmux setw main-pane-width $(($(tput cols) - 80)) + tmux splitw + tmux selectl main-vertical + if echo $1 | grep chat > /dev/null 2>&1 + then + tmux new-window -t $name -n "chat" irssi + tmux setw main-pane-width $(($(tput cols) - 30)) + tmux splitw -h cat ~/.irssi/nicklistfifo + tmux selectl main-vertical + tmux select-pane -t $name:2.1 + tmux send-keys -t $name:2.1 "/nicklist fifo" "C-m" "/keyring" "C-m" "/keyring reset" + tmux new-window -t $name -n "social" tootstream + tmux send-keys -t $name:3.1 "stream home" "C-m" + tmux splitw -h rainbowstream + fi + tmux new-window -t $name -n "mail" mutt + if echo $1 | grep rss > /dev/null 2>&1 + then + tmux splitw -h newsboat + tmux renamew "mail-&-rss" + fi + tmux new-window -t $name -n vitals htop + uname=$(uname -s) + case $uname in + *Darwin*) + tmux splitw -h nettop + ;; + *Linux*) + tmux splitw -h sudo jnettop + ;; + esac + tmux new-window -t $name -n simplenote sncli +fi +if [[ $1 == "code" ]] +then + name=code + tmux new-session -d -x $(tput cols) -y $(tput lines) -s $name vim + tmux rename-window -t $name:1 code + tmux setw main-pane-width $(($(tput cols) - 80)) + tmux splitw + tmux selectl main-vertical +fi +if [[ $1 == "notes" ]] +then + name=notes + tmux new-session -d -x $(tput cols) -y $(tput lines) -s $name sncli +fi +if [[ $1 == "chat" ]] +then + name=chat + tmux new-session -d -x $(tput cols) -y $(tput lines) -s $name irssi + tmux setw main-pane-width $(($(tput cols) - 30)) + tmux splitw -h cat ~/.irssi/nicklistfifo + tmux selectl main-vertical +fi +tmux select-window -t $name:1 +tmux select-pane -t $name:1.1 +tmux attach-session -t $name diff --git a/.local/bin/xlock-off b/.local/bin/xlock-off @@ -0,0 +1,2 @@ +#!/bin/sh +sleep 1 && xset dpms force off diff --git a/.minttyrc b/.minttyrc @@ -0,0 +1,31 @@ +BoldAsFont=-1 +Transparency=off +OpaqueWhenFocused=yes +Font=Consolas +FontHeight=11 +Term=xterm-256color +FontSmoothing=full +CursorType=block +CursorBlinks=no +CursorColour=188,188,188 +ForegroundColour=188,188,188 +BackgroundColour=38,38,38 +Black=28,28,28 +Red=175,95,95 +Green=95,135,95 +Yellow=135,135,95 +Blue=95,135,175 +Magenta=95,95,135 +Cyan=95,135,135 +White=108,108,108 +BoldBlack=68,68,68 +BoldRed=255,135,0 +BoldGreen=135,175,135 +BoldYellow=255,255,175 +BoldBlue=143,175,215 +BoldMagenta=135,135,175 +BoldCyan=95,175,175 +BoldWhite=255,255,255 +BellType=0 +BellFlash=yes +Scrollbar=none diff --git a/.muttrc b/.muttrc @@ -0,0 +1,49 @@ +ignore * +unignore from: subject to cc date x-mailer x-url user-agent + +hdr_order date from to cc subject + +macro index \eb "<search>~b " "search in message bodies" + +macro index,pager,attach,compose \cb "\ +<enter-command> set my_pipe_decode=\$pipe_decode pipe_decode<Enter>\ +<pipe-message> urlview<Enter>\ +<enter-command> set pipe_decode=\$my_pipe_decode; unset my_pipe_decode<Enter>" \ +"call urlview to extract URLs out of a message" + +macro generic,pager <F1> "<shell-escape> less /usr/local/Cellar/mutt/1.6.2/share/doc/mutt/manual.txt<Enter>" "show Mutt documentation" + +macro index,pager y "<change-folder>?<toggle-mailboxes>" "show incoming mailboxes list" + +set sort="reverse-threads" +set strict_threads="yes" +set sort_browser="reverse-date" +set sort_aux="last-date-received" +set query_command = "khard email --parsable --search-in-source-files '%s'" +unset collapse_unread + +bind browser y exit +bind index - collapse-thread +bind index _ collapse-all + +mime_lookup application/octet-stream +set mailcap_path="~/.config/mutt/mailcap" + +attachments +A */.* +attachments -A text/x-vcard application/pgp.* +attachments -A application/x-pkcs7-.* +attachments +I text/plain +attachments -A message/external-body +attachments -I message/external-body + +auto_view text/html +alternative_order text/plain text/enriched text/html + +set imap_authenticators="login" +set smtp_authenticators="login" + +source ~/.config/mutt/smime +source ~/.config/mutt/gpg +source ~/.mutt/account.default +source ~/.mutt/account.macros +source ~/.config/mutt/colors diff --git a/.pylintrc b/.pylintrc @@ -0,0 +1,262 @@ +[MASTER] + +# Specify a configuration file. +#rcfile= + +# Python code to execute, usually for sys.path manipulation such as +# pygtk.require(). +#init-hook= + +# Add files or directories to the blacklist. They should be base names, not +# paths. +ignore=CVS .git + +# Pickle collected data for later comparisons. +persistent=yes + +# List of plugins (as comma separated values of python modules names) to load, +# usually to register additional checkers. +load-plugins= + + +[MESSAGES CONTROL] + +# Enable the message, report, category or checker with the given id(s). You can +# either give multiple identifier separated by comma (,) or put this option +# multiple time. See also the "--disable" option for examples. +#enable= + +# Disable the message, report, category or checker with the given id(s). You +# can either give multiple identifiers separated by comma (,) or put this +# option multiple times (only on the command line, not in the configuration +# file where it should appear only once).You can also use "--disable=all" to +# disable everything first and then reenable specific checks. For example, if +# you want to run only the similarities checker, you can use "--disable=all +# --enable=similarities". If you want to run only the classes checker, but have +# no Warning level messages displayed, use"--disable=all --enable=classes +# --disable=W" +#disable= + + +[REPORTS] + +# Set the output format. Available formats are text, parseable, colorized, msvs +# (visual studio) and html. You can also give a reporter class, eg +# mypackage.mymodule.MyReporterClass. +output-format=text + +# Put messages in a separate file for each module / package specified on the +# command line instead of printing them on stdout. Reports (if any) will be +# written in a file name "pylint_global.[txt|html]". +files-output=no + +# Tells whether to display a full report or only the messages +reports=yes + +# Python expression which should return a note less than 10 (10 is the highest +# note). You have access to the variables errors warning, statement which +# respectively contain the number of errors / warnings messages and the total +# number of statements analyzed. This is used by the global evaluation report +# (RP0004). +evaluation=10.0 - ((float(5 * error + warning + refactor + convention) / statement) * 10) + +# Template used to display messages. This is a python new-style format string +# used to format the message information. See doc for all details +#msg-template= + + +[BASIC] + +# List of builtins function names that should not be used, separated by a comma +bad-functions=map,filter,apply,input + +# Regular expression which should only match correct module names +module-rgx=(([a-z_][a-z0-9_]*)|([A-Z][a-zA-Z0-9]+))$ + +# Regular expression which should only match correct module level names +const-rgx=(([A-Z_][A-Z0-9_]*)|(__.*__))$ + +# Regular expression which should only match correct class names +class-rgx=[A-Z_][a-zA-Z0-9]+$ + +# Regular expression which should only match correct function names +function-rgx=[a-z_][a-z0-9_]{2,30}$ + +# Regular expression which should only match correct method names +method-rgx=[a-z_][a-z0-9_]{2,30}$ + +# Regular expression which should only match correct instance attribute names +attr-rgx=[a-z_][a-z0-9_]{2,30}$ + +# Regular expression which should only match correct argument names +argument-rgx=[a-z_][a-z0-9_]{2,30}$ + +# Regular expression which should only match correct variable names +variable-rgx=[a-z_][a-z0-9_]{2,30}$ + +# Regular expression which should only match correct attribute names in class +# bodies +class-attribute-rgx=([A-Za-z_][A-Za-z0-9_]{2,30}|(__.*__))$ + +# Regular expression which should only match correct list comprehension / +# generator expression variable names +inlinevar-rgx=[A-Za-z_][A-Za-z0-9_]*$ + +# Good variable names which should always be accepted, separated by a comma +good-names=i,j,k,ex,Run,_ + +# Bad variable names which should always be refused, separated by a comma +bad-names=foo,bar,baz,toto,tutu,tata + +# Regular expression which should only match function or class names that do +# not require a docstring. +no-docstring-rgx=__.*__ + +# Minimum line length for functions/classes that require docstrings, shorter +# ones are exempt. +docstring-min-length=-1 + + +[FORMAT] + +# Maximum number of characters on a single line. +max-line-length=120 + +# Regexp for a line that is allowed to be longer than the limit. +ignore-long-lines=^\s*(# )?<?https?://\S+>?$ + +# Allow the body of an if to be on the same line as the test if there is no +# else. +single-line-if-stmt=no + +# List of optional constructs for which whitespace checking is disabled +no-space-check=trailing-comma,dict-separator + +# Maximum number of lines in a module +max-module-lines=1000 + +# String used as indentation unit. This is usually " " (4 spaces) or "\t" (1 +# tab). +indent-string=' ' + + +[MISCELLANEOUS] + +# List of note tags to take in consideration, separated by a comma. +notes=FIXME,XXX,TODO + + +[SIMILARITIES] + +# Minimum lines number of a similarity. +min-similarity-lines=4 + +# Ignore comments when computing similarities. +ignore-comments=yes + +# Ignore docstrings when computing similarities. +ignore-docstrings=yes + +# Ignore imports when computing similarities. +ignore-imports=no + + +[TYPECHECK] + +# Tells whether missing members accessed in mixin class should be ignored. A +# mixin class is detected if its name ends with "mixin" (case insensitive). +ignore-mixin-members=yes + +# List of classes names for which member attributes should not be checked +# (useful for classes with attributes dynamically set). +ignored-classes=SQLObject,DateTimeField,CharField,ForecastioDataBlock + +# List of members which are set dynamically and missed by pylint inference +# system, and so shouldn't trigger E0201 when accessed. Python regular +# expressions are accepted. +generated-members=REQUEST,acl_users,aq_parent + + +[VARIABLES] + +# Tells whether we should check for unused import in __init__ files. +init-import=no + +# A regular expression matching the beginning of the name of dummy variables +# (i.e. not used). +dummy-variables-rgx=_$|dummy + +# List of additional names supposed to be defined in builtins. Remember that +# you should avoid to define new builtins when possible. +additional-builtins= + + +[CLASSES] + +# List of method names used to declare (i.e. assign) instance attributes. +defining-attr-methods=__init__,__new__,setUp + +# List of valid names for the first argument in a class method. +valid-classmethod-first-arg=cls + +# List of valid names for the first argument in a metaclass class method. +valid-metaclass-classmethod-first-arg=mcs + + +[DESIGN] + +# Maximum number of arguments for function / method +max-args=5 + +# Argument names that match this expression will be ignored. Default to name +# with leading underscore +ignored-argument-names=_.* + +# Maximum number of locals for function / method body +max-locals=15 + +# Maximum number of return / yield for function / method body +max-returns=6 + +# Maximum number of branch for function / method body +max-branches=12 + +# Maximum number of statements in function / method body +max-statements=50 + +# Maximum number of parents for a class (see R0901). +max-parents=7 + +# Maximum number of attributes for a class (see R0902). +max-attributes=7 + +# Minimum number of public methods for a class (see R0903). +min-public-methods=2 + +# Maximum number of public methods for a class (see R0904). +max-public-methods=20 + + +[IMPORTS] + +# Deprecated modules which should not be used, separated by a comma +deprecated-modules=regsub,TERMIOS,Bastion,rexec + +# Create a graph of every (i.e. internal and external) dependencies in the +# given file (report RP0402 must not be disabled) +import-graph= + +# Create a graph of external dependencies in the given file (report RP0402 must +# not be disabled) +ext-import-graph= + +# Create a graph of internal dependencies in the given file (report RP0402 must +# not be disabled) +int-import-graph= + + +[EXCEPTIONS] + +# Exceptions that will emit a warning when being caught. Defaults to +# "Exception" +overgeneral-exceptions=Exception diff --git a/.rainbow_config.json b/.rainbow_config.json @@ -0,0 +1,42 @@ +{ + "HEARTBEAT_TIMEOUT": 120, + "IMAGE_ON_TERM": false, + "IMAGE_RESIZE_TO_FIT": false, + "THEME": "monokai", + "ASCII_ART": true, + "HIDE_PROMPT": true, + "PREFIX": "#owner#place#me#keyword", + "SEARCH_TYPE": "mixed", + "SEARCH_MAX_RECORD": 5, + "HOME_TWEET_NUM": 5, + "RETWEETS_SHOW_NUM": 5, + "CONVERSATION_MAX": 30, + "QUOTE_FORMAT": "#comment https://twitter.com/#owner/status/#tid", + "THREAD_META_LEFT": "(#id) #clock", + "THREAD_META_RIGHT": "#clock (#id)", + "THREAD_MIN_WIDTH": 20, + "NOTIFY_FORMAT": " #source_user #notify #clock", + "MESSAGES_DISPLAY": 5, + "TREND_MAX": 10, + "LIST_MAX": 5, + "ONLY_LIST": [], + "IGNORE_LIST": [], + "HISTORY_FILENAME": "~/.rainbow_history", + "IMAGE_SHIFT": 2, + "IMAGE_MAX_HEIGHT": 90, + "STREAM_DELAY": 0, + "USER_DOMAIN": "userstream.twitter.com", + "PUBLIC_DOMAIN": "stream.twitter.com", + "SITE_DOMAIN": "sitestream.twitter.com", + "FORMAT": { + "TWEET": { + "CLOCK_FORMAT": "%Y/%m/%d %H:%M:%S", + "DISPLAY": "\n #name #nick #clock \n \u267a:#rt_count \u2665:#fa_count id:#id via #client #fav\n #tweet" + }, + "MESSAGE": { + "CLOCK_FORMAT": "%Y/%m/%d %H:%M:%S", + "DISPLAY": "\n #sender_name #sender_nick #to #recipient_name #recipient_nick :\n #clock message_id:#id\n #message" + } + }, + "POCKET_SUPPORT": false +}+ \ No newline at end of file diff --git a/.snclirc b/.snclirc @@ -0,0 +1,47 @@ +[sncli] +cfg_sn_username=djmoch@gmail.com +cfg_sn_password_eval=secret-tool lookup account djmoch@gmail.com service com.simplenote +clr_default_fg=default +clr_default_bg=default +clr_status_bar_fg=black +clr_status_bar_bg=brown +clr_log_fg=black +clr_log_bg=brown +clr_user_input_bar_fg=default +clr_user_input_bar_bg=default +clr_note_focus_fg=black +clr_note_focus_bg=light blue +clr_note_title_day_fg=dark blue +; clr_note_title_day_bg +clr_note_title_week_fg=dark green +; clr_note_title_week_bg +clr_note_title_month_fg=brown +; clr_note_title_month_bg +clr_note_title_year_fg=default +; clr_note_title_year_bg +clr_note_title_ancient_fg=dark red +; clr_note_title_ancient_bg +; clr_note_date_fg +; clr_note_date_bg +; clr_note_flags_fg +; clr_note_flags_bg +clr_note_tags_fg=brown +; clr_note_tags_bg +; clr_note_content_fg +; clr_note_content_bg +clr_note_content_focus_fg=black +clr_note_content_focus_bg=light blue +clr_note_content_old_fg=light gray +clr_note_content_old_bg=default +clr_note_content_old_focus_fg=black +clr_note_content_old_focus_bg=light blue +clr_help_focus_fg=black +clr_help_focus_bg=light blue +; clr_help_header_fg +; clr_help_header_bg +; clr_help_config_fg +; clr_help_config_bg +; clr_help_value_fg +; clr_help_value_bg +; clr_help_descr_fg +; clr_help_descr_bg diff --git a/.ssh/config b/.ssh/config @@ -0,0 +1,14 @@ +Host dotcom + HostName danielmoch.com + Port 22 + User root + +Host dotcom-public + HostName 104.236.52.17 + Port 22 + User root + +Host pi + HostName raspberrypi.localdomain + Port 22 + User pi diff --git a/.tmux.conf b/.tmux.conf @@ -0,0 +1,112 @@ +set -g history-limit 20000 + +# Turn off escape delay, which is very annoying in Vim +set -s escape-time 0 + +# automatically renumber tmux windows +set -g renumber-windows on + +# Vi mode +set-window-option -g mode-keys vi + +# unbind default prefix and set it to Ctrl+a +unbind C-b +set -g prefix C-a +bind C-a send-prefix + +# Activity Monitoring +setw -g monitor-activity off +set -g visual-activity off + +# Rather than constraining window size to the maximum size of any client +# connected to the *session*, constrain window size to the maximum size of any +# client connected to *that window*. Much more reasonable. +setw -g aggressive-resize on + +# make window/pane index start with 1 +set -g base-index 1 +setw -g pane-base-index 1 + +set-option -g set-titles on +set-option -g set-titles-string "#T - #W" + +# Set truecolor mode +set-option -g default-terminal "tmux-256color" +set-option -ga terminal-overrides ",xterm-256color:Tc" + +# set-window-option -g automatic-rename on + +###################### +#### Key Bindings #### +###################### + +# reload config file +bind r source-file ~/.tmux.conf \; display "Config Reloaded!" + +# quickly open a new window +bind N new-window + +# split window and fix path for tmux 1.9 +bind | split-window -h -c "#{pane_current_path}" +bind - split-window -v -c "#{pane_current_path}" + +# synchronize all panes in a window +bind y setw synchronize-panes + +# pane movement shortcuts +bind h select-pane -L +bind j select-pane -D +bind k select-pane -U +bind l select-pane -R + +bind -r C-h select-window -t :- +bind -r C-l select-window -t :+ + +# Resize pane shortcuts +bind -r H resize-pane -L 10 +bind -r J resize-pane -D 10 +bind -r K resize-pane -U 10 +bind -r L resize-pane -R 10 + +# Reorder the current window left and right +bind C-h swap-window -t -1 +bind C-l swap-window -t +1 + +# enable mouse support for switching panes/windows +setw -g mouse on +# set-option -g -q mouse on + +bind -T root PPage if-shell -F "#{alternate_on}" "send-keys PPage" "copy-mode -e; send-keys PPage" +bind -T copy-mode-vi PPage send -X page-up +bind -T copy-mode-vi NPage send -X page-down + +bind -T root WheelUpPane if-shell -F -t = "#{alternate_on}" "select-pane -t =; send-keys -M" "select-pane -t =; copy-mode -e; send-keys -M" +bind -T root WheelDownPane if-shell -F -t = "#{alternate_on}" "select-pane -t =; send-keys -M" "select-pane -t =; send-keys -M" +bind -T copy-mode-vi WheelUpPane send -X halfpage-up +bind -T copy-mode-vi WheelDownPane send -X halfpage-down + +# maximizing and restoring windows +unbind Up +bind Up new-window -d -n fullscreen \; swap-pane -s fullscreen.1 \; select-window -t fullscreen +unbind Down +bind Down last-window \; swap-pane -s fullscreen.1 \; kill-window -t fullscreen + +# set vi mode for copy mode +setw -g mode-keys vi +# more settings to make copy-mode more vim-like +unbind [ +bind Escape copy-mode +unbind p +bind p paste-buffer +bind -T copy-mode-vi 'v' send -X begin-selection +bind -T copy-mode-vi 'y' send -X copy-pipe "~/.config/tmux/bin/tmux-copy.sh" + +# Buffers to/from Mac clipboard, yay tmux book from pragprog +bind C-c run "tmux save-buffer - | ~/.config/tmux/bin/tmux-copy.sh" +bind C-v run "tmux set-buffer \"$(~/.config/tmux/bin/tmux-paste.sh)\"; tmux paste-buffer" + +############################## +### Color & Style Settings ### +############################## + +source ~/.config/tmux/theme.sh diff --git a/.vim/after/ftplugin/crontab.vim b/.vim/after/ftplugin/crontab.vim @@ -0,0 +1,2 @@ +" Don't enforce horizontal character limit +setlocal fo-=t diff --git a/.vim/after/ftplugin/cs.vim b/.vim/after/ftplugin/cs.vim @@ -0,0 +1 @@ +setlocal foldmarker=#region,#endregion diff --git a/.vim/after/ftplugin/css.vim b/.vim/after/ftplugin/css.vim @@ -0,0 +1 @@ +compiler csslint diff --git a/.vim/after/ftplugin/gitcommit.vim b/.vim/after/ftplugin/gitcommit.vim @@ -0,0 +1 @@ +setlocal spell spelllang=en_us diff --git a/.vim/after/ftplugin/help.vim b/.vim/after/ftplugin/help.vim @@ -0,0 +1 @@ +setlocal nospell diff --git a/.vim/after/ftplugin/java.vim b/.vim/after/ftplugin/java.vim @@ -0,0 +1,10 @@ +" Break for code lines too +setlocal fo+=t + +" Reduce tab size for Java +setlocal sts=2 sw=2 + +" Wider text width for Java +setlocal tw=120 + +compiler javac diff --git a/.vim/after/ftplugin/markdown.vim b/.vim/after/ftplugin/markdown.vim @@ -0,0 +1,2 @@ +" Enable spell checking by default +setlocal spell spelllang=en_us diff --git a/.vim/after/ftplugin/python.vim b/.vim/after/ftplugin/python.vim @@ -0,0 +1,8 @@ +" Break for non-comment lines too +setlocal fo+=t + +" A wider text width is okay for Python +setlocal tw=120 + +" Always set the compiler +compiler pylint diff --git a/.vim/after/ftplugin/text.vim b/.vim/after/ftplugin/text.vim @@ -0,0 +1,2 @@ +" Enable spell checking by default +setlocal spell spelllang=en_us diff --git a/.vim/after/ftplugin/vim.vim b/.vim/after/ftplugin/vim.vim @@ -0,0 +1,2 @@ +" Break non-comment lines too +setlocal fo+=t diff --git a/.vim/after/ftplugin/yaml.vim b/.vim/after/ftplugin/yaml.vim @@ -0,0 +1 @@ +setlocal sts=2 sw=2 diff --git a/.vim/after/syntax/html.vim b/.vim/after/syntax/html.vim @@ -0,0 +1,23 @@ +" Vim syntax file +" Language: HTML (version 5) +" Maintainer: Rodrigo Machado <rcmachado@gmail.com> +" URL: http://rm.blog.br/vim/syntax/html.vim +" Last Change: 2009 Aug 19 +" License: Public domain +" (but let me know if you liked it :) ) +" +" Note: This file just adds the new tags from HTML 5 +" and don't replace default html.vim syntax file + +" HTML 5 tags +syn keyword htmlTagName contained article aside audio bb canvas command datagrid +syn keyword htmlTagName contained datalist details dialog embed figure footer +syn keyword htmlTagName contained header hgroup keygen mark meter nav output +syn keyword htmlTagName contained progress time ruby rt rp section time video + +" HTML 5 arguments +syn keyword htmlArg contained autofocus placeholder min max step +syn keyword htmlArg contained contenteditable contextmenu draggable hidden item +syn keyword htmlArg contained itemprop list subject spellcheck +" this doesn't work because default syntax file alredy define a 'data' attribute +syn match htmlArg "\<\(data-[\-a-zA-Z0-9_]\+\)=" contained+ \ No newline at end of file diff --git a/.vim/gvimrc b/.vim/gvimrc @@ -0,0 +1,9 @@ +nnoremap <Leader>rc :e $MYGVIMRC<CR> + + +if has('gui_gtk2') || has('gui_gtk3') + set guifont=Meslo\ LG\ M\ DZ\ Regular\ 10 +else + set guifont=Meslo\ LG\ M\ DZ\ Regular:h12,Menlo\ Regular:h12,Consolas:h11 +endif +set guioptions=egm diff --git a/.vim/pack/update_plugins b/.vim/pack/update_plugins @@ -0,0 +1,16 @@ +#!/bin/bash +update() +{ + echo "Updating $1" + cd $1 + git pull + cd - > /dev/null +} + +export -f update +cd bundle/opt/ +ls -1d */ | xargs -n 1 -P 10 -I {} bash -c 'update "$@"' _ {} +cd - +cd bundle/start/ +ls -1d */ | xargs -n 1 -P 10 -I {} bash -c 'update "$@"' _ {} +cd - diff --git a/.vim/skel/mit.skel b/.vim/skel/mit.skel @@ -0,0 +1,23 @@ + +The MIT License (MIT) + +Copyright (c) {{ year }} Daniel Moch + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. + diff --git a/.vim/skel/reserved.skel b/.vim/skel/reserved.skel @@ -0,0 +1,3 @@ + +Copyright (c) {{ year }}, Daniel Moch. All rights reserved. + diff --git a/.vim/vimrc b/.vim/vimrc @@ -0,0 +1,379 @@ +set nocompatible + +" Vim starting {{{ +if has('vim_starting') + if (has('win32') || has('win64')) + set undodir=$HOME/vimfiles/undo + if v:servername !~ '.*[0-9]$' + silent! execute '!rmdir /S /Q "'.$HOME.'/vimfiles/vimtemp" &&' + \ ' mkdir "'.$HOME.'/vimfiles/vimtemp"' + endif + set backupdir=$HOME/vimfiles/vimtemp// + set directory=$HOME/vimfiles/vimtemp// + set spellfile=$HOME/vimfiles/en.utf-8.add + if exists('$HOME') && has('gui_running') && (argc() == 0) + cd $HOME + endif + else + set undodir=$HOME/.vim/undo + if v:servername !~ '.*[0-9]$' + silent! execute '!rm -rf "'.$HOME.'/.vim/vimtemp"' + silent! execute '!mkdir "'.$HOME.'/.vim/vimtemp"' + endif + set backupdir=$HOME/.vim/vimtemp// + set directory=$HOME/.vim/vimtemp// + set spellfile=$HOME/.vim/en.utf-8.add + endif + if has('win32') || has('win64') || $PATH =~ 'cygdrive' + set fileformats=dos,unix + endif + set encoding=utf-8 + set undofile + if isdirectory(expand('~/Documents/src/vim_plugins')) + set packpath+=~/Documents/src/vim_plugins + endif + syntax on + filetype plugin indent on +endif +" }}} + +" Globals {{{ +let g:gutentags_project_root = ['.git','.project','.svn'] +let delimitMate_expand_space = 1 +let delimitMate_expand_cr = 1 +if exists('$TMUX') + packadd vim-slime + let g:slime_no_mappings = 1 + let g:slime_target = 'tmux' + let g:slime_paste_file = tempname() + let g:slime_default_config = {"socket_name": split($TMUX, ",")[0], "target_pane": ":.2"} +endif +" }}} + +" Helper functions {{{ +function! MyFileEncoding() + if &fileencoding != '' + return '['.&fileencoding.']' + else + return '' + endif +endfunction + +function! MyHexToggle() + if !&binary + setlocal binary + setlocal nonumber + let l:modified = &modified + %!xxd + if &ft + let b:filetype = &ft + endif + setlocal ft=xxd + let &modified = l:modified + else + setlocal nobinary + setlocal number + let l:modified = &modified + %!xxd -r + if exists('b:filetype') + let &ft=b:filetype + else + setlocal ft= + endif + let &modified = l:modified + endif +endfunction + +function! MySkeleton() + let l:skelfiles = glob('~/.vim/skel/*.skel', v:false, v:true) + let l:idx = 1 + let l:msg = 'Available licenses:' + for l:skelfile in l:skelfiles + let l:msg .= "\n\t".l:idx."\t".l:skelfile + let l:idx += 1 + endfor + let l:msg .= "\n\t".l:idx."\tNone" + echo l:msg + let l:selection = 0 + while l:selection < 1 || l:selection > l:idx + let l:selection = input("Use license: ") + endwhile + if l:selection == l:idx + return + endif + let l:skel = readfile(l:skelfiles[l:selection - 1]) + let l:comments = split(&comments, ',') + for l:token in l:comments + if l:token =~ '^b\?:' + let l:comment = substitute(l:token, '^b\?:', '', '') + let l:comment .= ' ' + endif + endfor + let l:idx = 0 + for l:line in l:skel + let l:line = l:comment . l:line + let l:line = substitute(l:line, '{{ year }}', "\\=strftime('%Y')", '') + let l:skel[l:idx] = l:line + let l:idx += 1 + endfor + + let l:lines = join(l:skel, "\n") + silent execute '0put =printf(\"%s\", l:lines)' + set modified + normal G +endfunction + +function! MyWinWidth() + let l:textwidth = &tw ? &tw : 80 + if &number + let l:numwidth = &numberwidth > len(line('$')) + 1 ? + \ &numberwidth : len(line('$')) + 1 + else + let l:numwidth = 0 + endif + return winwidth(0) > (2 * l:textwidth) + (2 * l:numwidth) +endfunction + +function! MyScratchBuffer() abort + let l:wincmd = MyWinWidth() ? 'vnew' : 'new' + exec l:wincmd + setlocal bufhidden=hide buftype=nofile noswapfile +endfunction + +function! MyPasteStatus() + if &paste && get(w:,'active_window',0) + return '[p]' + else + return '' + endif +endfunction + +function! MySpellStatus() + if &spell + return '[s]' + else + return '' + endif +endfunction + +function! MyDiffOpt() + if MyWinWidth() + set diffopt+=vertical + else + set diffopt-=vertical + endif +endfunction + +function! MyItalicize() + if exists('*execute') + let l:higroups = split(execute(':highlight'), '\n') + for l:group in l:higroups + if l:group =~# 'gui=[\w,]*italic' + let l:groupname = split(l:group)[0] + let l:ctermcmd = '' + for l:token in split(l:group) + if l:token =~# '^cterm=' + let l:ctermcmd = l:token + endif + endfor + if l:ctermcmd == '' + let l:ctermcmd = 'cterm=italic' + else + if l:ctermcmd !~# 'italic' + let l:ctermcmd = l:ctermcmd.',italic' + endif + endif + execute 'highlight '.l:groupname.' '.l:ctermcmd + endif + endfor + endif +endfunction + +function! MyShowMode() + if get(w:, 'active_window', 0) + return '['.mode().']' + else + return '' + endif +endfunction + +function! OptStatus(function) + if exists('*'.a:function) + return call(a:function, []) + else + return '' + endif +endfunction + +function! InitializeClasspath() + if(filereadable('.vim_java_classpath')) + so .vim_java_classpath + endif +endfunction + +function! BuildJavaMakeprg() + if exists('b:vim_java_classpath') + let &makeprg = &makeprg.' -cp '.b:vim_java_classpath + endif +endfunction + +function! MyNewWindow(...) + if a:0 == 0 + let l:filename = '' + else + let l:filename = a:1 + endif + if MyWinWidth() + execute 'vnew '.l:filename + else + execute 'new '.l:filename + endif +endfunction + +function! MyHelp(topic) + if MyWinWidth() + execute 'vert help '.a:topic + else + execute 'help '.a:topic + endif +endfunction + +function! MyBuffer(buffer) + let l:splitcmd = MyWinWidth() ? 'vsplit' : 'split' + execute l:splitcmd + execute bufnr(a:buffer).'buffer' +endfunction +" }}} + +" Commands {{{ +if has('mac') + command! -range=% IX silent execute <line1>.','.<line2>."w !curl -n -F" + \ ."'f:1=<-' ix.io | tr -d '\\n' | " + \."reattach-to-user-namespace pbcopy" +endif +command! -complete=file -nargs=? New call MyNewWindow(<f-args>) +command! -complete=help -nargs=1 Help call MyHelp(<f-args>) +command! -complete=buffer -nargs=1 Buffer call MyBuffer(<f-args>) +" }}} + +" Auto-commands {{{ +augroup myvimrc + autocmd! + if has('win32') || has('win64') + autocmd BufWritePost _*imrc silent! execute '!attrib +H' + \.bufname('%') | so % | call MyItalicize() + else + autocmd BufWritePost *imrc so % | call MyItalicize() + endif + autocmd VimResized * wincmd = | call MyDiffOpt() + autocmd User GoyoEnter Limelight + autocmd User GoyoLeave Limelight! + autocmd QuickFixCmdPost [^l]* nested cwindow + autocmd QuickFixCmdPost l* nested lwindow + autocmd QuickFixCmdPre [^l]* nested silent! cclose + autocmd QuickFixCmdPre l* nested silent! lclose + autocmd BufNewFile *.py,*.cpp,*.java call MySkeleton() + autocmd VimEnter * let w:active_window = 1 | call MyItalicize() | call MyDiffOpt() + autocmd WinEnter * let w:active_window = 1 + autocmd WinLeave * unlet! w:active_window + if has('win32') || has('win64') + autocmd GuiEnter * simalt ~x + elseif has('gui_macvim') + autocmd GuiEnter * set fullscreen + endif + autocmd ColorScheme * call MyItalicize() +augroup END +" }}} + +" Key mappings {{{ +let mapleader=";" +nnoremap rc :New $MYVIMRC<CR> +nnoremap <Leader>g :GrepJob!<Space> +nnoremap <Leader>' :vnew<CR> +nnoremap <Leader>- :new<CR> +nnoremap <Leader>e :e **/ +nnoremap <Leader>s :call MyScratchBuffer()<CR> +nnoremap <Leader>n :New<Space> +nnoremap <Leader>h :Help<Space> +nnoremap <Leader>l :ls<CR>:b +nnoremap <leader>b :Buffer<Space> +nnoremap <leader>x :call MyHexToggle()<CR> +if exists('$TMUX') + xmap <leader>r <Plug>SlimeRegionSend + nmap <leader>r <Plug>SlimeMotionSend + nmap <leader>rr <Plug>SlimeLineSend +endif +if has('win32') || has('win64') + nnoremap <Leader>o :execute 'silent ! start '.expand('<cWORD>')<CR> +elseif $PATH =~ 'cygdrive' + nnoremap <Leader>o :execute 'silent !cygstart ' + \ .expand(shellescape('<cWORD>')) \| redraw!<CR> +elseif has('mac') + nnoremap <Leader>o :execute 'silent !open ' + \ .expand(shellescape('<cWORD>')) \| redraw!<CR> +endif +nnoremap <Leader>c :silent! execute 'cclose' \| + \ silent! execute 'lclose'<CR> +nnoremap <F4> :setlocal spell spelllang=en_us<CR> +nnoremap <F5> :nohl<CR> +nnoremap <F6> :call MySkeleton()<CR> +nnoremap <F8> :Goyo<CR> +if has('win32') || has('win64') + nnoremap <F9> :MakeJob! %:S<CR> +else + nnoremap <F9> :MakeJob! %<CR> +endif +" }}} + +" General options {{{ +set statusline=%{MyShowMode()}%{MySpellStatus()}%{MyPasteStatus()}%<%f%m +set statusline+=%r%h%q%w%{OptStatus('fugitive#statusline')}%=[%{&ff}] +set statusline+=%{MyFileEncoding()}%y%{OptStatus('ObsessionStatus')} +set statusline+=[%p%%][Ln:%l/%L,Col:%v] +colorscheme apprentice +set ttyfast +if $TERM_PROGRAM=="iTerm.app" || $PATH =~ 'cygdrive' || $COLORTERM =="truecolor" + set termguicolors + if $TERM=='tmux-256color' + set t_8f=[38;2;%lu;%lu;%lum + set t_8b=[48;2;%lu;%lu;%lum + endif +endif +set nowrap +set noshowmode +set showcmd +set expandtab +set textwidth=72 +set softtabstop=4 +set shiftwidth=4 +set autoindent +set visualbell +set smartcase +set number +set foldmethod=marker +set ttimeoutlen=0 +if !exists('$TMUX') + set clipboard+=unnamed +endif +set laststatus=2 +set wildmenu +set wildmode=longest:full,full +set nofileignorecase +set history=10000 +set hlsearch +set incsearch +set backspace=indent,eol,start +set backup +set wildignore+=tags,*.class,*.pyc,*.pyo,__pycache__,*.o +if has('win32') || has('win64') + set grepprg=findstr\ /n\ /S + set viminfo+=n$HOME/vimfiles/viminfo +else + set grepprg=ag\ --vimgrep\ --ignore=tags\ -p\ ~/.config/git/ignore\ + \ $* + set grepformat=%f:%l:%c:%m + set viminfo+=n$HOME/.vim/viminfo +endif +set autowrite +set pastetoggle=<F2> +" }}}