summary refs log tree commit diff
path: root/home
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--home/.config/git/config21
-rw-r--r--home/.config/git/ignore2
-rw-r--r--home/.config/htop/htoprc29
-rw-r--r--home/.config/nvim/colors/trivial.vim65
-rw-r--r--home/.config/nvim/ftdetect/mdoc.vim1
-rw-r--r--home/.config/nvim/init.vim37
-rw-r--r--home/.config/nvim/syntax/mdoc.vim12
-rw-r--r--home/.editrc1
-rw-r--r--home/.gdbinit1
-rw-r--r--home/.hushlogin0
-rw-r--r--home/.inputrc1
-rw-r--r--home/.lldbinit1
-rwxr-xr-xhome/.local/bin/aes7
-rwxr-xr-xhome/.local/bin/def47
-rwxr-xr-xhome/.local/bin/git-password7
-rwxr-xr-xhome/.local/bin/nasd9
-rwxr-xr-xhome/.local/bin/notify-send9
-rwxr-xr-xhome/.local/bin/np7
-rwxr-xr-xhome/.local/bin/versions9
-rw-r--r--home/.profile21
-rw-r--r--home/.shrc49
-rw-r--r--home/.ssh/config18
22 files changed, 354 insertions, 0 deletions
diff --git a/home/.config/git/config b/home/.config/git/config
new file mode 100644
index 00000000..36b96776
--- /dev/null
+++ b/home/.config/git/config
@@ -0,0 +1,21 @@
+[user]
+	name = June McEnroe
+	email = june@causal.agency
+
+[commit]
+	verbose = true
+
+[merge]
+	conflictStyle = diff3
+
+[pull]
+	rebase = true
+
+[rebase]
+	autosquash = true
+
+[pretty]
+	log = %Cred%h %Creset%s%C(yellow)%d %Cgreen(%ar) %Cblue<%aN>
+
+[include]
+	path = ./private
diff --git a/home/.config/git/ignore b/home/.config/git/ignore
new file mode 100644
index 00000000..fea54519
--- /dev/null
+++ b/home/.config/git/ignore
@@ -0,0 +1,2 @@
+*.DS_store
+*.dSYM/
diff --git a/home/.config/htop/htoprc b/home/.config/htop/htoprc
new file mode 100644
index 00000000..cdda268d
--- /dev/null
+++ b/home/.config/htop/htoprc
@@ -0,0 +1,29 @@
+# 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 39 2 46 49 1
+sort_key=47
+sort_direction=1
+hide_threads=0
+hide_kernel_threads=1
+hide_userland_threads=1
+shadow_other_users=0
+show_thread_names=0
+show_program_path=1
+highlight_base_name=1
+highlight_megabytes=1
+highlight_threads=1
+tree_view=1
+header_margin=0
+detailed_cpu_time=0
+cpu_count_from_zero=0
+show_cpu_usage=1
+show_cpu_frequency=0
+update_process_names=0
+account_guest_in_cpu_meter=0
+color_scheme=0
+enable_mouse=0
+delay=15
+left_meters=AllCPUs2
+left_meter_modes=1
+right_meters=Memory Swap
+right_meter_modes=1 1
diff --git a/home/.config/nvim/colors/trivial.vim b/home/.config/nvim/colors/trivial.vim
new file mode 100644
index 00000000..3ebe8d97
--- /dev/null
+++ b/home/.config/nvim/colors/trivial.vim
@@ -0,0 +1,65 @@
+hi clear
+syntax reset
+let colors_name = 'trivial'
+
+hi Normal ctermbg=NONE ctermfg=NONE
+
+hi ColorColumn ctermbg=0
+hi EndOfBuffer ctermfg=8
+hi VertSplit cterm=NONE ctermbg=NONE ctermfg=8
+hi LineNr ctermfg=8
+hi MatchParen ctermbg=NONE ctermfg=3
+hi ModeMsg ctermfg=8
+hi MoreMsg ctermfg=2
+hi! link Question MoreMsg
+hi WarningMsg ctermfg=1
+hi NonText ctermfg=8
+hi Search ctermbg=NONE ctermfg=11
+hi StatusLine cterm=NONE ctermbg=0 ctermfg=7
+hi StatusLineNC cterm=NONE ctermbg=0 ctermfg=8
+hi Folded ctermbg=0 ctermfg=8
+hi Visual cterm=inverse ctermbg=NONE
+hi Title ctermfg=5
+hi Directory ctermfg=4
+
+hi Comment ctermfg=4
+
+hi! link Constant Normal
+hi String ctermfg=6
+hi link Character String
+
+hi! link Identifier Normal
+
+hi Statement ctermfg=7
+hi link Operator Normal
+
+hi PreProc ctermfg=2
+
+hi! link Type Normal
+hi link StorageClass Statement
+hi link Structure StorageClass
+hi link Typedef Structure
+
+hi! link Special Normal
+hi SpecialComment ctermfg=12
+hi SpecialKey ctermfg=5
+
+hi Underlined ctermfg=NONE
+hi Error ctermbg=NONE ctermfg=9
+hi SpellBad ctermbg=NONE ctermfg=1
+hi! link Todo SpecialComment
+
+hi cFormat ctermfg=14
+
+hi diffAdded ctermfg=10
+hi diffRemoved ctermfg=9
+
+hi manUnderline cterm=italic
+
+hi link pythonInclude Statement
+
+hi link rubyDefine Structure
+hi link rubyStringDelimiter String
+hi link rubySymbol String
+
+hi link rustModPath Identifier
diff --git a/home/.config/nvim/ftdetect/mdoc.vim b/home/.config/nvim/ftdetect/mdoc.vim
new file mode 100644
index 00000000..b845fee6
--- /dev/null
+++ b/home/.config/nvim/ftdetect/mdoc.vim
@@ -0,0 +1 @@
+autocmd BufRead,BufNewFile *.[1-9] set filetype=mdoc
diff --git a/home/.config/nvim/init.vim b/home/.config/nvim/init.vim
new file mode 100644
index 00000000..9245ccf4
--- /dev/null
+++ b/home/.config/nvim/init.vim
@@ -0,0 +1,37 @@
+set hidden
+set undofile
+set shortmess=atI
+set wildmode=list:longest wildignore=*.o
+set splitbelow splitright
+command! W w
+command! Q q
+
+set tabstop=4 shiftwidth=4 shiftround
+set smartindent cinoptions=l1(sU1m1
+set ignorecase smartcase inccommand=nosplit
+nmap <leader><leader> :nohlsearch<CR>
+set foldmethod=syntax foldlevel=99 foldopen-=block
+let asmsyntax = "nasm"
+let c_syntax_for_h = 1
+let is_posix = 1
+let man_hardwrap = 1
+
+set title laststatus=1
+set scrolloff=1
+set noruler colorcolumn=80
+set list listchars=tab:\ \ ,trail:·
+colorscheme trivial
+
+autocmd TermOpen * setlocal statusline=%{b:term_title}
+autocmd BufEnter term://* startinsert
+tmap <C-w> <C-\><C-n><C-w>
+
+let g:clipboard = {'copy':{'+':'pbcopy'},'paste':{'+':'pbpaste'}}
+nmap gp `[v`]
+
+nmap <leader>s vip:sort<CR>
+nmap <leader>S $vi{:sort<CR>
+nmap <leader>a m':0/^#include <<CR>:nohlsearch<CR>O#include <
+nmap <leader>l :0read ~/src/etc/agpl.c<CR>''
+nmap <leader>L :0read ~/src/etc/gpl.c<CR>''
+nmap <leader>d :0delete<CR>:0read !date +'.Dd \%B \%e, \%Y'<CR>
diff --git a/home/.config/nvim/syntax/mdoc.vim b/home/.config/nvim/syntax/mdoc.vim
new file mode 100644
index 00000000..d9d587f5
--- /dev/null
+++ b/home/.config/nvim/syntax/mdoc.vim
@@ -0,0 +1,12 @@
+if exists("b:current_syntax")
+	finish
+endif
+
+runtime! syntax/nroff.vim
+unlet! b:current_syntax
+
+setlocal sections+=ShSs
+syntax match mdocBlank /^\.$/ conceal
+setlocal conceallevel=2
+
+let b:current_syntax = "mdoc"
diff --git a/home/.editrc b/home/.editrc
new file mode 100644
index 00000000..cf779a7d
--- /dev/null
+++ b/home/.editrc
@@ -0,0 +1 @@
+bind -v
diff --git a/home/.gdbinit b/home/.gdbinit
new file mode 100644
index 00000000..9422460c
--- /dev/null
+++ b/home/.gdbinit
@@ -0,0 +1 @@
+set disassembly-flavor intel
diff --git a/home/.hushlogin b/home/.hushlogin
new file mode 100644
index 00000000..e69de29b
--- /dev/null
+++ b/home/.hushlogin
diff --git a/home/.inputrc b/home/.inputrc
new file mode 100644
index 00000000..b2cc9d61
--- /dev/null
+++ b/home/.inputrc
@@ -0,0 +1 @@
+set editing-mode vi
diff --git a/home/.lldbinit b/home/.lldbinit
new file mode 100644
index 00000000..73f3e676
--- /dev/null
+++ b/home/.lldbinit
@@ -0,0 +1 @@
+settings set target.x86-disassembly-flavor intel
diff --git a/home/.local/bin/aes b/home/.local/bin/aes
new file mode 100755
index 00000000..32b52637
--- /dev/null
+++ b/home/.local/bin/aes
@@ -0,0 +1,7 @@
+#!/bin/sh
+set -eu
+
+enwiden() {
+	exec tr ' -~' ' !-~'
+}
+[ $# -gt 0 ] && echo "$*" | enwiden || enwiden
diff --git a/home/.local/bin/def b/home/.local/bin/def
new file mode 100755
index 00000000..6a1681d3
--- /dev/null
+++ b/home/.local/bin/def
@@ -0,0 +1,47 @@
+#!/bin/sh
+set -eu
+
+macro=$1
+headers='
+assert.h
+complex.h
+ctype.h
+errno.h
+fenv.h
+float.h
+inttypes.h
+iso646.h
+limits.h
+locale.h
+math.h
+setjmp.h
+signal.h
+stdalign.h
+stdarg.h
+stdatomic.h
+stdbool.h
+stddef.h
+stdint.h
+stdio.h
+stdlib.h
+stdnoreturn.h
+string.h
+tgmath.h
+threads.h
+time.h
+uchar.h
+wchar.h
+wctype.h
+'
+
+for header in $headers; do
+	defined=$(
+		echo "$macro" \
+		| cc -E -x c -include "$header" - \
+		2> /dev/null \
+		| tail -n 1
+	)
+	[ $? -ne 0 -o "$defined" = "$macro" ] && continue
+	echo "#include <${header}>"
+	echo "$defined"
+done
diff --git a/home/.local/bin/git-password b/home/.local/bin/git-password
new file mode 100755
index 00000000..41351e38
--- /dev/null
+++ b/home/.local/bin/git-password
@@ -0,0 +1,7 @@
+#!/bin/sh
+set -eu
+
+url=$1
+echo "url=${url}" \
+	| git credential fill \
+	| sed -En 's/^password=(.*)/\1/p'
diff --git a/home/.local/bin/nasd b/home/.local/bin/nasd
new file mode 100755
index 00000000..d64b2c3a
--- /dev/null
+++ b/home/.local/bin/nasd
@@ -0,0 +1,9 @@
+#!/bin/sh
+set -eu
+
+dir=$(mktemp -d)
+echo 'bits 64' > "${dir}/input"
+cat >> "${dir}/input"
+nasm -o "${dir}/output" "${dir}/input" || true
+ndisasm -b 64 "${dir}/output" || true
+rm -r "$dir"
diff --git a/home/.local/bin/notify-send b/home/.local/bin/notify-send
new file mode 100755
index 00000000..5630440d
--- /dev/null
+++ b/home/.local/bin/notify-send
@@ -0,0 +1,9 @@
+#!/usr/bin/osascript
+
+on run argv
+	if count of argv is 2 then
+		display notification (item 2 of argv) with title (item 1 of argv)
+	else
+		display notification (item 1 of argv)
+	end if
+end run
diff --git a/home/.local/bin/np b/home/.local/bin/np
new file mode 100755
index 00000000..7d54574c
--- /dev/null
+++ b/home/.local/bin/np
@@ -0,0 +1,7 @@
+#!/usr/bin/osascript
+
+tell application "iTunes"
+	tell current track
+		get "/me is listening to " & artist & " — " & name
+	end tell
+end tell
diff --git a/home/.local/bin/versions b/home/.local/bin/versions
new file mode 100755
index 00000000..25e5ff72
--- /dev/null
+++ b/home/.local/bin/versions
@@ -0,0 +1,9 @@
+#!/bin/sh
+set -u
+
+for repo in ~/src/git/*; do
+	version=$(git -C "${repo}" describe --dirty 2>/dev/null)
+	if [ $? -eq 0 ]; then
+		echo "${repo##*/}-${version#v}"
+	fi
+done | sort -nr -t '-' -k 3 | column -t -s '-'
diff --git a/home/.profile b/home/.profile
new file mode 100644
index 00000000..c0c9ce66
--- /dev/null
+++ b/home/.profile
@@ -0,0 +1,21 @@
+_PATH=$PATH PATH=
+path() { [ -d "$1" ] && PATH="${PATH}${PATH:+:}${1}"; }
+for prefix in '' /usr/local /opt/local /usr ~/.local; do
+	path "${prefix}/sbin"
+	path "${prefix}/bin"
+done
+path /usr/games
+
+export PAGER=less
+export LESS=FRXx4
+export EDITOR=nvim
+export MANPAGER='nvim +Man!'
+export MANSECT=2:3:1:8:6:5:7:4:9
+export CLICOLOR=1
+export GPG_TTY=$(tty)
+export NETHACKOPTIONS='pickup_types:$!?+/=, color, DECgraphics'
+
+[ -e /usr/share/mk/sys.mk ] || export CFLAGS=-O
+[ -d /usr/home ] && cd
+
+export ENV=~/.shrc
diff --git a/home/.shrc b/home/.shrc
new file mode 100644
index 00000000..bf3e0dfe
--- /dev/null
+++ b/home/.shrc
@@ -0,0 +1,49 @@
+set -o noclobber -o nounset -o vi
+
+CDPATH=:~
+
+alias vim=$EDITOR
+alias ls='LC_COLLATE=C ls -p'
+alias ll='ls -hl'
+alias bc='bc -l'
+alias gs='git status --short --branch || ls' gd='git diff'
+alias gsh='git show' gl='git log --graph --pretty=log'
+alias gco='git checkout' gb='git branch' gm='git merge' gst='git stash'
+alias ga='git add' gmv='git mv' grm='git rm'
+alias gc='git commit' gca='gc --amend' gt='git tag'
+alias gp='git push' gu='git pull' gf='git fetch' gr='git rebase'
+alias rand='openssl rand -base64 33'
+alias private='eval "$(gpg -d ~/.private)"'
+type doas >/dev/null 2>&1 && alias sudo=doas
+
+cd() {
+	local path
+	if [ $# -eq 0 ]; then
+		command cd
+	elif [ "${1%%:*}" != "$1" ]; then
+		path=${1#*:}
+		[ -n "${path}" ] || path=${PWD#${HOME}/}
+		SSH_CD=$path ssh -o SendEnv=SSH_CD "${1%%:*}"
+	elif [ -e "$1" -a ! -d "$1" ]; then
+		command cd "${1%/*}" && $EDITOR "${1##*/}"
+	else
+		command cd "$@"
+	fi
+}
+if [ -n "${SSH_CD:-}" ]; then
+	cd "${SSH_CD}"
+	unset SSH_CD
+fi
+
+hostname=$(hostname -s)
+rprompt() {
+	local pwd
+	pwd=${PWD#${HOME}}
+	[ "${pwd}" != "${PWD}" ] && pwd="~${pwd}"
+	[ "${TERM%-*}" = 'xterm' ] \
+		&& printf '\33]0;%s\a' "${SSH_CLIENT:+${hostname}:}${pwd##*/}" >&2
+	printf '%s' "${SSH_CLIENT:+${hostname}:}${pwd}"
+}
+PS1='
+$ '
+RPS1='${?#0} $(rprompt)'
diff --git a/home/.ssh/config b/home/.ssh/config
new file mode 100644
index 00000000..3fc6a8db
--- /dev/null
+++ b/home/.ssh/config
@@ -0,0 +1,18 @@
+IgnoreUnknown Include
+Include config_private
+
+HashKnownHosts yes
+
+SendEnv LANG LC_*
+
+Host monday beastie puffy toaster tux progynova
+	HostName %h.local
+	ForwardAgent yes
+	RemoteForward 7062 127.0.0.1:7062
+
+Host june july
+	HostName %h.nyc3.do.causal.agency
+	Port 2222
+
+Host git.causal.agency temp.causal.agency
+	Port 2222