From d6845babbcc57f89fd6a17544ffa2060ff3a6141 Mon Sep 17 00:00:00 2001 From: Alex Karle Date: Sat, 26 Sep 2020 23:50:30 -0400 Subject: [PATCH] Put the dot back in dotfile I've been feeling for a while now that all these directories with one file are just confusing (i.e. mbsync/mbsyncrc ...) and so I've resolved to "put the dot back in dotfile" -- remove the nested subtrees, and mirror a real $HOME directory. Anything that I don't really want to be under $HOME, I'm tucking away in ~/etc, which feels appropriate (i.e. vc configs or perl setup, etc). This approach was inspired by this HN comment [0]. The beauty in this is that you can then use git to inspect the how $HOME looks as a worktree of this repository. The key thing here is that **it's not a full work tree!** there's no .git file in $HOME that links the two, so a rogue "git status" in $HOME won't trigger any output. All changes go through the "cfg" alias which diffs the repo (~/.cfg, bare) and the worktree ($HOME). On machines where I only want a fraction of the dotfiles (i.e. work), I can still do a full checkout and manually symlink. This was super easy to change with the exception of the submodules (hot dang were they tricky to move correctly) -- note to future self, the clone URL is in .git/config (not just .gitmodules)... Not much functional change, except for removing my zshrc, which I haven't used in ages anyways (oh my zsh on macOS? those were the early days for sure :) ). From a git perspective, there are no more .gitignores, being replaced with a single '*' entry. Despite it not being a true worktree I want to be able to `git add .` (force of habit) and not add my whole $HOME. I'll be curious to see how this simplifies/complicates working on multiple machines. I don't plan to maintain multiple branches, but that could change. [0]: https://news.ycombinator.com/item?id=11071754 --- .aliases | 46 ++++++++++++++++++++++++++++++++++++++++++++++ .bash_profile | 15 +++++++++++++++ .bashrc | 64 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ .config/git/config | 15 +++++++++++++++ .config/git/ignore | 16 ++++++++++++++++ .config/gtk-3.0/settings.ini | 2 ++ .config/mutt/README.md | 27 +++++++++++++++++++++++++++ .config/mutt/accounts/karleco.muttrc | 16 ++++++++++++++++ .config/mutt/mailcap | 11 +++++++++++ .config/mutt/muttrc | 99 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ .config/nvim/init.vim | 20 ++++++++++++++++++++ .console_theme | 25 +++++++++++++++++++++++++ .cwmrc | 32 ++++++++++++++++++++++++++++++++ .exrc | 13 +++++++++++++ .gdbinit | 4 ++++ .gitignore | 7 +------ .gitmodules | 30 +++++++++++++++--------------- .inputrc | 18 ++++++++++++++++++ .perldb | 3 +++ .profile | 5 +++++ .shrc | 29 +++++++++++++++++++++++++++++ .tmux.conf | 64 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ .vim/README.md | 28 ++++++++++++++++++++++++++++ .vim/autoload/vimrc.vim | 28 ++++++++++++++++++++++++++++ .vim/colors/vc.vim | 16 ++++++++++++++++ .vim/ftplugin/go.vim | 2 ++ .vim/ftplugin/help.vim | 32 ++++++++++++++++++++++++++++++++ .vim/ftplugin/html.vim | 3 +++ .vim/ftplugin/javascript.vim | 3 +++ .vim/ftplugin/man.vim | 3 +++ .vim/ftplugin/markdown.vim | 11 +++++++++++ .vim/ftplugin/pod.vim | 1 + .vim/ftplugin/python.vim | 10 ++++++++++ .vim/ftplugin/tex.vim | 14 ++++++++++++++ .vim/ftplugin/vader.vim | 3 +++ .vim/ftplugin/vim.vim | 21 +++++++++++++++++++++ .vim/gvimrc | 27 +++++++++++++++++++++++++++ .vim/improved.vim | 141 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ .vim/pack/mine/start/gruvbox | 1 + .vim/pack/plugins/start/gv.vim | 1 + .vim/pack/plugins/start/vim-commentary | 1 + .vim/pack/plugins/start/vim-dirvish | 1 + .vim/pack/plugins/start/vim-fugitive | 1 + .vim/pack/plugins/start/vim-gitgutter | 1 + .vim/pack/plugins/start/vim-surround | 1 + .vim/swp/.gitkeep | 0 .vim/syntax/python.vim | 3 +++ .vim/undo/.gitkeep | 0 .vim/vimrc | 28 ++++++++++++++++++++++++++++ .xinitrc | 26 ++++++++++++++++++++++++++ README.md | 20 +++++++++++++------- X11/xinitrc | 26 -------------------------- bash/bash_profile | 15 --------------- bash/bashrc | 64 ---------------------------------------------------------------- bash/console_theme | 25 ------------------------- bash/inputrc | 18 ------------------ cwm/cwmrc | 32 -------------------------------- deps/pash | 1 - etc/deps/pash | 1 + etc/mbsyncrc | 23 +++++++++++++++++++++++ etc/perl/README.md | 11 +++++++++++ etc/perl/cpanfile | 4 ++++ etc/vc/README.md | 15 +++++++++++++++ etc/vc/personal.map | 4 ++++ etc/vc/vconsole.conf | 3 +++ etc/vi_prompt_append.zsh | 37 +++++++++++++++++++++++++++++++++++++ gdb/gdbinit | 4 ---- git/config | 15 --------------- git/ignore | 16 ---------------- gtk/gtk-3.0/settings.ini | 2 -- install.sh | 57 --------------------------------------------------------- mbsync/mbsyncrc | 23 ----------------------- mutt/.gitignore | 9 --------- mutt/README.md | 27 --------------------------- mutt/accounts/karleco.muttrc | 16 ---------------- mutt/mailcap | 11 ----------- mutt/muttrc | 99 --------------------------------------------------------------------------------------------------- nvim/init.vim | 20 -------------------- perl/README.md | 18 ------------------ perl/cpanfile | 4 ---- perl/perldb | 3 --- sh/aliases | 43 ------------------------------------------- sh/profile | 5 ----- sh/shrc | 29 ----------------------------- tmux/tmux.conf | 64 ---------------------------------------------------------------- vc/README.md | 15 --------------- vc/personal.map | 4 ---- vc/vconsole.conf | 3 --- vi/exrc | 13 ------------- vim/.gitignore | 17 ----------------- vim/README.md | 28 ---------------------------- vim/autoload/vimrc.vim | 28 ---------------------------- vim/colors/vc.vim | 16 ---------------- vim/ftplugin/go.vim | 2 -- vim/ftplugin/help.vim | 32 -------------------------------- vim/ftplugin/html.vim | 3 --- vim/ftplugin/javascript.vim | 3 --- vim/ftplugin/man.vim | 3 --- vim/ftplugin/markdown.vim | 11 ----------- vim/ftplugin/pod.vim | 1 - vim/ftplugin/python.vim | 10 ---------- vim/ftplugin/tex.vim | 14 -------------- vim/ftplugin/vader.vim | 3 --- vim/ftplugin/vim.vim | 21 --------------------- vim/gvimrc | 27 --------------------------- vim/improved.vim | 141 --------------------------------------------------------------------------------------------------------------------------------------------- vim/pack/mine/start/gruvbox | 1 - vim/pack/plugins/start/gv.vim | 1 - vim/pack/plugins/start/vim-commentary | 1 - vim/pack/plugins/start/vim-dirvish | 1 - vim/pack/plugins/start/vim-fugitive | 1 - vim/pack/plugins/start/vim-gitgutter | 1 - vim/pack/plugins/start/vim-surround | 1 - vim/swp/.gitkeep | 0 vim/syntax/python.vim | 3 --- vim/undo/.gitkeep | 0 vim/vimrc | 28 ---------------------------- zsh/vi_prompt_append.zsh | 37 ------------------------------------- zsh/zshrc | 66 ------------------------------------------------------------------ 119 files changed, 1058 insertions(+), 1210 deletions(-) create mode 100644 .aliases create mode 100644 .bash_profile create mode 100644 .bashrc create mode 100644 .config/git/config create mode 100644 .config/git/ignore create mode 100644 .config/gtk-3.0/settings.ini create mode 100644 .config/mutt/README.md create mode 100644 .config/mutt/accounts/karleco.muttrc create mode 100644 .config/mutt/mailcap create mode 100644 .config/mutt/muttrc create mode 100644 .config/nvim/init.vim create mode 100644 .console_theme create mode 100644 .cwmrc create mode 100644 .exrc create mode 100644 .gdbinit create mode 100644 .inputrc create mode 100644 .perldb create mode 100644 .profile create mode 100755 .shrc create mode 100644 .tmux.conf create mode 100644 .vim/README.md create mode 100644 .vim/autoload/vimrc.vim create mode 100644 .vim/colors/vc.vim create mode 100644 .vim/ftplugin/go.vim create mode 100644 .vim/ftplugin/help.vim create mode 100644 .vim/ftplugin/html.vim create mode 100644 .vim/ftplugin/javascript.vim create mode 100644 .vim/ftplugin/man.vim create mode 100644 .vim/ftplugin/markdown.vim create mode 100644 .vim/ftplugin/pod.vim create mode 100644 .vim/ftplugin/python.vim create mode 100644 .vim/ftplugin/tex.vim create mode 100644 .vim/ftplugin/vader.vim create mode 100644 .vim/ftplugin/vim.vim create mode 100644 .vim/gvimrc create mode 100644 .vim/improved.vim create mode 160000 .vim/pack/mine/start/gruvbox create mode 160000 .vim/pack/plugins/start/gv.vim create mode 160000 .vim/pack/plugins/start/vim-commentary create mode 160000 .vim/pack/plugins/start/vim-dirvish create mode 160000 .vim/pack/plugins/start/vim-fugitive create mode 160000 .vim/pack/plugins/start/vim-gitgutter create mode 160000 .vim/pack/plugins/start/vim-surround create mode 100644 .vim/swp/.gitkeep create mode 100644 .vim/syntax/python.vim create mode 100644 .vim/undo/.gitkeep create mode 100644 .vim/vimrc create mode 100644 .xinitrc delete mode 100644 X11/xinitrc delete mode 100644 bash/bash_profile delete mode 100644 bash/bashrc delete mode 100644 bash/console_theme delete mode 100644 bash/inputrc delete mode 100644 cwm/cwmrc delete mode 160000 deps/pash create mode 160000 etc/deps/pash create mode 100644 etc/mbsyncrc create mode 100644 etc/perl/README.md create mode 100644 etc/perl/cpanfile create mode 100644 etc/vc/README.md create mode 100644 etc/vc/personal.map create mode 100644 etc/vc/vconsole.conf create mode 100644 etc/vi_prompt_append.zsh delete mode 100644 gdb/gdbinit delete mode 100644 git/config delete mode 100644 git/ignore delete mode 100644 gtk/gtk-3.0/settings.ini delete mode 100755 install.sh delete mode 100644 mbsync/mbsyncrc delete mode 100644 mutt/.gitignore delete mode 100644 mutt/README.md delete mode 100644 mutt/accounts/karleco.muttrc delete mode 100644 mutt/mailcap delete mode 100644 mutt/muttrc delete mode 100644 nvim/init.vim delete mode 100644 perl/README.md delete mode 100644 perl/cpanfile delete mode 100644 perl/perldb delete mode 100644 sh/aliases delete mode 100644 sh/profile delete mode 100755 sh/shrc delete mode 100644 tmux/tmux.conf delete mode 100644 vc/README.md delete mode 100644 vc/personal.map delete mode 100644 vc/vconsole.conf delete mode 100644 vi/exrc delete mode 100644 vim/.gitignore delete mode 100644 vim/README.md delete mode 100644 vim/autoload/vimrc.vim delete mode 100644 vim/colors/vc.vim delete mode 100644 vim/ftplugin/go.vim delete mode 100644 vim/ftplugin/help.vim delete mode 100644 vim/ftplugin/html.vim delete mode 100644 vim/ftplugin/javascript.vim delete mode 100644 vim/ftplugin/man.vim delete mode 100644 vim/ftplugin/markdown.vim delete mode 100644 vim/ftplugin/pod.vim delete mode 100644 vim/ftplugin/python.vim delete mode 100644 vim/ftplugin/tex.vim delete mode 100644 vim/ftplugin/vader.vim delete mode 100644 vim/ftplugin/vim.vim delete mode 100644 vim/gvimrc delete mode 100644 vim/improved.vim delete mode 160000 vim/pack/mine/start/gruvbox delete mode 160000 vim/pack/plugins/start/gv.vim delete mode 160000 vim/pack/plugins/start/vim-commentary delete mode 160000 vim/pack/plugins/start/vim-dirvish delete mode 160000 vim/pack/plugins/start/vim-fugitive delete mode 160000 vim/pack/plugins/start/vim-gitgutter delete mode 160000 vim/pack/plugins/start/vim-surround delete mode 100644 vim/swp/.gitkeep delete mode 100644 vim/syntax/python.vim delete mode 100644 vim/undo/.gitkeep delete mode 100644 vim/vimrc delete mode 100644 zsh/vi_prompt_append.zsh delete mode 100644 zsh/zshrc diff --git a/.aliases b/.aliases new file mode 100644 index 0000000..5eed14b --- /dev/null +++ b/.aliases @@ -0,0 +1,46 @@ +#!/bin/sh +# Aliases for all shells + +# Detect which `ls` flavor is in use +if ls --color > /dev/null 2>&1; then # GNU `ls` + colorflag="--color" +elif ls -G > /dev/null 2>&1; then # macOS `ls` + colorflag="-G" +fi + +# ls aliases +alias ls='ls ${colorflag}' +alias l='ls -lAh ${colorflag}' +alias ll='ls -lh ${colorflag}' + +# Git aliases +alias ga='git add' +alias gc='git commit --verbose' +alias gd='git diff' +alias gp='git push' +alias gs='git status' +alias gst='git status' +alias gl='git pull' +alias gco='git checkout' +alias gf='git fetch' +alias glg='git log --stat --decorate' +alias glgr='git log --oneline | head -n 10' +alias g_='git stash' +alias g_p='git stash pop' +alias gb='git branch' +alias grb='git rebase' +alias grs='git reset' +alias gm='git merge' +alias gg='git grep' +alias vlg='vim -c "GV"' # 'vim log' of a file + +# Quick Actions +alias curljson='curl -H "Content-Type: application/json"' +alias sysmail='mutt -f /var/mail/$USER' + +# Dotfile management +alias cfg='git --git-dir=$HOME/.cfg --work-tree=$HOME' + +# Lightweight funcs +aw() { w3m "https://wiki.archlinux.org/index.php?search=$1"; } +ddg() { w3m "https://duckduckgo.com/lite?q=$1"; } diff --git a/.bash_profile b/.bash_profile new file mode 100644 index 0000000..22c9a07 --- /dev/null +++ b/.bash_profile @@ -0,0 +1,15 @@ +#!/usr/bin/env bash +# sourced by login shells (not interactive shells) +# Example: +# - ssh to Linux --> run bash_profile on login +# - open new tmux window --> run bashrc +# +# Exception: +# ** On OSX bash_profile is run by terminal emulators (new tabs, etc) ** +# +# Takeaway: +# ** Write preferences in bashrc, source it from bash_profile ** + +if [ -r ~/.bashrc ]; then + source ~/.bashrc +fi diff --git a/.bashrc b/.bashrc new file mode 100644 index 0000000..3a61869 --- /dev/null +++ b/.bashrc @@ -0,0 +1,64 @@ +#!/usr/bin/env bash +# .bashrc +# The way I like to roll in the shell + +# If not running interactively, don't do anything +[[ $- != *i* ]] && return + +# Settings +stty -ixon # Disable XON/XOFF to allow forward search w CTRL-S +shopt -s checkwinsize # check win size after each cmd, update if needed +shopt -s histappend # append to the history file, don't overwrite it +HISTSIZE=10000 # Max lines in history (in memory) +HISTFILESIZE=200000 # Max size of the history file +HISTIGNORE=fg:pwd:ls # Don't store common commands in history +HISTCONTROL=ignoreboth # Don't store duped / whitespace-led commands in history +PROMPT_COMMAND="history -a" # Record history after each command + +# Includes +include() { [ -r "$1" ] && source "$1"; } +include "$HOME/.shrc" # Common shell configuration +include "$HOME/.bash/git-completion.bash" # Git Completion +include "$HOME/.console_theme" # Virtual Console colors (if TERM == "linux") +include "$HOME/.bashrc.local" # System specific settings + +if [ -n "$USE_FANCY_PROMPT" ]; then + parse_git_dirty() { + if [ -z "$BASH_PROMPT_NO_GSTATUS" ]; then + [ "$(git status --porcelain=v1 2> /dev/null)" ] && echo "*" + fi + } + + git_info() { + git branch --no-color 2> /dev/null | + sed -e '/^[^*]/d' -e "s/* \(.*\)/\1$(parse_git_dirty)/" + } + + # Preferred Prompt: fancy with colors from tput + if tput setaf 1 &> /dev/null; then + tput sgr0 # reset effects of test command + RED="\[$(tput setaf 1)\]" + MAGENTA="\[$(tput setaf 5)\]" + YELLOW="\[$(tput setaf 3)\]" + GRAY="\[$(tput setaf 8)\]" + BLUE="\[$(tput setaf 4)\]" + BOLD="\[$(tput bold)\]" + RESET="\[$(tput sgr0)\]" + + PS1_TOP="$BOLD$RED\$(last_err)$BLUE\w $RESET$GRAY$SSH_PROMPT\$(git_info)" + PS1="$PS1_TOP\n$BOLD$MAGENTA\$ $RESET" + PS2="$YELLOW> $RESET" + fi +fi + +# Git completion for ~/.aliases +if [ -n "$(type -t __git_complete)" ] && + [ "$(type -t __git_complete)" == "function" ]; then + __git_complete ga _git_add + __git_complete gco _git_checkout + __git_complete gd _git_diff + __git_complete gr _git_rebase + __git_complete gb _git_branch +fi + +alias rb='source ~/.bashrc' diff --git a/.config/git/config b/.config/git/config new file mode 100644 index 0000000..65e48e9 --- /dev/null +++ b/.config/git/config @@ -0,0 +1,15 @@ +[core] + editor = $EDITOR + +[user] + email = alex@alexkarle.com + name = Alex Karle + +[sendemail] + smtpserver = smtp.fastmail.com + smtpuser = alex@alexkarle.com + smtpencryption = tls + smtpserverport = 587 + annotate = yes +[pull] + ff = only diff --git a/.config/git/ignore b/.config/git/ignore new file mode 100644 index 0000000..71cfce6 --- /dev/null +++ b/.config/git/ignore @@ -0,0 +1,16 @@ +# My Global .gitignore +# Set with: +# git config --global core.excludesfile 'path/to/.gitignore' +# +# For the junk that I create that nobody else needs or wants + +# ctags files +tags +TAGS + +# Backup files +*.swp +*~ + +# OS Junk +.DS_Store diff --git a/.config/gtk-3.0/settings.ini b/.config/gtk-3.0/settings.ini new file mode 100644 index 0000000..6bcbff5 --- /dev/null +++ b/.config/gtk-3.0/settings.ini @@ -0,0 +1,2 @@ +[Settings] +gtk-key-theme-name=Default diff --git a/.config/mutt/README.md b/.config/mutt/README.md new file mode 100644 index 0000000..79b3433 --- /dev/null +++ b/.config/mutt/README.md @@ -0,0 +1,27 @@ +# mutt + +Trying `mutt` in pursuit of an email client that sucks less. + +## Installation + +This folder should be symlinked to the `$XDG_CONFIG_HOME`. But other than that +it is necessary to generate an encrypted password file. + +Given that I am using FastMail, they insist on having a one-client one-time +password for each mail client that isn't theirs. So, in this order: + +1. Go to FastMail's web client +2. Under Settings create a password +3. Create a GPG key if you don't already have one: + +``` +gpg --gen-key +``` + +4. Use that key's public key to encrypt the password (and putt it in a file): + +``` +echo -n "PASSWORD" | gpg --encrypt -r EMAIL > accounts/karleco.gpg +``` + +Now, everything should work! diff --git a/.config/mutt/accounts/karleco.muttrc b/.config/mutt/accounts/karleco.muttrc new file mode 100644 index 0000000..eb9f27f --- /dev/null +++ b/.config/mutt/accounts/karleco.muttrc @@ -0,0 +1,16 @@ +# Account setup for my personal email +# Checked into git as a template for other accounts + +set from="alex@alexkarle.com" +set realname="Alex Karle" + +# Use a local copy of my mail (for speed and offline-access) +set mbox_type="Maildir" +set folder="~/mail/karleco/" +set spoolfile="=INBOX" +set record="=Sent" +set postponed="=Drafts" + +# Uncomment if sendmail not configured on machine +# set smtp_pass=`pash show mail/karleco` +# set smtp_url="smtps://$from:$smtp_pass@smtp.fastmail.com:465" diff --git a/.config/mutt/mailcap b/.config/mutt/mailcap new file mode 100644 index 0000000..cab96f6 --- /dev/null +++ b/.config/mutt/mailcap @@ -0,0 +1,11 @@ +# Defaults (for GUI/X) +text/plain; $EDITOR '%s'; +application/octet-stream; $EDITOR '%s'; +text/html; firefox '%s' & sleep 1; test=test -n "$DISPLAY"; needsterminal; +text/html; w3m -I %{charset} -T text/html; copiousoutput; +image/*; feh '%s' ; test=test -n "$DISPLAY"; needsterminal; +application/pdf; xdg-open '%s' &; test=test -n "$DISPLAY"; needsterminal; + +# Backups for Virtual Console (needs fbida package) +image/*; fbi -a '%s'; +application/pdf; fbgs '%s'; diff --git a/.config/mutt/muttrc b/.config/mutt/muttrc new file mode 100644 index 0000000..321193e --- /dev/null +++ b/.config/mutt/muttrc @@ -0,0 +1,99 @@ +# muttrc +# In pursuit of an email client that sucks less + +################################################################################ +# General / Behavior +source ~/.config/mutt/muttrc.local + +set ssl_force_tls = yes # Require encrypted connection + +# Attachments +set mailcap_path=~/.config/mutt/mailcap +auto_view text/html # tell mutt to load HTML via mailcap +alternative_order text/plain text/enriched text/html # prefer plaintext + +# Fetching Mail +set mail_check=90 # From the manual, over IMAP, 90 reasonable value +set timeout=15 # mutt blocks mail check if no user input + +# Caching (speeds up IMAP considerably to not redownload every time) +set header_cache="~/.config/mutt/cache" +set message_cachedir="~/.config/mutt/cache" + +# BCC self to show up in INBOX +my_hdr BCC: $from + +# Use the `abook` program for contact management/completions +set query_command="abook --mutt-query '%s'" + +# Enables shelling out in macros without a pause +set wait_key=no + +################################################################################ +# Appearance / Layout +set sort=threads +set sort_aux=reverse-last-date-received + +# Show some index in the pager +set pager_index_lines=6 + +# Restrict quotes to |, :, and > (default has } and # which match code) +set quote_regexp="^([ \t]*[|>:])+" +color index yellow black ~U +color quoted green black +color quoted1 blue black +color quoted2 magenta black +color quoted3 yellow black +color quoted4 red black + +# Patch highting +color body green black "^\\+.*" +color body red black "^-.*" +color body magenta black "^\\+\\+\\+ b/.*" +color body magenta black "^--- a/.*" +color body magenta black "^@@.*@@" +color body magenta black "^@@.*@@" +color body magenta black "^diff --git.*" +color body magenta black "^index [0-9a-z]{7}\\.\\.[0-9a-z]{7}.*" + +################################################################################ +# Bindings +# I've chosen to customize-as-I-go on these. Some general guiding rules: +# 1. Vi-like +# - Obvious reasons +# 2. Non-destructive +# - Especially as a newby, its **the worst** to have CTRL-D +# which I spam in Vim for half-down to delete 5-10 messages +# in the pager before I've realized what I've done. + +# Navigation +bind pager j next-line +bind pager k previous-line +bind index G last-entry +bind pager G bottom +bind index,pager g noop # good practice, as gg prevents g from binding +bind index gg first-entry +bind pager gg top +bind index,pager \CD half-down +bind index,pager \CU half-up +bind index,pager d half-down +bind index,pager u half-up +bind index,pager previous-unread +bind index,pager next-unread +bind index,pager next-unread + +# Functional +bind index,pager h help +bind index,pager ? search-reverse +bind index N search-opposite +bind index,pager R group-reply +bind index \CN toggle-new +bind attach view-mailcap +bind editor complete-query # Used for contact-completion + +# Macros +macro index,pager ga "abook --add-email-quiet" "Add sender to abook contacts" +macro index g$ "mbsync -a" "Sync with mbsync" + +# set send_multipart_alternative=ask-no +# set send_multipart_alternative_filter=markdown2html diff --git a/.config/nvim/init.vim b/.config/nvim/init.vim new file mode 100644 index 0000000..523ddc9 --- /dev/null +++ b/.config/nvim/init.vim @@ -0,0 +1,20 @@ +" init.vim -- the config for neovim +" +" Used for specific neovim customization! + +" First, just source the regular Vim stuff +set runtimepath+=~/.vim,~/.vim/after +set packpath+=~/.vim + +if filereadable(expand("~/.vimrc")) + " On some machines, I prefer to use a ~/.vimrc + source ~/.vimrc +else + source ~/.vim/vimrc +endif + +" no numbers in terminal +autocmd TermOpen * setlocal nonumber + +" incrementally show substitutions! +set inccommand=nosplit diff --git a/.console_theme b/.console_theme new file mode 100644 index 0000000..2b1a3f2 --- /dev/null +++ b/.console_theme @@ -0,0 +1,25 @@ +#!/usr/bin/env bash +# bash/console_theme +# A small script to set the Virtual Console to use Gruvbox colors. +# Colors originally from https://github.com/morhetz/gruvbox by Pavel Pertsev +# For more on escape sequences see console_codes(4) +if [[ "$TERM" =~ "linux" ]]; then + # Gruvbox 16 colors + printf "\033]P0282828" # 0: Black + printf "\033]P1cc241d" # 1: Red + printf "\033]P298971a" # 2: Green + printf "\033]P3d79921" # 3: Yellow + printf "\033]P4458588" # 4: Blue + printf "\033]P5b16286" # 5: Magenta + printf "\033]P6689d6a" # 6: Cyan + printf "\033]P7a89984" # 7: White + printf "\033]P8928374" # 8: Bright Black + printf "\033]P9fb4934" # 9: Bright Red + printf "\033]Pab8bb26" # 10: Bright Green + printf "\033]Pbfabd2f" # 11: Bright Yellow + printf "\033]Pc83a598" # 12: Bright Blue + printf "\033]Pdd3869b" # 13: Bright Magenta + printf "\033]Pe8ec07c" # 14: Bright Cyan + printf "\033]Pfebdbb2" # 15: Bright White + clear # Redraw the screen... +fi diff --git a/.cwmrc b/.cwmrc new file mode 100644 index 0000000..fe43693 --- /dev/null +++ b/.cwmrc @@ -0,0 +1,32 @@ +# Commands (for menu-cmd) +command firefox firefox +command term /usr/local/bin/st +command lock /usr/local/bin/slock +command top "/usr/local/bin/st -e top" +command htop "/usr/local/bin/st -e htop" +command mutt "/usr/local/bin/st -e mutt" + +# Global keys +bind-key 4S-e quit +bind-key 4S-r restart + +# App spawns +bind-key 4S-Return terminal +bind-key 4-w firefox +bind-key 4-p menu-cmd +bind-key 4S-p menu-exec +bind-key 4S-w menu-window +bind-key 4S-g menu-group +bind-key 4-semicolon lock + +# Window manipulation +bind-key 4-Return window-fullscreen +bind-key 4-j window-cycle +bind-key 4-k window-rcycle +bind-key 4S-j group-cycle +bind-key 4S-k group-rcycle +bind-key 4S-q window-close + +# Mouse it +bind-mouse 4-1 window-move +bind-mouse 4-3 window-resize diff --git a/.exrc b/.exrc new file mode 100644 index 0000000..363212b --- /dev/null +++ b/.exrc @@ -0,0 +1,13 @@ +" .exrc -- For OpenBSD's nvi +" Mostly used for quick edits or prose (emails, commit messages, etc) +" So default to 72 hard wrapping and spaces over tabs +set ruler +set autoindent +set searchincr +set showmode +set expandtab +set shiftwidth=4 +set tabstop=4 +set wraplen=72 + +map gg 1G diff --git a/.gdbinit b/.gdbinit new file mode 100644 index 0000000..139c791 --- /dev/null +++ b/.gdbinit @@ -0,0 +1,4 @@ +# Save history, but do it globally +set history save on +set history size 10000 +set history filename ~/.gdb_history diff --git a/.gitignore b/.gitignore index e7babb8..72e8ffc 100644 --- a/.gitignore +++ b/.gitignore @@ -1,6 +1 @@ -# netrw places these files in nvim/ -.netrwhist - -# Compiled python files -*.pyc -__pycache__ +* diff --git a/.gitmodules b/.gitmodules index e7ff959..375fe39 100644 --- a/.gitmodules +++ b/.gitmodules @@ -1,24 +1,24 @@ -[submodule "vim/pack/mine/start/gruvbox"] - path = vim/pack/mine/start/gruvbox +[submodule ".vim/pack/mine/start/gruvbox"] + path = .vim/pack/mine/start/gruvbox url = https://github.com/akarle/gruvbox -[submodule "vim/pack/plugins/start/vim-fugitive"] - path = vim/pack/plugins/start/vim-fugitive +[submodule ".vim/pack/plugins/start/vim-fugitive"] + path = .vim/pack/plugins/start/vim-fugitive url = https://github.com/tpope/vim-fugitive -[submodule "vim/pack/plugins/start/gv.vim"] - path = vim/pack/plugins/start/gv.vim +[submodule ".vim/pack/plugins/start/gv.vim"] + path = .vim/pack/plugins/start/gv.vim url = https://github.com/junegunn/gv.vim -[submodule "vim/pack/plugins/start/vim-dirvish"] - path = vim/pack/plugins/start/vim-dirvish +[submodule ".vim/pack/plugins/start/vim-dirvish"] + path = .vim/pack/plugins/start/vim-dirvish url = https://github.com/justinmk/vim-dirvish -[submodule "vim/pack/plugins/start/vim-surround"] - path = vim/pack/plugins/start/vim-surround +[submodule ".vim/pack/plugins/start/vim-surround"] + path = .vim/pack/plugins/start/vim-surround url = https://github.com/tpope/vim-surround -[submodule "vim/pack/plugins/start/vim-commentary"] - path = vim/pack/plugins/start/vim-commentary +[submodule ".vim/pack/plugins/start/vim-commentary"] + path = .vim/pack/plugins/start/vim-commentary url = https://github.com/tpope/vim-commentary -[submodule "vim/pack/plugins/start/vim-gitgutter"] - path = vim/pack/plugins/start/vim-gitgutter +[submodule ".vim/pack/plugins/start/vim-gitgutter"] + path = .vim/pack/plugins/start/vim-gitgutter url = https://github.com/airblade/vim-gitgutter [submodule "deps/pash"] - path = deps/pash + path = etc/deps/pash url = https://github.com/dylanaraps/pash diff --git a/.inputrc b/.inputrc new file mode 100644 index 0000000..ac4a6f0 --- /dev/null +++ b/.inputrc @@ -0,0 +1,18 @@ +# vi keys! Needs to be up top +set editing-mode vi +set show-mode-in-prompt on +set vi-cmd-mode-string ":" +set vi-ins-mode-string "" + +set keymap vi-command +Control-l: clear-screen + +set keymap vi-insert +Control-l: clear-screen +Control-x: yank-last-arg + +# Quicker changing of prompt after ESC +set keyseq-timeout 30 + +# Don't make noise, please! +set bell-style none diff --git a/.perldb b/.perldb new file mode 100644 index 0000000..13b54e1 --- /dev/null +++ b/.perldb @@ -0,0 +1,3 @@ +# Save all history to ~/.perldb.hist +&parse_options("HistFile=$ENV{HOME}/.perldb.hist"); +&parse_options("HistSize=10000"); diff --git a/.profile b/.profile new file mode 100644 index 0000000..8346c85 --- /dev/null +++ b/.profile @@ -0,0 +1,5 @@ +#!/bin/sh +# ~/.profile -- dash/sh/ksh profile +# Sourced for login shells -- set $ENV to ~/.shrc +# to use that as the config for this and all new interactive shells +export ENV="$HOME/.shrc" diff --git a/.shrc b/.shrc new file mode 100755 index 0000000..46a566e --- /dev/null +++ b/.shrc @@ -0,0 +1,29 @@ +#!/bin/sh +# ~/.shrc -- a config for all POSIX shells +[ -z "$PS1" ] && return # Exit early if non-interactive + +# Crucial exports +PATH=$HOME/bin:$PATH # Put ~/bin on the for personal scripts +EDITOR='vi' # $EDITOR, the most important (personal) of exports +VISUAL='vi' # Some programs give priority to this +PAGER='less' # less is more +PERL5LIB=$HOME/perl5/lib/perl5 # default cpanminus location +MANPATH=":$HOME/share/man" +export PATH EDITOR VISUAL PAGER PERL5LIB MANPATH + +# Shell vars +HISTFILE=${HISTFILE:="$HOME/.sh_histo"} # Don't override bash_history + +# Prompt +last_err() { + err="$?" + if [ $err -ne "0" ]; then + echo "($err) " + fi +} +PS1='$(last_err)\w \$ ' + +# Includes +include() { if [ -r "$1" ]; then . "$1"; fi } +include "$HOME/.aliases" +include "$HOME/.shrc.local" diff --git a/.tmux.conf b/.tmux.conf new file mode 100644 index 0000000..1e45a72 --- /dev/null +++ b/.tmux.conf @@ -0,0 +1,64 @@ +#----------# +# Settings # +#----------# +set -g prefix C-a # Who can reach C-b? +set -g mouse on # I guess mice are useful sometimes.. +set -g mode-keys vi # vi or di +set -g base-index 1 # Start windows at 1 +set -g pane-base-index 1 # Start panes at 1 +set -g renumber-windows on # Closed windows renumber +set -s escape-time 0 # ESC instantly passed through to process +set -g set-clipboard off # Use xclip over escape-code-clipboard #1119 + +# Set default term based on $TERM +set default-terminal screen # More support for "screen" than "tmux" +if "test $TERM = 'st-256color' -o $TERM = 'xterm-256color'" \ + 'set default-terminal screen-256color' + + +#----------# +# Bindings # +#----------# + +# remap prefix from 'C-b' to 'C-a' +unbind C-b +bind C-a send-prefix + +# split panes using | and - +unbind '"' +unbind % +bind | split-window -h -c "#{pane_current_path}" +bind - split-window -v -c "#{pane_current_path}" + +# new window same directory +bind c new-window -c "#{pane_current_path}" + +# reload config file +bind r source-file ~/.tmux.conf \; display 'reloaded' + +# switch panes using vim keys +bind C-h select-pane -L +bind C-j select-pane -D +bind C-k select-pane -U +bind C-l select-pane -R + +# set vi-bindings for scrolling +bind -T copy-mode-vi v send -X begin-selection +bind -T copy-mode-vi y send -X copy-pipe-and-cancel 'xclip -in -selection clipboard' + +# GoToHttp -- find the last url in the buffer +bind H copy-mode\; send -X search-backward "http" \; send -X begin-selection \; send -X next-space-end +bind -T copy-mode-vi H send -X start-of-line \; send -X search-again \; send -X begin-selection \; send -X next-space-end + +bind P copy-mode \; send -X search-backward "/" \; send -X begin-selection \; send -X next-space-end \; send -X other-end \; send -X previous-space +bind -T copy-mode-vi P send -X clear-selection \; send -X start-of-line \; send -X search-again \; send -X begin-selection \; send -X next-space-end \; send -X other-end \; send -X previous-space + +#-------# +# THEME # +#-------# + +# Status +set -g status-interval 60 +set -g status-left-length 20 +set -g status-right "[$USER@#h] #(slstatus -s)%D %H:%M" +set -g status-right-length 90 diff --git a/.vim/README.md b/.vim/README.md new file mode 100644 index 0000000..421fb49 --- /dev/null +++ b/.vim/README.md @@ -0,0 +1,28 @@ +# dotvim + +My personal Vim configuration. + +## Install + +Mac/Linux: + +```sh +git clone --recurse-submodules https://github.com/akarle/dotfiles ~/dotfiles +ln -s ~/dotfiles/vim ~/.vim +``` + +Windows: + +If you can't figure out how to get symlinks to work (or they don't work, I never +understood them on Windows), set up a minimal vimrc that uses ~/dotfiles/vim as +the ~/vimfiles: + +```sh +git clone --recurse-submodules https://github.com/akarle/dotfiles ~/dotfiles +cat < ~/_vimrc +set rtp ^= ~/dotfiles/vim +set rtp += ~/dotfiles/vim/after +set pp = &rtp +source ~/dotfiles/vim/vimrc +EOM +``` diff --git a/.vim/autoload/vimrc.vim b/.vim/autoload/vimrc.vim new file mode 100644 index 0000000..71e5b5c --- /dev/null +++ b/.vim/autoload/vimrc.vim @@ -0,0 +1,28 @@ +" autoload/vimrc.vim -- functions to be called in vimrc +" +" See `:h autoload-functions` for explanation of autoloading and performance +function! vimrc#ToggleColorColumn() abort + if &colorcolumn == "" + if &textwidth > 0 + exe "set colorcolumn=" . &textwidth + else + set colorcolumn=80 + endif + else + set colorcolumn="" + endif +endfunction + +" A function to execute a command and return to the old position +" CREDIT: http://vimcasts.org/episodes/tidying-whitespace/ +function! vimrc#CMDPreserve(command) abort + " Preparation: save last search, and cursor position. + let _s=@/ + let l = line(".") + let c = col(".") + " Do the business: + execute a:command + " Clean up: restore previous search history, and cursor position + let @/=_s + call cursor(l, c) +endfunction diff --git a/.vim/colors/vc.vim b/.vim/colors/vc.vim new file mode 100644 index 0000000..8a27fba --- /dev/null +++ b/.vim/colors/vc.vim @@ -0,0 +1,16 @@ +" colors/vc.vim +" +" An adaptation of the default colorscheme for the Linux Virtual Console +" (also just my preferred 'default' should there be no gruvbox installed) +" +" Preferred Setup: +" ================ +" - Vim 8.1 (NeoVim insists on setting &t_Co to 256 / dropped t_XX settings) +" - &t_Co == 8 +" - TERM=linux (default VC) or TERM=tmux/screen +" - Base 8-color pallete from gruvbox +" - bg=light +hi! StatusLine cterm=NONE ctermfg=0 ctermbg=7 +hi! StatusLineNC cterm=NONE ctermfg=0 ctermbg=7 +hi! Folded cterm=NONE ctermfg=3 ctermbg=0 +hi! LineNr cterm=NONE ctermfg=7 ctermbg=0 diff --git a/.vim/ftplugin/go.vim b/.vim/ftplugin/go.vim new file mode 100644 index 0000000..c23c27b --- /dev/null +++ b/.vim/ftplugin/go.vim @@ -0,0 +1,2 @@ +setlocal noexpandtab +setlocal sw=8 sts=8 diff --git a/.vim/ftplugin/help.vim b/.vim/ftplugin/help.vim new file mode 100644 index 0000000..1b11000 --- /dev/null +++ b/.vim/ftplugin/help.vim @@ -0,0 +1,32 @@ +" Some folding settings I like to use for writing Vim plugin documentation +" Won't work universally, but doesn't hurt to enable + +" Simple fold function to fold until the next ===== or ------ +function! DocTxtFoldExpr(lnum) abort + if getline(a:lnum + 1) =~ '^\(=\+\|-\+\)$' + return '<1' + else + return 1 + endif +endfunction + +" Fold Text that prints number lines folded, a preview of what header it is, +" and the section name. Attempted to align nicely, but it breaks with tabs +" - 6 lines: ===== INTRO ..... +" - 12 lines: ----- Example ..... +function! DocTxtFoldText() abort + let l = getline(v:foldstart) + let lp1 = getline(v:foldstart + 1) + let num_lines = v:foldend - v:foldstart + 1 + let lines_text = printf("%4s", num_lines) . ' lines:' + let header_preview = l[0:5] + let section_name = lp1[0:stridx(lp1, ' ')] + if section_name !~ ' $' + let section_name = section_name . ' ' + endif + return join([v:folddashes, lines_text, header_preview, section_name], ' ') +endfunction + +setlocal foldexpr=DocTxtFoldExpr(v:lnum) +setlocal foldtext=DocTxtFoldText() +setlocal foldmethod=expr diff --git a/.vim/ftplugin/html.vim b/.vim/ftplugin/html.vim new file mode 100644 index 0000000..12be0ea --- /dev/null +++ b/.vim/ftplugin/html.vim @@ -0,0 +1,3 @@ +" 2 spaces +setlocal softtabstop=2 +setlocal shiftwidth=2 diff --git a/.vim/ftplugin/javascript.vim b/.vim/ftplugin/javascript.vim new file mode 100644 index 0000000..bff51f2 --- /dev/null +++ b/.vim/ftplugin/javascript.vim @@ -0,0 +1,3 @@ +" 2 space +setlocal softtabstop=2 +setlocal shiftwidth=2 diff --git a/.vim/ftplugin/man.vim b/.vim/ftplugin/man.vim new file mode 100644 index 0000000..216d024 --- /dev/null +++ b/.vim/ftplugin/man.vim @@ -0,0 +1,3 @@ +" break lines at word boundaries +setlocal wrap +setlocal linebreak diff --git a/.vim/ftplugin/markdown.vim b/.vim/ftplugin/markdown.vim new file mode 100644 index 0000000..a210b8b --- /dev/null +++ b/.vim/ftplugin/markdown.vim @@ -0,0 +1,11 @@ +" wrap at word breaks +setlocal linebreak + +" have broken lines indent! +setlocal breakindent + +" spell check +setlocal spell spelllang=en_us + +" Break at 80 +setlocal textwidth=80 diff --git a/.vim/ftplugin/pod.vim b/.vim/ftplugin/pod.vim new file mode 100644 index 0000000..1e3cd9b --- /dev/null +++ b/.vim/ftplugin/pod.vim @@ -0,0 +1 @@ +setlocal textwidth=80 diff --git a/.vim/ftplugin/python.vim b/.vim/ftplugin/python.vim new file mode 100644 index 0000000..da21201 --- /dev/null +++ b/.vim/ftplugin/python.vim @@ -0,0 +1,10 @@ +" set fold method to be indent based +" USAGE: +" KEY: no longer use zf#j or zf/ to create folds +" instead: +" zc -- close a fold by indent (at cursor until end indent) +" zo -- open a closed fold +setlocal foldmethod=indent + +" Set the local :make command to run flake8 +setlocal makeprg=flake8\ % diff --git a/.vim/ftplugin/tex.vim b/.vim/ftplugin/tex.vim new file mode 100644 index 0000000..c681ff3 --- /dev/null +++ b/.vim/ftplugin/tex.vim @@ -0,0 +1,14 @@ +" ignore the wrapped lines +noremap k gk +noremap j gj + +" spell check! +setlocal spell spelllang=en_us + +" soft word wrap should not break words +" NOTE: don't use listchars with this feature +setlocal linebreak +setlocal breakindent + +" Break at 80 +setlocal textwidth=80 diff --git a/.vim/ftplugin/vader.vim b/.vim/ftplugin/vader.vim new file mode 100644 index 0000000..cc2136a --- /dev/null +++ b/.vim/ftplugin/vader.vim @@ -0,0 +1,3 @@ +" vader.vim is a Vim testing framework by Junegunn +" https://github.com/junegunn/vader.vim +set foldmethod=marker diff --git a/.vim/ftplugin/vim.vim b/.vim/ftplugin/vim.vim new file mode 100644 index 0000000..c19ab13 --- /dev/null +++ b/.vim/ftplugin/vim.vim @@ -0,0 +1,21 @@ +" Custom folding by expression to fold markers and functions + +let b:viml_fold_markers = split(&foldmarker, ',') + +function! VimLFoldByFunctionAndMarker(lnum) abort + let l = getline(a:lnum) + if l =~ '^\s*function!\? ' + return 'a1' + elseif l =~ '^\s*endfunction' + return 's1' + elseif l =~ b:viml_fold_markers[0] + return 'a1' + elseif l =~ b:viml_fold_markers[1] + return 's1' + else + return '=' + endif +endfunction + +setlocal foldmethod=expr +setlocal foldexpr=VimLFoldByFunctionAndMarker(v:lnum) diff --git a/.vim/gvimrc b/.vim/gvimrc new file mode 100644 index 0000000..b8ec952 --- /dev/null +++ b/.vim/gvimrc @@ -0,0 +1,27 @@ +" Disable visual bells +set noerrorbells visualbell t_vb= +autocmd GUIEnter * set visualbell t_vb= + +" Pretty printing +set printoptions=left:1in,right:1in,paper:letter +set printfont=Consolas:h11 + +" Minimal UI +set guioptions= " Don't show guioptions (toolbar, scrollbar,..) +set guicursor=a:blinkon0 " Don't blink the cursor (not my thang) + +" Font that doesn't hurt my eyes at a size depending on the screen +if has('gui_macvim') + set guifont=Inconsolata:h15 +elseif has('win32') || has('win64') + set guifont=Consolas:h11 +else + set guifont=Inconsolata\ 14 +end + +" Bigger size on startup +set lines=50 +set columns=100 + +" The pop-up asking if you want to reload forces mouse usage :O +set autoread diff --git a/.vim/improved.vim b/.vim/improved.vim new file mode 100644 index 0000000..6f1999c --- /dev/null +++ b/.vim/improved.vim @@ -0,0 +1,141 @@ +" .vim/improved.vim -- putting the IM in VIM + +" GENERAL EDITOR SETTINGS {{{ +" Try to be platform agnostic: +if has('win64') || has('win32') + let s:vimdir = expand($HOME . '/vimfiles') +else + let s:vimdir = expand($HOME . '/.vim') +endif + +" Line numbers on -- helpful for debugging, not needed in `vi` +set number + +" Faster grepping! (use ripgrep if available for :grep and :FZF) +if executable('rg') + set grepprg=rg\ --vimgrep\ --no-heading + set grepformat=%f:%l:%c:%m,%f:%l:%m + let $FZF_DEFAULT_COMMAND = 'rg --files --hidden --glob "!.git/*"' +endif + +" Persistent undo +if has('persistent_undo') && isdirectory(s:vimdir . '/undo') + exe 'set undodir='.s:vimdir.'/undo/' + set undofile " Do indeed create said files + set undolevels=1000 " Max # changes that can be undone + set undoreload=10000 " Saves undofile on reload (:e) if < 10k LOC +endif + +" Use ~/.vim/swp if avail (else .) for backup and swp files respectively +exe 'set backupdir='.s:vimdir.'/swp,.' +exe 'set directory='.s:vimdir.'/swp,.' +" }}} + +" PLUGIN RELATED SETTINGS {{{ +" Don't use powerline font in airline (not neces. installed) +let g:airline_powerline_fonts = 0 + +" This enables folding in the built in markdown ftplugin +let g:markdown_folding = 1 +let g:markdown_fenced_languages = ['sh', 'bash=sh', 'perl', 'python', 'vim'] + +" If using Dirvish, don't use netrw +if isdirectory(s:vimdir . '/pack/plugins/start/vim-dirvish/plugin') + " Dirvish #137 + let loaded_netrwPlugin = 1 +else + let g:netrw_banner=0 " disable banner + let g:netrw_liststyle=1 " details view +endif + +" Mojolicious syntax highlighting for Mojolicious::Lite +let mojo_highlight_data = 1 + +" git-messenger with popup windows is cool! +let g:git_messenger_always_into_popup = v:true +" }}} + +" COLORSCHEME {{{ +" Only gruv if you can handle it +" NOTE: for initial check, check $TERM, not &term, as nvim has &term=nvim +if (($TERM =~# '256color' && has("termguicolors")) || has('gui_running')) && + \ filereadable(s:vimdir . "/pack/mine/start/gruvbox/colors/gruvbox.vim") + + set termguicolors + colorscheme gruvbox + + " See :h xterm-true-color for tmux+termguicolors + if &term =~# '^\(tmux\|st\|screen\)' + let &t_8f = "\[38;2;%lu;%lu;%lum" + let &t_8b = "\[48;2;%lu;%lu;%lum" + endif + + set background=dark + + augroup CurLineToggle + autocmd! + autocmd InsertEnter,InsertLeave * set cul! + augroup END +else + " Can't handle the gruv + set background=light + colorscheme vc +endif +" }}} + +" KEY MAPPINGS {{{ +" set leader to be spacebar +let mapleader = " " + +"Map ctrl-i/j/k/h to switch between splits +nnoremap j +nnoremap k +nnoremap h +nnoremap l + +" Paste from clipboard without any formatting issues +nnoremap :set paste \| put + \| set nopaste + +" Clear trailing whitespace (through regexp) +nnoremap :call vimrc#CMDPreserve("%s/\\s\\+$//e") + +" edit in current buffer dir +nnoremap e :e %:h/ +nnoremap v :vsp %:h/ +nnoremap s :sp %:h/ + +" toggle color column (to ensure short lines) +nnoremap C vimrc#ToggleColorColumn() + +" 2 space / 4 space toggle +nnoremap 2 :setlocal softtabstop=2 shiftwidth=2 +nnoremap 4 :setlocal softtabstop=4 shiftwidth=4 + +" Clear that highlight! +nnoremap :nohlsearch + +" Get greppin quick! --> search word under cursor (escape # for VimL autoload) +nnoremap g :exe "grep " . substitute(expand(''), '#', '\\#', 'g') +nnoremap G :Ggrep! :copen + +" Toggle whitespace +nnoremap w :set list! + +" Yank entire file +nnoremap y :0,$y + + +" Edit vimrc +nnoremap V :edit $HOME/.vim/vimrc + +" From defaults.vim: breaks the undo chain so we can undo +inoremap u +" }}} + +" COMMANDS {{{ +command! CD exe 'cd ' . expand('%:h') +" }}} + +" Load optional config (in ~/.vim) +runtime! .vimrc.local + +" vim:fdm=marker:sts=4:sw=4 diff --git a/.vim/pack/mine/start/gruvbox b/.vim/pack/mine/start/gruvbox new file mode 160000 index 0000000..6c59bb5 --- /dev/null +++ b/.vim/pack/mine/start/gruvbox @@ -0,0 +1 @@ +Subproject commit 6c59bb5d72abcab0f22fc819793cf1f3b53d1336 diff --git a/.vim/pack/plugins/start/gv.vim b/.vim/pack/plugins/start/gv.vim new file mode 160000 index 0000000..023b315 --- /dev/null +++ b/.vim/pack/plugins/start/gv.vim @@ -0,0 +1 @@ +Subproject commit 023b315ea1fb92aba20c71ef54f806d2903cfc9e diff --git a/.vim/pack/plugins/start/vim-commentary b/.vim/pack/plugins/start/vim-commentary new file mode 160000 index 0000000..141d9d3 --- /dev/null +++ b/.vim/pack/plugins/start/vim-commentary @@ -0,0 +1 @@ +Subproject commit 141d9d32a9fb58fe474fcc89cd7221eb2dd57b3a diff --git a/.vim/pack/plugins/start/vim-dirvish b/.vim/pack/plugins/start/vim-dirvish new file mode 160000 index 0000000..eba64ed --- /dev/null +++ b/.vim/pack/plugins/start/vim-dirvish @@ -0,0 +1 @@ +Subproject commit eba64ed111a3aab8121a0e5b6df62c6f19e05322 diff --git a/.vim/pack/plugins/start/vim-fugitive b/.vim/pack/plugins/start/vim-fugitive new file mode 160000 index 0000000..875a58c --- /dev/null +++ b/.vim/pack/plugins/start/vim-fugitive @@ -0,0 +1 @@ +Subproject commit 875a58c2e1b2022fb806a40f75c5c7b0f34667eb diff --git a/.vim/pack/plugins/start/vim-gitgutter b/.vim/pack/plugins/start/vim-gitgutter new file mode 160000 index 0000000..c75c83d --- /dev/null +++ b/.vim/pack/plugins/start/vim-gitgutter @@ -0,0 +1 @@ +Subproject commit c75c83df531881008f8cf903eab7cd68bc19ff7a diff --git a/.vim/pack/plugins/start/vim-surround b/.vim/pack/plugins/start/vim-surround new file mode 160000 index 0000000..fab8621 --- /dev/null +++ b/.vim/pack/plugins/start/vim-surround @@ -0,0 +1 @@ +Subproject commit fab8621670f71637e9960003af28365129b1dfd0 diff --git a/.vim/swp/.gitkeep b/.vim/swp/.gitkeep new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/.vim/swp/.gitkeep diff --git a/.vim/syntax/python.vim b/.vim/syntax/python.vim new file mode 100644 index 0000000..18539d9 --- /dev/null +++ b/.vim/syntax/python.vim @@ -0,0 +1,3 @@ +" Highlight the self keyword +syn keyword pythonSelf self +highlight link pythonSelf GruvboxBlue diff --git a/.vim/undo/.gitkeep b/.vim/undo/.gitkeep new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/.vim/undo/.gitkeep diff --git a/.vim/vimrc b/.vim/vimrc new file mode 100644 index 0000000..db89224 --- /dev/null +++ b/.vim/vimrc @@ -0,0 +1,28 @@ +" .vimrc -- the bare necessities +filetype plugin indent on " Enable filetype plugins/indentation +syntax on " Syntax highlighting on +set softtabstop=4 " is 4 spaces (when expandtab set) +set shiftwidth=4 " >> will indent 4 spaces +set expandtab " Needed to replace with spaces +set autoindent " Indent carries over on new line +set smarttab " Use shiftwidth for and +set hlsearch " Highlight searches +set incsearch " Incrementally search +set backspace=indent,eol,start " Backspace should function as expected +set ttimeout " Timeout on esc keycodes +set ttimeoutlen=30 " Low timeout to avoid delay +set modelines=0 " Disable modelines for security +set history=10000 " Remember last 1000 :commands +set scrolloff=3 " Scroll at 3 rows from edge of screen +set wildmenu " Visual completion for command mode +set showcmd " Show the command being typed +set laststatus=2 " Always show the statusbar +set noequalalways " Don't resize split on open/close event +set listchars=tab:>-,trail:~,eol:$ " Nicer whitespace + +if v:progname =~# 'vim$' + runtime! improved.vim " put the IM in VIM +elseif has('packages') + set pp-=~/.vim + set pp-=~/.vim/after +endif diff --git a/.xinitrc b/.xinitrc new file mode 100644 index 0000000..65e2f4a --- /dev/null +++ b/.xinitrc @@ -0,0 +1,26 @@ +# This is the config I use for dwm + startx +setxkbmap -option caps:ctrl_modifier +slstatus & + +[ -e ~/background.png ] && feh --bg-fill ~/background.png + +if [ $(uname) = "OpenBSD" ]; then + # On my thinkpad, I seem to need these xinput calls to get + # middle click scroll to work on OpenBSD. Linux is fine + xinput set-prop "/dev/wsmouse" "WS Pointer Wheel Emulation" 1 + xinput set-prop "/dev/wsmouse" "WS Pointer Wheel Emulation Button" 2 + xinput set-prop "/dev/wsmouse" "WS Pointer Wheel Emulation Axes" 6 7 4 5 + + # since xenodm is run as root, we need to export ENV + # ~/.shrc otherwise the interactive shells spawned in st + # won't have the right profile + export ENV=~/.shrc + + # Prefer UTF-8 in X for unicode character support + export LC_CTYPE="en_US.UTF-8" + + # xenodm handles ssh-agent for us + exec cwm +else + ssh-agent dwm +fi diff --git a/README.md b/README.md index 443fa93..dd05f67 100644 --- a/README.md +++ b/README.md @@ -1,16 +1,22 @@ -# dotfiles - +dotfiles +======== Vim, tmux, mutt... hope you enjoy the shell! What follows is my (ongoing) tooling journey. I'm currently on Linux both at home and at work, so the support for macOS and Windows is fleeting at best. -## Installation - +Installation +------------ I'm a big believer in the "do it yourself" style of dotfiles. Fork if you'd like, but don't blindly copy! -These configs work for me, but [definitely aren't for everyone](./vc/README.md). +These configs work for me, but [definitely aren't for everyone](./etc/vc/README.md). + +This all said, to set up a new machine I run: -This all said, [install.sh](./install.sh) is how I set up a new machine / -user account. +```sh +$ git clone --bare https://github.com/akarle/dotfiles ~/.cfg +$ git -C ~/.cfg config status.showUntrackedFiles no +$ alias cfg='git --git-dir=$HOME/.cfg --work-tree=$HOME' +$ cfg checkout # resolve any conflicts from existing files... +``` diff --git a/X11/xinitrc b/X11/xinitrc deleted file mode 100644 index 65e2f4a..0000000 --- a/X11/xinitrc +++ /dev/null @@ -1,26 +0,0 @@ -# This is the config I use for dwm + startx -setxkbmap -option caps:ctrl_modifier -slstatus & - -[ -e ~/background.png ] && feh --bg-fill ~/background.png - -if [ $(uname) = "OpenBSD" ]; then - # On my thinkpad, I seem to need these xinput calls to get - # middle click scroll to work on OpenBSD. Linux is fine - xinput set-prop "/dev/wsmouse" "WS Pointer Wheel Emulation" 1 - xinput set-prop "/dev/wsmouse" "WS Pointer Wheel Emulation Button" 2 - xinput set-prop "/dev/wsmouse" "WS Pointer Wheel Emulation Axes" 6 7 4 5 - - # since xenodm is run as root, we need to export ENV - # ~/.shrc otherwise the interactive shells spawned in st - # won't have the right profile - export ENV=~/.shrc - - # Prefer UTF-8 in X for unicode character support - export LC_CTYPE="en_US.UTF-8" - - # xenodm handles ssh-agent for us - exec cwm -else - ssh-agent dwm -fi diff --git a/bash/bash_profile b/bash/bash_profile deleted file mode 100644 index 22c9a07..0000000 --- a/bash/bash_profile +++ /dev/null @@ -1,15 +0,0 @@ -#!/usr/bin/env bash -# sourced by login shells (not interactive shells) -# Example: -# - ssh to Linux --> run bash_profile on login -# - open new tmux window --> run bashrc -# -# Exception: -# ** On OSX bash_profile is run by terminal emulators (new tabs, etc) ** -# -# Takeaway: -# ** Write preferences in bashrc, source it from bash_profile ** - -if [ -r ~/.bashrc ]; then - source ~/.bashrc -fi diff --git a/bash/bashrc b/bash/bashrc deleted file mode 100644 index 3a61869..0000000 --- a/bash/bashrc +++ /dev/null @@ -1,64 +0,0 @@ -#!/usr/bin/env bash -# .bashrc -# The way I like to roll in the shell - -# If not running interactively, don't do anything -[[ $- != *i* ]] && return - -# Settings -stty -ixon # Disable XON/XOFF to allow forward search w CTRL-S -shopt -s checkwinsize # check win size after each cmd, update if needed -shopt -s histappend # append to the history file, don't overwrite it -HISTSIZE=10000 # Max lines in history (in memory) -HISTFILESIZE=200000 # Max size of the history file -HISTIGNORE=fg:pwd:ls # Don't store common commands in history -HISTCONTROL=ignoreboth # Don't store duped / whitespace-led commands in history -PROMPT_COMMAND="history -a" # Record history after each command - -# Includes -include() { [ -r "$1" ] && source "$1"; } -include "$HOME/.shrc" # Common shell configuration -include "$HOME/.bash/git-completion.bash" # Git Completion -include "$HOME/.console_theme" # Virtual Console colors (if TERM == "linux") -include "$HOME/.bashrc.local" # System specific settings - -if [ -n "$USE_FANCY_PROMPT" ]; then - parse_git_dirty() { - if [ -z "$BASH_PROMPT_NO_GSTATUS" ]; then - [ "$(git status --porcelain=v1 2> /dev/null)" ] && echo "*" - fi - } - - git_info() { - git branch --no-color 2> /dev/null | - sed -e '/^[^*]/d' -e "s/* \(.*\)/\1$(parse_git_dirty)/" - } - - # Preferred Prompt: fancy with colors from tput - if tput setaf 1 &> /dev/null; then - tput sgr0 # reset effects of test command - RED="\[$(tput setaf 1)\]" - MAGENTA="\[$(tput setaf 5)\]" - YELLOW="\[$(tput setaf 3)\]" - GRAY="\[$(tput setaf 8)\]" - BLUE="\[$(tput setaf 4)\]" - BOLD="\[$(tput bold)\]" - RESET="\[$(tput sgr0)\]" - - PS1_TOP="$BOLD$RED\$(last_err)$BLUE\w $RESET$GRAY$SSH_PROMPT\$(git_info)" - PS1="$PS1_TOP\n$BOLD$MAGENTA\$ $RESET" - PS2="$YELLOW> $RESET" - fi -fi - -# Git completion for ~/.aliases -if [ -n "$(type -t __git_complete)" ] && - [ "$(type -t __git_complete)" == "function" ]; then - __git_complete ga _git_add - __git_complete gco _git_checkout - __git_complete gd _git_diff - __git_complete gr _git_rebase - __git_complete gb _git_branch -fi - -alias rb='source ~/.bashrc' diff --git a/bash/console_theme b/bash/console_theme deleted file mode 100644 index 2b1a3f2..0000000 --- a/bash/console_theme +++ /dev/null @@ -1,25 +0,0 @@ -#!/usr/bin/env bash -# bash/console_theme -# A small script to set the Virtual Console to use Gruvbox colors. -# Colors originally from https://github.com/morhetz/gruvbox by Pavel Pertsev -# For more on escape sequences see console_codes(4) -if [[ "$TERM" =~ "linux" ]]; then - # Gruvbox 16 colors - printf "\033]P0282828" # 0: Black - printf "\033]P1cc241d" # 1: Red - printf "\033]P298971a" # 2: Green - printf "\033]P3d79921" # 3: Yellow - printf "\033]P4458588" # 4: Blue - printf "\033]P5b16286" # 5: Magenta - printf "\033]P6689d6a" # 6: Cyan - printf "\033]P7a89984" # 7: White - printf "\033]P8928374" # 8: Bright Black - printf "\033]P9fb4934" # 9: Bright Red - printf "\033]Pab8bb26" # 10: Bright Green - printf "\033]Pbfabd2f" # 11: Bright Yellow - printf "\033]Pc83a598" # 12: Bright Blue - printf "\033]Pdd3869b" # 13: Bright Magenta - printf "\033]Pe8ec07c" # 14: Bright Cyan - printf "\033]Pfebdbb2" # 15: Bright White - clear # Redraw the screen... -fi diff --git a/bash/inputrc b/bash/inputrc deleted file mode 100644 index ac4a6f0..0000000 --- a/bash/inputrc +++ /dev/null @@ -1,18 +0,0 @@ -# vi keys! Needs to be up top -set editing-mode vi -set show-mode-in-prompt on -set vi-cmd-mode-string ":" -set vi-ins-mode-string "" - -set keymap vi-command -Control-l: clear-screen - -set keymap vi-insert -Control-l: clear-screen -Control-x: yank-last-arg - -# Quicker changing of prompt after ESC -set keyseq-timeout 30 - -# Don't make noise, please! -set bell-style none diff --git a/cwm/cwmrc b/cwm/cwmrc deleted file mode 100644 index fe43693..0000000 --- a/cwm/cwmrc +++ /dev/null @@ -1,32 +0,0 @@ -# Commands (for menu-cmd) -command firefox firefox -command term /usr/local/bin/st -command lock /usr/local/bin/slock -command top "/usr/local/bin/st -e top" -command htop "/usr/local/bin/st -e htop" -command mutt "/usr/local/bin/st -e mutt" - -# Global keys -bind-key 4S-e quit -bind-key 4S-r restart - -# App spawns -bind-key 4S-Return terminal -bind-key 4-w firefox -bind-key 4-p menu-cmd -bind-key 4S-p menu-exec -bind-key 4S-w menu-window -bind-key 4S-g menu-group -bind-key 4-semicolon lock - -# Window manipulation -bind-key 4-Return window-fullscreen -bind-key 4-j window-cycle -bind-key 4-k window-rcycle -bind-key 4S-j group-cycle -bind-key 4S-k group-rcycle -bind-key 4S-q window-close - -# Mouse it -bind-mouse 4-1 window-move -bind-mouse 4-3 window-resize diff --git a/deps/pash b/deps/pash deleted file mode 160000 index 2fb2092..0000000 --- a/deps/pash +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 2fb2092447b1577b47fbf9bc682e7fcb7e98efce diff --git a/etc/deps/pash b/etc/deps/pash new file mode 160000 index 0000000..2fb2092 --- /dev/null +++ b/etc/deps/pash @@ -0,0 +1 @@ +Subproject commit 2fb2092447b1577b47fbf9bc682e7fcb7e98efce diff --git a/etc/mbsyncrc b/etc/mbsyncrc new file mode 100644 index 0000000..0fd6a68 --- /dev/null +++ b/etc/mbsyncrc @@ -0,0 +1,23 @@ +# mbsyncrc -- see `man mbsync` +IMAPAccount karleco +User alex@karle.co +Host imap.fastmail.com +SSLType IMAPS +PassCmd "+pash show mail/karleco" + +IMAPStore karleco-fastmail +Account karleco + +MaildirStore karleco-local +Path ~/mail/karleco/ +Inbox ~/mail/karleco/INBOX +Flatten . + +Channel karleco +Master :karleco-fastmail: +Slave :karleco-local: +Patterns * +SyncState * +Sync All +Create Both +CopyArrivalDate yes diff --git a/etc/perl/README.md b/etc/perl/README.md new file mode 100644 index 0000000..9b0c0f1 --- /dev/null +++ b/etc/perl/README.md @@ -0,0 +1,11 @@ +# dotfiles/etc/perl + +The `cpanfile` contains all the CPAN modules I like to install +for Perl development. See also the [.perldb](.perldb) file for +history in the Perl debugger. + +To install them, first install `cpanm`, and then run: + +```sh +cpanm --installdeps /path/to/dotfiles/etc/perl +``` diff --git a/etc/perl/cpanfile b/etc/perl/cpanfile new file mode 100644 index 0000000..ed2ee50 --- /dev/null +++ b/etc/perl/cpanfile @@ -0,0 +1,4 @@ +# The below is necessary to use the readline libary that comes with +# bash, which has necessary features like arrow key navigation, +# history, vi keybindings... just install it already! +requires 'Term::ReadLine::Gnu'; diff --git a/etc/vc/README.md b/etc/vc/README.md new file mode 100644 index 0000000..2537de6 --- /dev/null +++ b/etc/vc/README.md @@ -0,0 +1,15 @@ +# Virtual Console + +Who needs X, right? + +These config files are designed to maximize productivity in the Linux virtual +console. + +Kept in the dotfile repo mostly so I don't have to re-lookup the capslock +mapping every time I use a fresh Linux. + +## Installation + +Copy `vconsole.conf` to `/etc` + +And copy `personal.map` to `/usr/share/kbd` diff --git a/etc/vc/personal.map b/etc/vc/personal.map new file mode 100644 index 0000000..61e506d --- /dev/null +++ b/etc/vc/personal.map @@ -0,0 +1,4 @@ +include "/usr/share/kbd/keymaps/i386/qwerty/us.map.gz" + +# Who uses Caps Lock, anyways? +keycode 58 = Control diff --git a/etc/vc/vconsole.conf b/etc/vc/vconsole.conf new file mode 100644 index 0000000..4caa50c --- /dev/null +++ b/etc/vc/vconsole.conf @@ -0,0 +1,3 @@ +# Use terminus-font package +FONT=ter-132n +KEYMAP=personal diff --git a/etc/vi_prompt_append.zsh b/etc/vi_prompt_append.zsh new file mode 100644 index 0000000..6075d50 --- /dev/null +++ b/etc/vi_prompt_append.zsh @@ -0,0 +1,37 @@ +# Vi Prompt Append! +# +# I like Vi(m) related things! I like Vi in my zsh, BUT, not knowing +# which mode (Normal/Insert) you are in can be damaging. SO, I created +# this little script to append an indicator (and change it) for any +# zsh theme! +# +# Assumes bindkey -v is on! +# +# USAGE: +# Source AFTER your theme! (so prompt isn't reset!) + +# First, the globals +VI_NORMAL_PROMPT="%{$fg_bold[yellow]%}[% N]% %{$reset_color%}" +VI_INSERT_PROMPT="%{$fg_bold[blue]%}[% I]% %{$reset_color%}" +VI_PROMPT_CHAR="$VI_INSERT_PROMPT" + +# Simple function to output the Vi prompt +vi_mode() { + local vi_mode_chars="${VI_PROMPT_CHAR}" + echo -n "$vi_mode_chars" +} + +# The magic is here -- append to PROMPT +# Note to self -- need '' around the vi_mode function +PROMPT='$(vi_mode)'"$PROMPT" + +# This function changes the prompt / resets it on Normal/Insert toggle +# Heavily inspired by Doug Black (https://dougblack.io/words/zsh-vi-mode.html) +function zle-line-init zle-keymap-select { + # for use in my custom vi prompt append + VI_PROMPT_CHAR="${${KEYMAP/vicmd/$VI_NORMAL_PROMPT}/(main|viins)/$VI_INSERT_PROMPT}" + zle reset-prompt +} + +zle -N zle-line-init +zle -N zle-keymap-select diff --git a/gdb/gdbinit b/gdb/gdbinit deleted file mode 100644 index 139c791..0000000 --- a/gdb/gdbinit +++ /dev/null @@ -1,4 +0,0 @@ -# Save history, but do it globally -set history save on -set history size 10000 -set history filename ~/.gdb_history diff --git a/git/config b/git/config deleted file mode 100644 index 65e48e9..0000000 --- a/git/config +++ /dev/null @@ -1,15 +0,0 @@ -[core] - editor = $EDITOR - -[user] - email = alex@alexkarle.com - name = Alex Karle - -[sendemail] - smtpserver = smtp.fastmail.com - smtpuser = alex@alexkarle.com - smtpencryption = tls - smtpserverport = 587 - annotate = yes -[pull] - ff = only diff --git a/git/ignore b/git/ignore deleted file mode 100644 index 71cfce6..0000000 --- a/git/ignore +++ /dev/null @@ -1,16 +0,0 @@ -# My Global .gitignore -# Set with: -# git config --global core.excludesfile 'path/to/.gitignore' -# -# For the junk that I create that nobody else needs or wants - -# ctags files -tags -TAGS - -# Backup files -*.swp -*~ - -# OS Junk -.DS_Store diff --git a/gtk/gtk-3.0/settings.ini b/gtk/gtk-3.0/settings.ini deleted file mode 100644 index 6bcbff5..0000000 --- a/gtk/gtk-3.0/settings.ini +++ /dev/null @@ -1,2 +0,0 @@ -[Settings] -gtk-key-theme-name=Default diff --git a/install.sh b/install.sh deleted file mode 100755 index d1b618a..0000000 --- a/install.sh +++ /dev/null @@ -1,57 +0,0 @@ -#!/bin/sh -# Minimal install (no prereqs, just the basics) -# Intended to be run on a new account, NOT for long term management -# However, should be safe to rerun to fix/tune-up an existing install -set -e - -DOTFILES="$( cd "$(dirname "$0")" ; pwd -P )" - -# ln with the right settings and a nicer message -try_ln() { - # bail out early if source doesn't exist - [ -e "$1" ] || return 0 - - # we know source is legit, set up dest - if [ -e "$2" ]; then - if [ -h "$2" ]; then - if [ `readlink $2` = "$1" ]; then - echo "[Up to Date ] $2" | sed "s#$HOME#~#" - else - ln -snf $1 $2 - echo "[Updated Link] $2" | sed "s#$HOME#~#" - fi - else - echo "[Fail:Exists ] $2" | sed "s#$HOME#~#" - return - fi - else - ln -snf $1 $2 - echo "[New ] $2" | sed "s#$HOME#~#" - fi -} - -# bin scripts -mkdir -p $HOME/bin -for f in $DOTFILES/bin/*; do - try_ln $f $HOME/bin/`basename $f` -done - -# XDG_CONFIG_HOME dirs -mkdir -p $HOME/.config -for d in mutt git nvim; do - try_ln $DOTFILES/$d $HOME/.config/$d -done - -# Traditional dotfiles -for d in bash tmux X11 sh vi; do - for f in $DOTFILES/$d/*; do - try_ln $f $HOME/.`basename $f` - done -done - -# Special cases -try_ln $DOTFILES/vim $HOME/.vim -try_ln $DOTFILES/deps/pash/pash $HOME/bin/pash - -# Touch files expected to be in the install -touch $HOME/.config/mutt/muttrc.local diff --git a/mbsync/mbsyncrc b/mbsync/mbsyncrc deleted file mode 100644 index 0fd6a68..0000000 --- a/mbsync/mbsyncrc +++ /dev/null @@ -1,23 +0,0 @@ -# mbsyncrc -- see `man mbsync` -IMAPAccount karleco -User alex@karle.co -Host imap.fastmail.com -SSLType IMAPS -PassCmd "+pash show mail/karleco" - -IMAPStore karleco-fastmail -Account karleco - -MaildirStore karleco-local -Path ~/mail/karleco/ -Inbox ~/mail/karleco/INBOX -Flatten . - -Channel karleco -Master :karleco-fastmail: -Slave :karleco-local: -Patterns * -SyncState * -Sync All -Create Both -CopyArrivalDate yes diff --git a/mutt/.gitignore b/mutt/.gitignore deleted file mode 100644 index 318d1e0..0000000 --- a/mutt/.gitignore +++ /dev/null @@ -1,9 +0,0 @@ -# Not worth checking in encrypted passwords, as FastMail requires a different -# password for each client anyways... -*.gpg - -# Don't check in those emails ;) -cache - -# Local muttrc to determine which account to use, etc -muttrc.local diff --git a/mutt/README.md b/mutt/README.md deleted file mode 100644 index 79b3433..0000000 --- a/mutt/README.md +++ /dev/null @@ -1,27 +0,0 @@ -# mutt - -Trying `mutt` in pursuit of an email client that sucks less. - -## Installation - -This folder should be symlinked to the `$XDG_CONFIG_HOME`. But other than that -it is necessary to generate an encrypted password file. - -Given that I am using FastMail, they insist on having a one-client one-time -password for each mail client that isn't theirs. So, in this order: - -1. Go to FastMail's web client -2. Under Settings create a password -3. Create a GPG key if you don't already have one: - -``` -gpg --gen-key -``` - -4. Use that key's public key to encrypt the password (and putt it in a file): - -``` -echo -n "PASSWORD" | gpg --encrypt -r EMAIL > accounts/karleco.gpg -``` - -Now, everything should work! diff --git a/mutt/accounts/karleco.muttrc b/mutt/accounts/karleco.muttrc deleted file mode 100644 index eb9f27f..0000000 --- a/mutt/accounts/karleco.muttrc +++ /dev/null @@ -1,16 +0,0 @@ -# Account setup for my personal email -# Checked into git as a template for other accounts - -set from="alex@alexkarle.com" -set realname="Alex Karle" - -# Use a local copy of my mail (for speed and offline-access) -set mbox_type="Maildir" -set folder="~/mail/karleco/" -set spoolfile="=INBOX" -set record="=Sent" -set postponed="=Drafts" - -# Uncomment if sendmail not configured on machine -# set smtp_pass=`pash show mail/karleco` -# set smtp_url="smtps://$from:$smtp_pass@smtp.fastmail.com:465" diff --git a/mutt/mailcap b/mutt/mailcap deleted file mode 100644 index cab96f6..0000000 --- a/mutt/mailcap +++ /dev/null @@ -1,11 +0,0 @@ -# Defaults (for GUI/X) -text/plain; $EDITOR '%s'; -application/octet-stream; $EDITOR '%s'; -text/html; firefox '%s' & sleep 1; test=test -n "$DISPLAY"; needsterminal; -text/html; w3m -I %{charset} -T text/html; copiousoutput; -image/*; feh '%s' ; test=test -n "$DISPLAY"; needsterminal; -application/pdf; xdg-open '%s' &; test=test -n "$DISPLAY"; needsterminal; - -# Backups for Virtual Console (needs fbida package) -image/*; fbi -a '%s'; -application/pdf; fbgs '%s'; diff --git a/mutt/muttrc b/mutt/muttrc deleted file mode 100644 index 321193e..0000000 --- a/mutt/muttrc +++ /dev/null @@ -1,99 +0,0 @@ -# muttrc -# In pursuit of an email client that sucks less - -################################################################################ -# General / Behavior -source ~/.config/mutt/muttrc.local - -set ssl_force_tls = yes # Require encrypted connection - -# Attachments -set mailcap_path=~/.config/mutt/mailcap -auto_view text/html # tell mutt to load HTML via mailcap -alternative_order text/plain text/enriched text/html # prefer plaintext - -# Fetching Mail -set mail_check=90 # From the manual, over IMAP, 90 reasonable value -set timeout=15 # mutt blocks mail check if no user input - -# Caching (speeds up IMAP considerably to not redownload every time) -set header_cache="~/.config/mutt/cache" -set message_cachedir="~/.config/mutt/cache" - -# BCC self to show up in INBOX -my_hdr BCC: $from - -# Use the `abook` program for contact management/completions -set query_command="abook --mutt-query '%s'" - -# Enables shelling out in macros without a pause -set wait_key=no - -################################################################################ -# Appearance / Layout -set sort=threads -set sort_aux=reverse-last-date-received - -# Show some index in the pager -set pager_index_lines=6 - -# Restrict quotes to |, :, and > (default has } and # which match code) -set quote_regexp="^([ \t]*[|>:])+" -color index yellow black ~U -color quoted green black -color quoted1 blue black -color quoted2 magenta black -color quoted3 yellow black -color quoted4 red black - -# Patch highting -color body green black "^\\+.*" -color body red black "^-.*" -color body magenta black "^\\+\\+\\+ b/.*" -color body magenta black "^--- a/.*" -color body magenta black "^@@.*@@" -color body magenta black "^@@.*@@" -color body magenta black "^diff --git.*" -color body magenta black "^index [0-9a-z]{7}\\.\\.[0-9a-z]{7}.*" - -################################################################################ -# Bindings -# I've chosen to customize-as-I-go on these. Some general guiding rules: -# 1. Vi-like -# - Obvious reasons -# 2. Non-destructive -# - Especially as a newby, its **the worst** to have CTRL-D -# which I spam in Vim for half-down to delete 5-10 messages -# in the pager before I've realized what I've done. - -# Navigation -bind pager j next-line -bind pager k previous-line -bind index G last-entry -bind pager G bottom -bind index,pager g noop # good practice, as gg prevents g from binding -bind index gg first-entry -bind pager gg top -bind index,pager \CD half-down -bind index,pager \CU half-up -bind index,pager d half-down -bind index,pager u half-up -bind index,pager previous-unread -bind index,pager next-unread -bind index,pager next-unread - -# Functional -bind index,pager h help -bind index,pager ? search-reverse -bind index N search-opposite -bind index,pager R group-reply -bind index \CN toggle-new -bind attach view-mailcap -bind editor complete-query # Used for contact-completion - -# Macros -macro index,pager ga "abook --add-email-quiet" "Add sender to abook contacts" -macro index g$ "mbsync -a" "Sync with mbsync" - -# set send_multipart_alternative=ask-no -# set send_multipart_alternative_filter=markdown2html diff --git a/nvim/init.vim b/nvim/init.vim deleted file mode 100644 index 523ddc9..0000000 --- a/nvim/init.vim +++ /dev/null @@ -1,20 +0,0 @@ -" init.vim -- the config for neovim -" -" Used for specific neovim customization! - -" First, just source the regular Vim stuff -set runtimepath+=~/.vim,~/.vim/after -set packpath+=~/.vim - -if filereadable(expand("~/.vimrc")) - " On some machines, I prefer to use a ~/.vimrc - source ~/.vimrc -else - source ~/.vim/vimrc -endif - -" no numbers in terminal -autocmd TermOpen * setlocal nonumber - -" incrementally show substitutions! -set inccommand=nosplit diff --git a/perl/README.md b/perl/README.md deleted file mode 100644 index 27a47f2..0000000 --- a/perl/README.md +++ /dev/null @@ -1,18 +0,0 @@ -# dotfiles/perl - -Just a collection of files related to Perl that are useful to me. - -Some highlights: - -* `perldb` -- the Perl debugger config -* `cpanfile` -- a list of modules I can't live without (and install on any new - machine) - -## Installation - -1. Symlink perldb to ~/.perldb -2. Install `cpanm` and run the following: - -```sh -cpanm --installdeps /path/to/dotfiles/perl -``` diff --git a/perl/cpanfile b/perl/cpanfile deleted file mode 100644 index ed2ee50..0000000 --- a/perl/cpanfile +++ /dev/null @@ -1,4 +0,0 @@ -# The below is necessary to use the readline libary that comes with -# bash, which has necessary features like arrow key navigation, -# history, vi keybindings... just install it already! -requires 'Term::ReadLine::Gnu'; diff --git a/perl/perldb b/perl/perldb deleted file mode 100644 index 13b54e1..0000000 --- a/perl/perldb +++ /dev/null @@ -1,3 +0,0 @@ -# Save all history to ~/.perldb.hist -&parse_options("HistFile=$ENV{HOME}/.perldb.hist"); -&parse_options("HistSize=10000"); diff --git a/sh/aliases b/sh/aliases deleted file mode 100644 index f497487..0000000 --- a/sh/aliases +++ /dev/null @@ -1,43 +0,0 @@ -#!/bin/sh -# Aliases for all shells - -# Detect which `ls` flavor is in use -if ls --color > /dev/null 2>&1; then # GNU `ls` - colorflag="--color" -elif ls -G > /dev/null 2>&1; then # macOS `ls` - colorflag="-G" -fi - -# ls aliases -alias ls='ls ${colorflag}' -alias l='ls -lAh ${colorflag}' -alias ll='ls -lh ${colorflag}' - -# Git aliases -alias ga='git add' -alias gc='git commit --verbose' -alias gd='git diff' -alias gp='git push' -alias gs='git status' -alias gst='git status' -alias gl='git pull' -alias gco='git checkout' -alias gf='git fetch' -alias glg='git log --stat --decorate' -alias glgr='git log --oneline | head -n 10' -alias g_='git stash' -alias g_p='git stash pop' -alias gb='git branch' -alias grb='git rebase' -alias grs='git reset' -alias gm='git merge' -alias gg='git grep' -alias vlg='vim -c "GV"' # 'vim log' of a file - -# Quick Actions -alias curljson='curl -H "Content-Type: application/json"' -alias sysmail='mutt -f /var/mail/$USER' - -# Lightweight funcs -aw() { w3m "https://wiki.archlinux.org/index.php?search=$1"; } -ddg() { w3m "https://duckduckgo.com/lite?q=$1"; } diff --git a/sh/profile b/sh/profile deleted file mode 100644 index 8346c85..0000000 --- a/sh/profile +++ /dev/null @@ -1,5 +0,0 @@ -#!/bin/sh -# ~/.profile -- dash/sh/ksh profile -# Sourced for login shells -- set $ENV to ~/.shrc -# to use that as the config for this and all new interactive shells -export ENV="$HOME/.shrc" diff --git a/sh/shrc b/sh/shrc deleted file mode 100755 index 46a566e..0000000 --- a/sh/shrc +++ /dev/null @@ -1,29 +0,0 @@ -#!/bin/sh -# ~/.shrc -- a config for all POSIX shells -[ -z "$PS1" ] && return # Exit early if non-interactive - -# Crucial exports -PATH=$HOME/bin:$PATH # Put ~/bin on the for personal scripts -EDITOR='vi' # $EDITOR, the most important (personal) of exports -VISUAL='vi' # Some programs give priority to this -PAGER='less' # less is more -PERL5LIB=$HOME/perl5/lib/perl5 # default cpanminus location -MANPATH=":$HOME/share/man" -export PATH EDITOR VISUAL PAGER PERL5LIB MANPATH - -# Shell vars -HISTFILE=${HISTFILE:="$HOME/.sh_histo"} # Don't override bash_history - -# Prompt -last_err() { - err="$?" - if [ $err -ne "0" ]; then - echo "($err) " - fi -} -PS1='$(last_err)\w \$ ' - -# Includes -include() { if [ -r "$1" ]; then . "$1"; fi } -include "$HOME/.aliases" -include "$HOME/.shrc.local" diff --git a/tmux/tmux.conf b/tmux/tmux.conf deleted file mode 100644 index 1e45a72..0000000 --- a/tmux/tmux.conf +++ /dev/null @@ -1,64 +0,0 @@ -#----------# -# Settings # -#----------# -set -g prefix C-a # Who can reach C-b? -set -g mouse on # I guess mice are useful sometimes.. -set -g mode-keys vi # vi or di -set -g base-index 1 # Start windows at 1 -set -g pane-base-index 1 # Start panes at 1 -set -g renumber-windows on # Closed windows renumber -set -s escape-time 0 # ESC instantly passed through to process -set -g set-clipboard off # Use xclip over escape-code-clipboard #1119 - -# Set default term based on $TERM -set default-terminal screen # More support for "screen" than "tmux" -if "test $TERM = 'st-256color' -o $TERM = 'xterm-256color'" \ - 'set default-terminal screen-256color' - - -#----------# -# Bindings # -#----------# - -# remap prefix from 'C-b' to 'C-a' -unbind C-b -bind C-a send-prefix - -# split panes using | and - -unbind '"' -unbind % -bind | split-window -h -c "#{pane_current_path}" -bind - split-window -v -c "#{pane_current_path}" - -# new window same directory -bind c new-window -c "#{pane_current_path}" - -# reload config file -bind r source-file ~/.tmux.conf \; display 'reloaded' - -# switch panes using vim keys -bind C-h select-pane -L -bind C-j select-pane -D -bind C-k select-pane -U -bind C-l select-pane -R - -# set vi-bindings for scrolling -bind -T copy-mode-vi v send -X begin-selection -bind -T copy-mode-vi y send -X copy-pipe-and-cancel 'xclip -in -selection clipboard' - -# GoToHttp -- find the last url in the buffer -bind H copy-mode\; send -X search-backward "http" \; send -X begin-selection \; send -X next-space-end -bind -T copy-mode-vi H send -X start-of-line \; send -X search-again \; send -X begin-selection \; send -X next-space-end - -bind P copy-mode \; send -X search-backward "/" \; send -X begin-selection \; send -X next-space-end \; send -X other-end \; send -X previous-space -bind -T copy-mode-vi P send -X clear-selection \; send -X start-of-line \; send -X search-again \; send -X begin-selection \; send -X next-space-end \; send -X other-end \; send -X previous-space - -#-------# -# THEME # -#-------# - -# Status -set -g status-interval 60 -set -g status-left-length 20 -set -g status-right "[$USER@#h] #(slstatus -s)%D %H:%M" -set -g status-right-length 90 diff --git a/vc/README.md b/vc/README.md deleted file mode 100644 index 2537de6..0000000 --- a/vc/README.md +++ /dev/null @@ -1,15 +0,0 @@ -# Virtual Console - -Who needs X, right? - -These config files are designed to maximize productivity in the Linux virtual -console. - -Kept in the dotfile repo mostly so I don't have to re-lookup the capslock -mapping every time I use a fresh Linux. - -## Installation - -Copy `vconsole.conf` to `/etc` - -And copy `personal.map` to `/usr/share/kbd` diff --git a/vc/personal.map b/vc/personal.map deleted file mode 100644 index 61e506d..0000000 --- a/vc/personal.map +++ /dev/null @@ -1,4 +0,0 @@ -include "/usr/share/kbd/keymaps/i386/qwerty/us.map.gz" - -# Who uses Caps Lock, anyways? -keycode 58 = Control diff --git a/vc/vconsole.conf b/vc/vconsole.conf deleted file mode 100644 index 4caa50c..0000000 --- a/vc/vconsole.conf +++ /dev/null @@ -1,3 +0,0 @@ -# Use terminus-font package -FONT=ter-132n -KEYMAP=personal diff --git a/vi/exrc b/vi/exrc deleted file mode 100644 index 363212b..0000000 --- a/vi/exrc +++ /dev/null @@ -1,13 +0,0 @@ -" .exrc -- For OpenBSD's nvi -" Mostly used for quick edits or prose (emails, commit messages, etc) -" So default to 72 hard wrapping and spaces over tabs -set ruler -set autoindent -set searchincr -set showmode -set expandtab -set shiftwidth=4 -set tabstop=4 -set wraplen=72 - -map gg 1G diff --git a/vim/.gitignore b/vim/.gitignore deleted file mode 100644 index e27a546..0000000 --- a/vim/.gitignore +++ /dev/null @@ -1,17 +0,0 @@ -# Ignore files generated by editing -# Stuff like swp/ and undo/ really shouldn't be tracked -swp/ -spell/ -undo/ - -# Ignore plugin artifacts -.netrwhist - -# Ignore plugins -pack/ - -# Ignore tags -tags - -# Optional per-computer configuration -.vimrc.local diff --git a/vim/README.md b/vim/README.md deleted file mode 100644 index 421fb49..0000000 --- a/vim/README.md +++ /dev/null @@ -1,28 +0,0 @@ -# dotvim - -My personal Vim configuration. - -## Install - -Mac/Linux: - -```sh -git clone --recurse-submodules https://github.com/akarle/dotfiles ~/dotfiles -ln -s ~/dotfiles/vim ~/.vim -``` - -Windows: - -If you can't figure out how to get symlinks to work (or they don't work, I never -understood them on Windows), set up a minimal vimrc that uses ~/dotfiles/vim as -the ~/vimfiles: - -```sh -git clone --recurse-submodules https://github.com/akarle/dotfiles ~/dotfiles -cat < ~/_vimrc -set rtp ^= ~/dotfiles/vim -set rtp += ~/dotfiles/vim/after -set pp = &rtp -source ~/dotfiles/vim/vimrc -EOM -``` diff --git a/vim/autoload/vimrc.vim b/vim/autoload/vimrc.vim deleted file mode 100644 index 71e5b5c..0000000 --- a/vim/autoload/vimrc.vim +++ /dev/null @@ -1,28 +0,0 @@ -" autoload/vimrc.vim -- functions to be called in vimrc -" -" See `:h autoload-functions` for explanation of autoloading and performance -function! vimrc#ToggleColorColumn() abort - if &colorcolumn == "" - if &textwidth > 0 - exe "set colorcolumn=" . &textwidth - else - set colorcolumn=80 - endif - else - set colorcolumn="" - endif -endfunction - -" A function to execute a command and return to the old position -" CREDIT: http://vimcasts.org/episodes/tidying-whitespace/ -function! vimrc#CMDPreserve(command) abort - " Preparation: save last search, and cursor position. - let _s=@/ - let l = line(".") - let c = col(".") - " Do the business: - execute a:command - " Clean up: restore previous search history, and cursor position - let @/=_s - call cursor(l, c) -endfunction diff --git a/vim/colors/vc.vim b/vim/colors/vc.vim deleted file mode 100644 index 8a27fba..0000000 --- a/vim/colors/vc.vim +++ /dev/null @@ -1,16 +0,0 @@ -" colors/vc.vim -" -" An adaptation of the default colorscheme for the Linux Virtual Console -" (also just my preferred 'default' should there be no gruvbox installed) -" -" Preferred Setup: -" ================ -" - Vim 8.1 (NeoVim insists on setting &t_Co to 256 / dropped t_XX settings) -" - &t_Co == 8 -" - TERM=linux (default VC) or TERM=tmux/screen -" - Base 8-color pallete from gruvbox -" - bg=light -hi! StatusLine cterm=NONE ctermfg=0 ctermbg=7 -hi! StatusLineNC cterm=NONE ctermfg=0 ctermbg=7 -hi! Folded cterm=NONE ctermfg=3 ctermbg=0 -hi! LineNr cterm=NONE ctermfg=7 ctermbg=0 diff --git a/vim/ftplugin/go.vim b/vim/ftplugin/go.vim deleted file mode 100644 index c23c27b..0000000 --- a/vim/ftplugin/go.vim +++ /dev/null @@ -1,2 +0,0 @@ -setlocal noexpandtab -setlocal sw=8 sts=8 diff --git a/vim/ftplugin/help.vim b/vim/ftplugin/help.vim deleted file mode 100644 index 1b11000..0000000 --- a/vim/ftplugin/help.vim +++ /dev/null @@ -1,32 +0,0 @@ -" Some folding settings I like to use for writing Vim plugin documentation -" Won't work universally, but doesn't hurt to enable - -" Simple fold function to fold until the next ===== or ------ -function! DocTxtFoldExpr(lnum) abort - if getline(a:lnum + 1) =~ '^\(=\+\|-\+\)$' - return '<1' - else - return 1 - endif -endfunction - -" Fold Text that prints number lines folded, a preview of what header it is, -" and the section name. Attempted to align nicely, but it breaks with tabs -" - 6 lines: ===== INTRO ..... -" - 12 lines: ----- Example ..... -function! DocTxtFoldText() abort - let l = getline(v:foldstart) - let lp1 = getline(v:foldstart + 1) - let num_lines = v:foldend - v:foldstart + 1 - let lines_text = printf("%4s", num_lines) . ' lines:' - let header_preview = l[0:5] - let section_name = lp1[0:stridx(lp1, ' ')] - if section_name !~ ' $' - let section_name = section_name . ' ' - endif - return join([v:folddashes, lines_text, header_preview, section_name], ' ') -endfunction - -setlocal foldexpr=DocTxtFoldExpr(v:lnum) -setlocal foldtext=DocTxtFoldText() -setlocal foldmethod=expr diff --git a/vim/ftplugin/html.vim b/vim/ftplugin/html.vim deleted file mode 100644 index 12be0ea..0000000 --- a/vim/ftplugin/html.vim +++ /dev/null @@ -1,3 +0,0 @@ -" 2 spaces -setlocal softtabstop=2 -setlocal shiftwidth=2 diff --git a/vim/ftplugin/javascript.vim b/vim/ftplugin/javascript.vim deleted file mode 100644 index bff51f2..0000000 --- a/vim/ftplugin/javascript.vim +++ /dev/null @@ -1,3 +0,0 @@ -" 2 space -setlocal softtabstop=2 -setlocal shiftwidth=2 diff --git a/vim/ftplugin/man.vim b/vim/ftplugin/man.vim deleted file mode 100644 index 216d024..0000000 --- a/vim/ftplugin/man.vim +++ /dev/null @@ -1,3 +0,0 @@ -" break lines at word boundaries -setlocal wrap -setlocal linebreak diff --git a/vim/ftplugin/markdown.vim b/vim/ftplugin/markdown.vim deleted file mode 100644 index a210b8b..0000000 --- a/vim/ftplugin/markdown.vim +++ /dev/null @@ -1,11 +0,0 @@ -" wrap at word breaks -setlocal linebreak - -" have broken lines indent! -setlocal breakindent - -" spell check -setlocal spell spelllang=en_us - -" Break at 80 -setlocal textwidth=80 diff --git a/vim/ftplugin/pod.vim b/vim/ftplugin/pod.vim deleted file mode 100644 index 1e3cd9b..0000000 --- a/vim/ftplugin/pod.vim +++ /dev/null @@ -1 +0,0 @@ -setlocal textwidth=80 diff --git a/vim/ftplugin/python.vim b/vim/ftplugin/python.vim deleted file mode 100644 index da21201..0000000 --- a/vim/ftplugin/python.vim +++ /dev/null @@ -1,10 +0,0 @@ -" set fold method to be indent based -" USAGE: -" KEY: no longer use zf#j or zf/ to create folds -" instead: -" zc -- close a fold by indent (at cursor until end indent) -" zo -- open a closed fold -setlocal foldmethod=indent - -" Set the local :make command to run flake8 -setlocal makeprg=flake8\ % diff --git a/vim/ftplugin/tex.vim b/vim/ftplugin/tex.vim deleted file mode 100644 index c681ff3..0000000 --- a/vim/ftplugin/tex.vim +++ /dev/null @@ -1,14 +0,0 @@ -" ignore the wrapped lines -noremap k gk -noremap j gj - -" spell check! -setlocal spell spelllang=en_us - -" soft word wrap should not break words -" NOTE: don't use listchars with this feature -setlocal linebreak -setlocal breakindent - -" Break at 80 -setlocal textwidth=80 diff --git a/vim/ftplugin/vader.vim b/vim/ftplugin/vader.vim deleted file mode 100644 index cc2136a..0000000 --- a/vim/ftplugin/vader.vim +++ /dev/null @@ -1,3 +0,0 @@ -" vader.vim is a Vim testing framework by Junegunn -" https://github.com/junegunn/vader.vim -set foldmethod=marker diff --git a/vim/ftplugin/vim.vim b/vim/ftplugin/vim.vim deleted file mode 100644 index c19ab13..0000000 --- a/vim/ftplugin/vim.vim +++ /dev/null @@ -1,21 +0,0 @@ -" Custom folding by expression to fold markers and functions - -let b:viml_fold_markers = split(&foldmarker, ',') - -function! VimLFoldByFunctionAndMarker(lnum) abort - let l = getline(a:lnum) - if l =~ '^\s*function!\? ' - return 'a1' - elseif l =~ '^\s*endfunction' - return 's1' - elseif l =~ b:viml_fold_markers[0] - return 'a1' - elseif l =~ b:viml_fold_markers[1] - return 's1' - else - return '=' - endif -endfunction - -setlocal foldmethod=expr -setlocal foldexpr=VimLFoldByFunctionAndMarker(v:lnum) diff --git a/vim/gvimrc b/vim/gvimrc deleted file mode 100644 index b8ec952..0000000 --- a/vim/gvimrc +++ /dev/null @@ -1,27 +0,0 @@ -" Disable visual bells -set noerrorbells visualbell t_vb= -autocmd GUIEnter * set visualbell t_vb= - -" Pretty printing -set printoptions=left:1in,right:1in,paper:letter -set printfont=Consolas:h11 - -" Minimal UI -set guioptions= " Don't show guioptions (toolbar, scrollbar,..) -set guicursor=a:blinkon0 " Don't blink the cursor (not my thang) - -" Font that doesn't hurt my eyes at a size depending on the screen -if has('gui_macvim') - set guifont=Inconsolata:h15 -elseif has('win32') || has('win64') - set guifont=Consolas:h11 -else - set guifont=Inconsolata\ 14 -end - -" Bigger size on startup -set lines=50 -set columns=100 - -" The pop-up asking if you want to reload forces mouse usage :O -set autoread diff --git a/vim/improved.vim b/vim/improved.vim deleted file mode 100644 index 6f1999c..0000000 --- a/vim/improved.vim +++ /dev/null @@ -1,141 +0,0 @@ -" .vim/improved.vim -- putting the IM in VIM - -" GENERAL EDITOR SETTINGS {{{ -" Try to be platform agnostic: -if has('win64') || has('win32') - let s:vimdir = expand($HOME . '/vimfiles') -else - let s:vimdir = expand($HOME . '/.vim') -endif - -" Line numbers on -- helpful for debugging, not needed in `vi` -set number - -" Faster grepping! (use ripgrep if available for :grep and :FZF) -if executable('rg') - set grepprg=rg\ --vimgrep\ --no-heading - set grepformat=%f:%l:%c:%m,%f:%l:%m - let $FZF_DEFAULT_COMMAND = 'rg --files --hidden --glob "!.git/*"' -endif - -" Persistent undo -if has('persistent_undo') && isdirectory(s:vimdir . '/undo') - exe 'set undodir='.s:vimdir.'/undo/' - set undofile " Do indeed create said files - set undolevels=1000 " Max # changes that can be undone - set undoreload=10000 " Saves undofile on reload (:e) if < 10k LOC -endif - -" Use ~/.vim/swp if avail (else .) for backup and swp files respectively -exe 'set backupdir='.s:vimdir.'/swp,.' -exe 'set directory='.s:vimdir.'/swp,.' -" }}} - -" PLUGIN RELATED SETTINGS {{{ -" Don't use powerline font in airline (not neces. installed) -let g:airline_powerline_fonts = 0 - -" This enables folding in the built in markdown ftplugin -let g:markdown_folding = 1 -let g:markdown_fenced_languages = ['sh', 'bash=sh', 'perl', 'python', 'vim'] - -" If using Dirvish, don't use netrw -if isdirectory(s:vimdir . '/pack/plugins/start/vim-dirvish/plugin') - " Dirvish #137 - let loaded_netrwPlugin = 1 -else - let g:netrw_banner=0 " disable banner - let g:netrw_liststyle=1 " details view -endif - -" Mojolicious syntax highlighting for Mojolicious::Lite -let mojo_highlight_data = 1 - -" git-messenger with popup windows is cool! -let g:git_messenger_always_into_popup = v:true -" }}} - -" COLORSCHEME {{{ -" Only gruv if you can handle it -" NOTE: for initial check, check $TERM, not &term, as nvim has &term=nvim -if (($TERM =~# '256color' && has("termguicolors")) || has('gui_running')) && - \ filereadable(s:vimdir . "/pack/mine/start/gruvbox/colors/gruvbox.vim") - - set termguicolors - colorscheme gruvbox - - " See :h xterm-true-color for tmux+termguicolors - if &term =~# '^\(tmux\|st\|screen\)' - let &t_8f = "\[38;2;%lu;%lu;%lum" - let &t_8b = "\[48;2;%lu;%lu;%lum" - endif - - set background=dark - - augroup CurLineToggle - autocmd! - autocmd InsertEnter,InsertLeave * set cul! - augroup END -else - " Can't handle the gruv - set background=light - colorscheme vc -endif -" }}} - -" KEY MAPPINGS {{{ -" set leader to be spacebar -let mapleader = " " - -"Map ctrl-i/j/k/h to switch between splits -nnoremap j -nnoremap k -nnoremap h -nnoremap l - -" Paste from clipboard without any formatting issues -nnoremap :set paste \| put + \| set nopaste - -" Clear trailing whitespace (through regexp) -nnoremap :call vimrc#CMDPreserve("%s/\\s\\+$//e") - -" edit in current buffer dir -nnoremap e :e %:h/ -nnoremap v :vsp %:h/ -nnoremap s :sp %:h/ - -" toggle color column (to ensure short lines) -nnoremap C vimrc#ToggleColorColumn() - -" 2 space / 4 space toggle -nnoremap 2 :setlocal softtabstop=2 shiftwidth=2 -nnoremap 4 :setlocal softtabstop=4 shiftwidth=4 - -" Clear that highlight! -nnoremap :nohlsearch - -" Get greppin quick! --> search word under cursor (escape # for VimL autoload) -nnoremap g :exe "grep " . substitute(expand(''), '#', '\\#', 'g') -nnoremap G :Ggrep! :copen - -" Toggle whitespace -nnoremap w :set list! - -" Yank entire file -nnoremap y :0,$y + - -" Edit vimrc -nnoremap V :edit $HOME/.vim/vimrc - -" From defaults.vim: breaks the undo chain so we can undo -inoremap u -" }}} - -" COMMANDS {{{ -command! CD exe 'cd ' . expand('%:h') -" }}} - -" Load optional config (in ~/.vim) -runtime! .vimrc.local - -" vim:fdm=marker:sts=4:sw=4 diff --git a/vim/pack/mine/start/gruvbox b/vim/pack/mine/start/gruvbox deleted file mode 160000 index 6c59bb5..0000000 --- a/vim/pack/mine/start/gruvbox +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 6c59bb5d72abcab0f22fc819793cf1f3b53d1336 diff --git a/vim/pack/plugins/start/gv.vim b/vim/pack/plugins/start/gv.vim deleted file mode 160000 index 023b315..0000000 --- a/vim/pack/plugins/start/gv.vim +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 023b315ea1fb92aba20c71ef54f806d2903cfc9e diff --git a/vim/pack/plugins/start/vim-commentary b/vim/pack/plugins/start/vim-commentary deleted file mode 160000 index 141d9d3..0000000 --- a/vim/pack/plugins/start/vim-commentary +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 141d9d32a9fb58fe474fcc89cd7221eb2dd57b3a diff --git a/vim/pack/plugins/start/vim-dirvish b/vim/pack/plugins/start/vim-dirvish deleted file mode 160000 index eba64ed..0000000 --- a/vim/pack/plugins/start/vim-dirvish +++ /dev/null @@ -1 +0,0 @@ -Subproject commit eba64ed111a3aab8121a0e5b6df62c6f19e05322 diff --git a/vim/pack/plugins/start/vim-fugitive b/vim/pack/plugins/start/vim-fugitive deleted file mode 160000 index 875a58c..0000000 --- a/vim/pack/plugins/start/vim-fugitive +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 875a58c2e1b2022fb806a40f75c5c7b0f34667eb diff --git a/vim/pack/plugins/start/vim-gitgutter b/vim/pack/plugins/start/vim-gitgutter deleted file mode 160000 index c75c83d..0000000 --- a/vim/pack/plugins/start/vim-gitgutter +++ /dev/null @@ -1 +0,0 @@ -Subproject commit c75c83df531881008f8cf903eab7cd68bc19ff7a diff --git a/vim/pack/plugins/start/vim-surround b/vim/pack/plugins/start/vim-surround deleted file mode 160000 index fab8621..0000000 --- a/vim/pack/plugins/start/vim-surround +++ /dev/null @@ -1 +0,0 @@ -Subproject commit fab8621670f71637e9960003af28365129b1dfd0 diff --git a/vim/swp/.gitkeep b/vim/swp/.gitkeep deleted file mode 100644 index e69de29..0000000 --- a/vim/swp/.gitkeep +++ /dev/null diff --git a/vim/syntax/python.vim b/vim/syntax/python.vim deleted file mode 100644 index 18539d9..0000000 --- a/vim/syntax/python.vim +++ /dev/null @@ -1,3 +0,0 @@ -" Highlight the self keyword -syn keyword pythonSelf self -highlight link pythonSelf GruvboxBlue diff --git a/vim/undo/.gitkeep b/vim/undo/.gitkeep deleted file mode 100644 index e69de29..0000000 --- a/vim/undo/.gitkeep +++ /dev/null diff --git a/vim/vimrc b/vim/vimrc deleted file mode 100644 index db89224..0000000 --- a/vim/vimrc +++ /dev/null @@ -1,28 +0,0 @@ -" .vimrc -- the bare necessities -filetype plugin indent on " Enable filetype plugins/indentation -syntax on " Syntax highlighting on -set softtabstop=4 " is 4 spaces (when expandtab set) -set shiftwidth=4 " >> will indent 4 spaces -set expandtab " Needed to replace with spaces -set autoindent " Indent carries over on new line -set smarttab " Use shiftwidth for and -set hlsearch " Highlight searches -set incsearch " Incrementally search -set backspace=indent,eol,start " Backspace should function as expected -set ttimeout " Timeout on esc keycodes -set ttimeoutlen=30 " Low timeout to avoid delay -set modelines=0 " Disable modelines for security -set history=10000 " Remember last 1000 :commands -set scrolloff=3 " Scroll at 3 rows from edge of screen -set wildmenu " Visual completion for command mode -set showcmd " Show the command being typed -set laststatus=2 " Always show the statusbar -set noequalalways " Don't resize split on open/close event -set listchars=tab:>-,trail:~,eol:$ " Nicer whitespace - -if v:progname =~# 'vim$' - runtime! improved.vim " put the IM in VIM -elseif has('packages') - set pp-=~/.vim - set pp-=~/.vim/after -endif diff --git a/zsh/vi_prompt_append.zsh b/zsh/vi_prompt_append.zsh deleted file mode 100644 index 6075d50..0000000 --- a/zsh/vi_prompt_append.zsh +++ /dev/null @@ -1,37 +0,0 @@ -# Vi Prompt Append! -# -# I like Vi(m) related things! I like Vi in my zsh, BUT, not knowing -# which mode (Normal/Insert) you are in can be damaging. SO, I created -# this little script to append an indicator (and change it) for any -# zsh theme! -# -# Assumes bindkey -v is on! -# -# USAGE: -# Source AFTER your theme! (so prompt isn't reset!) - -# First, the globals -VI_NORMAL_PROMPT="%{$fg_bold[yellow]%}[% N]% %{$reset_color%}" -VI_INSERT_PROMPT="%{$fg_bold[blue]%}[% I]% %{$reset_color%}" -VI_PROMPT_CHAR="$VI_INSERT_PROMPT" - -# Simple function to output the Vi prompt -vi_mode() { - local vi_mode_chars="${VI_PROMPT_CHAR}" - echo -n "$vi_mode_chars" -} - -# The magic is here -- append to PROMPT -# Note to self -- need '' around the vi_mode function -PROMPT='$(vi_mode)'"$PROMPT" - -# This function changes the prompt / resets it on Normal/Insert toggle -# Heavily inspired by Doug Black (https://dougblack.io/words/zsh-vi-mode.html) -function zle-line-init zle-keymap-select { - # for use in my custom vi prompt append - VI_PROMPT_CHAR="${${KEYMAP/vicmd/$VI_NORMAL_PROMPT}/(main|viins)/$VI_INSERT_PROMPT}" - zle reset-prompt -} - -zle -N zle-line-init -zle -N zle-keymap-select diff --git a/zsh/zshrc b/zsh/zshrc deleted file mode 100644 index 84d100f..0000000 --- a/zsh/zshrc +++ /dev/null @@ -1,66 +0,0 @@ -# Path to your oh-my-zsh installation. -export ZSH=$HOME/.oh-my-zsh - -# zsh theme -ZSH_THEME="refined" - -# Zsh plugins ( Example format: plugins=(rails git textmate ruby lighthouse) ) -# note: zsh-syntax must be last! -plugins=(git zsh-syntax-highlighting docker) - -source $ZSH/oh-my-zsh.sh - -export DEFAULT_USER="$(whoami)" - -# prevent zsh from renaming tmux windows -DISABLE_AUTO_TITLE="true" - -# use nvim as man pager / editor if available -if (( $+commands[nvim] )); then - export EDITOR="nvim" - export MANPAGER="nvim -c 'set ft=man' -" - alias vim='nvim' -else - export EDITOR="vim" -fi - -# 10ms for key sequences -KEYTIMEOUT=1 - -# vi keymap in terminal -bindkey -v - -# backspace works past insert mode location -bindkey '^?' backward-delete-char - -# ctrl-r starts searching history backward -bindkey '^r' history-incremental-search-backward - -# Indicate vi mode! -local VI_PROMPT_APPEND_FILE=~/.akarledots/zsh/vi_prompt_append.zsh -if [[ -f "$VI_PROMPT_APPEND_FILE" ]]; then - source "$VI_PROMPT_APPEND_FILE" -fi - -# alias for homebrew versions of things -# alias ctags='/usr/local/Cellar/ctags/5.8_1/bin/ctags' -# alias python python2 - -# other alias' -alias dps="docker ps -a" - -# ITALICS UPDATE: may break ssh? -if [ $TERM = 'xterm-256color-italic' ]; then - alias ssh="TERM='xterm-256color' ssh" - alias vsh="TERM='xterm-256color' vagrant ssh" -else - alias vsh="vagrant ssh" -fi - -alias vsus="vagrant suspend" -alias vup="vagrant up" - -# cd to a parent directory -function pcd { cd ${PWD%/$1/*}/$1; } - -[ -f ~/.fzf.zsh ] && source ~/.fzf.zsh -- libgit2 0.28.4