From 6af4ba943f6b73e31a0b2bd0262d953a2e954ddb Mon Sep 17 00:00:00 2001 From: Nicholas Van Doorn Date: Wed, 4 Aug 2021 18:12:54 -0700 Subject: Initial commit --- Afterglow.itermcolors | 213 +++++++++++++++++++++++++++++++++++++++ Brewfile | 269 ++++++++++++++++++++++++++++++++++++++++++++++++++ Caskfile | 25 +++++ README.md | 6 ++ bin/cfind | 3 + bin/convert-art | 5 + bin/dmg | 4 + bin/dns-flush | 3 + bin/fixup | 3 + bin/heroku-env-apply | 3 + bin/heroku-env-dump | 3 + bin/iso2wbfs | 161 ++++++++++++++++++++++++++++++ bin/jdiff | 3 + bin/kabab | 3 + bin/killer | 3 + bin/rgr | 3 + bin/smell-test | 5 + bin/strip | 3 + bin/sync-ipod | 8 ++ bin/sync-music | 3 + bin/ticket | 3 + bin/togif | 13 +++ bin/wit | Bin 0 -> 5013112 bytes bin/write-image | 4 + commands.zsh | 97 ++++++++++++++++++ git-authors.txt | 15 +++ git.zsh | 58 +++++++++++ gitattributes | 31 ++++++ gitconfig | 39 ++++++++ gitconfig_personal | 4 + gitconfig_work | 4 + gitignore_global | 14 +++ hosts | 24 +++++ init.vim | 182 ++++++++++++++++++++++++++++++++++ linky.sh | 9 ++ mac-install.sh | 33 +++++++ mpd.conf | 33 +++++++ multi-branch.zsh | 57 +++++++++++ pairing.zsh | 23 +++++ patched-font.otf | Bin 0 -> 973196 bytes rsync-ignore.txt | 5 + tmux.conf | 66 +++++++++++++ vimrc | 175 ++++++++++++++++++++++++++++++++ work.zsh | 6 ++ zshrc | 67 +++++++++++++ 45 files changed, 1691 insertions(+) create mode 100644 Afterglow.itermcolors create mode 100644 Brewfile create mode 100644 Caskfile create mode 100644 README.md create mode 100755 bin/cfind create mode 100755 bin/convert-art create mode 100755 bin/dmg create mode 100755 bin/dns-flush create mode 100755 bin/fixup create mode 100755 bin/heroku-env-apply create mode 100755 bin/heroku-env-dump create mode 100755 bin/iso2wbfs create mode 100755 bin/jdiff create mode 100755 bin/kabab create mode 100755 bin/killer create mode 100755 bin/rgr create mode 100755 bin/smell-test create mode 100755 bin/strip create mode 100755 bin/sync-ipod create mode 100755 bin/sync-music create mode 100755 bin/ticket create mode 100755 bin/togif create mode 100755 bin/wit create mode 100755 bin/write-image create mode 100644 commands.zsh create mode 100644 git-authors.txt create mode 100644 git.zsh create mode 100644 gitattributes create mode 100644 gitconfig create mode 100644 gitconfig_personal create mode 100644 gitconfig_work create mode 100644 gitignore_global create mode 100644 hosts create mode 100644 init.vim create mode 100755 linky.sh create mode 100755 mac-install.sh create mode 100644 mpd.conf create mode 100644 multi-branch.zsh create mode 100644 pairing.zsh create mode 100644 patched-font.otf create mode 100644 rsync-ignore.txt create mode 100644 tmux.conf create mode 100644 vimrc create mode 100644 work.zsh create mode 100644 zshrc diff --git a/Afterglow.itermcolors b/Afterglow.itermcolors new file mode 100644 index 0000000..bd63a99 --- /dev/null +++ b/Afterglow.itermcolors @@ -0,0 +1,213 @@ + + + + + Ansi 0 Color + + Blue Component + 0.08235294371843338 + Green Component + 0.08235294371843338 + Red Component + 0.08235294371843338 + + Ansi 1 Color + + Blue Component + 0.2588235438 + Green Component + 0.25490197539999998 + Red Component + 0.67450982329999998 + + Ansi 10 Color + + Blue Component + 0.31444666754949363 + Green Component + 0.55576569570135748 + Red Component + 0.49473804391474724 + + Ansi 11 Color + + Blue Component + 0.4039215686 + Green Component + 0.70980392160000005 + Red Component + 0.8980392157 + + Ansi 12 Color + + Blue Component + 0.73333333333333328 + Green Component + 0.59999999999999998 + Red Component + 0.42352941176470588 + + Ansi 13 Color + + Blue Component + 0.5234466981 + Green Component + 0.30697798580000002 + Red Component + 0.62333851809999996 + + Ansi 14 Color + + Blue Component + 0.8118151991 + Green Component + 0.83853216239999995 + Red Component + 0.49031879989999999 + + Ansi 15 Color + + Blue Component + 0.96078431606292725 + Green Component + 0.96078431606292725 + Red Component + 0.96078431606292725 + + Ansi 2 Color + + Blue Component + 0.3144466675 + Green Component + 0.55576569570000001 + Red Component + 0.49473804389999998 + + Ansi 3 Color + + Blue Component + 0.40392156862745099 + Green Component + 0.70980392156862748 + Red Component + 0.89803921568627454 + + Ansi 4 Color + + Blue Component + 0.73333333329999995 + Green Component + 0.59999999999999998 + Red Component + 0.42352941179999998 + + Ansi 5 Color + + Blue Component + 0.52344669809931299 + Green Component + 0.30697798579568808 + Red Component + 0.62333851809954743 + + Ansi 6 Color + + Blue Component + 0.8118151991 + Green Component + 0.83853216239999995 + Red Component + 0.49031879989999999 + + Ansi 7 Color + + Blue Component + 0.81568628549575806 + Green Component + 0.81568628549575806 + Red Component + 0.81568628549575806 + + Ansi 8 Color + + Blue Component + 0.31372550129890442 + Green Component + 0.31372550129890442 + Red Component + 0.31372550129890442 + + Ansi 9 Color + + Blue Component + 0.2588235438 + Green Component + 0.25490197539999998 + Red Component + 0.67450982329999998 + + Background Color + + Blue Component + 0.1283406391402715 + Green Component + 0.1283406391402715 + Red Component + 0.1283406391402715 + + Bold Color + + Blue Component + 0.81568628549575806 + Green Component + 0.81568628549575806 + Red Component + 0.81568628549575806 + + Cursor Color + + Blue Component + 0.81568628549575806 + Green Component + 0.81568628549575806 + Red Component + 0.81568628549575806 + + Cursor Text Color + + Blue Component + 0.08235294371843338 + Green Component + 0.08235294371843338 + Red Component + 0.08235294371843338 + + Foreground Color + + Blue Component + 0.81568628549575806 + Green Component + 0.81568628549575806 + Red Component + 0.81568628549575806 + + Selected Text Color + + Blue Component + 0.81568628549575806 + Green Component + 0.81568628549575806 + Red Component + 0.81568628549575806 + + Selection Color + + Blue Component + 0.18823529779911041 + Green Component + 0.18823529779911041 + Red Component + 0.18823529779911041 + + + diff --git a/Brewfile b/Brewfile new file mode 100644 index 0000000..d9f4e75 --- /dev/null +++ b/Brewfile @@ -0,0 +1,269 @@ +ack +aom +assimp +autoconf +automake +avrdude +awscli +bat +bdw-gc +berkeley-db +bison +boost +bootloadhid +brotli +c-ares +cairo +ccat +chruby +clang-format +cmake +coreutils +cowsay +cscope +ctags +dav1d +dbus +dfu-programmer +dfu-util +direnv +docbook +docbook-xsl +docker +dos2unix +double-conversion +emacs +entr +erlang +eth-p/software/bat-extras +eth-p/software/bat-extras-batdiff +eth-p/software/bat-extras-batgrep +eth-p/software/bat-extras-batman +eth-p/software/bat-extras-batpipe +eth-p/software/bat-extras-batwatch +eth-p/software/bat-extras-prettybat +expat +faad2 +ffmpeg +fftw +findutils +flac +fluid-synth +fnm +fontconfig +fortune +freetype +frei0r +fribidi +fzf +fzy +gawk +gcc +gd +gdbm +gdk-pixbuf +gettext +gh +ghostscript +giflib +gifsicle +git +git-delta +glib +gmp +gnu-getopt +gnu-indent +gnu-sed +gnu-tar +gnutls +go +gobject-introspection +graphite2 +graphviz +grep +gts +guile +harfbuzz +hidapi +highlight +htop +hub +hwloc +icu4c +ilmbase +imagemagick +imath +irssi +isl +jansson +jasper +jbig2dec +jemalloc +jpeg +jq +krb5 +lame +leptonica +libao +libass +libb2 +libbluray +libde265 +libelf +libev +libevent +libffi +libftdi0 +libgcrypt +libgpg-error +libheif +libhid +libid3tag +libidn +libidn2 +liblqr +libmpc +libmpdclient +libnfs +libogg +libomp +libpng +libpq +libproxy +libpthread-stubs +librsvg +libsamplerate +libshout +libsndfile +libsodium +libsoxr +libssh2 +libtasn1 +libtermkey +libtiff +libtool +libunistring +libupnp +libusb +libusb-compat +libuv +libvidstab +libvorbis +libvpx +libvterm +libx11 +libxau +libxcb +libxdmcp +libxext +libxrender +libyaml +little-cms2 +lolcat +lsd +lua +luajit +luajit-openresty +luv +lz4 +lzo +m4 +mas +mdr +meson +mpd +mpdecimal +mpfr +msgpack +mysql +ncmpcpp +ncurses +neofetch +neovim +netpbm +nettle +nghttp2 +ninja +node +nspr +nss +oniguruma +open-mpi +opencore-amr +openexr +openjdk +openjpeg +openssl@1.1 +opus +osx-cross/arm/arm-gcc-bin@10 +osx-cross/arm/arm-gcc-bin@8 +osx-cross/avr/avr-binutils +osx-cross/avr/avr-gcc@8 +osx-cross/avr/avr-gcc@9 +p11-kit +pango +pcre +pcre2 +perl +pixman +pkg-config +poppler +popt +portaudio +postgresql +prettier +protobuf +pyenv +python@3.9 +qmk/qmk/mdloader +qmk/qmk/qmk +qt +ranger +rav1e +readline +redis +ripgrep +rsync +rtmpdump +rubberband +ruby +ruby-install +rustup-init +scdoc +screenresolution +sdl2 +shared-mime-info +shfmt +six +snappy +speex +sqlite +srt +taglib +tcl-tk +teensy_loader_cli +tesseract +the_silver_searcher +theora +tmux +trash +tree +tree-sitter +unbound +unibilium +utf8proc +vim +webp +wget +wxwidgets +x264 +x265 +xmlto +xorgproto +xvid +xxhash +xz +zeromq +zimg +zsh +zstd diff --git a/Caskfile b/Caskfile new file mode 100644 index 0000000..8d1e743 --- /dev/null +++ b/Caskfile @@ -0,0 +1,25 @@ +android-sdk +appcleaner +deluge +discord +docker +firefox-developer-edition +gimp +github +google-chrome +gpg-suite +iina +imageoptim +insomnia +iterm2 +keepassxc +ngrok +nordvpn +notion +qmk-toolbox +rectangle +sketch +slack +tuple +vscodium +wkhtmltopdf diff --git a/README.md b/README.md new file mode 100644 index 0000000..8f0dd8a --- /dev/null +++ b/README.md @@ -0,0 +1,6 @@ +# totfiles + +These are my dotfiles. They help me write bugs faster. + +## TODO +1. Setup `ctags` and `cscope` diff --git a/bin/cfind b/bin/cfind new file mode 100755 index 0000000..c8814bf --- /dev/null +++ b/bin/cfind @@ -0,0 +1,3 @@ +#!/usr/bin/env bash + +git show $(git log --pretty=oneline --abbrev-commit | fzy | gawk '{print$1}') diff --git a/bin/convert-art b/bin/convert-art new file mode 100755 index 0000000..4f72351 --- /dev/null +++ b/bin/convert-art @@ -0,0 +1,5 @@ +#!/usr/bin/env bash + +gfind "$1" -iname "cover.jpg" -o -iname "cover.gif" -o -iname "cover.png" | while read file + do convert "$file" -thumbnail 130x130 "${file%/*}"/cover.bmp +done diff --git a/bin/dmg b/bin/dmg new file mode 100755 index 0000000..b30c302 --- /dev/null +++ b/bin/dmg @@ -0,0 +1,4 @@ +#!/usr/bin/env bash + +hdiutil create -fs HFS+ -srcfolder "$1" -volname "$2" "$2.dmg" + diff --git a/bin/dns-flush b/bin/dns-flush new file mode 100755 index 0000000..438d73d --- /dev/null +++ b/bin/dns-flush @@ -0,0 +1,3 @@ +#!/usr/bin/env bash + +sudo killall -HUP mDNSResponder diff --git a/bin/fixup b/bin/fixup new file mode 100755 index 0000000..c0f0a53 --- /dev/null +++ b/bin/fixup @@ -0,0 +1,3 @@ +#!/usr/bin/env bash + +git commit --fixup=$(git log --pretty=oneline --abbrev-commit | fzy | gawk '{print$1}') diff --git a/bin/heroku-env-apply b/bin/heroku-env-apply new file mode 100755 index 0000000..067021d --- /dev/null +++ b/bin/heroku-env-apply @@ -0,0 +1,3 @@ +#!/usr/bin/env bash + +cat $2 | tr '\n' ' ' | xargs heroku config:set -a $1 diff --git a/bin/heroku-env-dump b/bin/heroku-env-dump new file mode 100755 index 0000000..dafb7ed --- /dev/null +++ b/bin/heroku-env-dump @@ -0,0 +1,3 @@ +#!/usr/bin/env bash + +heroku config -s -a $1 > $2 diff --git a/bin/iso2wbfs b/bin/iso2wbfs new file mode 100755 index 0000000..59b0eed --- /dev/null +++ b/bin/iso2wbfs @@ -0,0 +1,161 @@ +#!/bin/bash +#=============================================================================== +# +# FILE: iso2wbfs +# +# USAGE: ./iso2wbfs [option] FILE... [wbfs directory] +# +# DESCRIPTION: Uses wit to convert one or more Wii ISO into a WBFS file +# properly named for use on non-WBFS partitions. +# +# OPTIONS: --- +# REQUIREMENTS: WIT ( http://wit.wiimm.de/wit/ ) +# BUGS: --- +# NOTES: --- +# AUTHOR: Timothy Caraballo, openback@gmail.com +# COMPANY: Pixelpod International, Inc. +# VERSION: 1.04 +# CREATED: 2010-08-10 08:31:01 AM EST +#=============================================================================== + +#=============================================================================== +# Script variables +#=============================================================================== +# The regex to grab info from the iso +REG="^([[:alnum:]]+)[[:space:]]+([[:digit:]]+)[[:space:]]+([[:alpha:]]{3,4})[[:space:]]+(.+)$" +NOCLOBBER=1 +NAMINGSTYLE=1 +NAMINGSTYLESET=0 +eval OUTPUTDIR=\$$# + +#=============================================================================== +# Prints usage info +#=============================================================================== +function USAGE () { +echo "" +echo "USAGE: " +echo " iso2wbfs [option] FILE... [wbfs_directory]" +echo "" +echo "OPTIONS:" +echo " -f Force overwrite of existing files" +echo " -v Version information" +echo " -h This usage information" +echo " NAMING STYLES:" +echo " -1 /GAMEID.wbfs (default)" +echo " -2 /GAMEID_Game title.wbfs" +echo " -3 /Game title [GAMEID].wbfs" +echo " -4 /GAMEID/GAMEID.wbfs" +echo " -5 /GAMEID_Game title/GAMEID.wbfs" +echo " -6 /Game title [GAMEID]/GAMEID.wbfs" +echo "" +exit $E_OPTERROR # Exit and explain usage, if no argument(s) given. +} + +#=============================================================================== +# Main routine +#=============================================================================== + +# Set our option variables +while getopts ":123456fhv?" opt +do + case $opt in + [1-6]) + if (( $NAMINGSTYLESET == 1 )); then + echo "Error: You may only specify one naming convention" + USAGE + exit 1 + else + NAMINGSTYLESET=1 + NAMINGSTYLE=$opt + fi + ;; + f) + NOCLOBBER=0 + ;; + h) + USAGE + exit 0 + ;; + v) + echo "`basename $0` 1.04 (2011-08-11)" + exit 0 + ;; + ?) + echo "" + echo "Invalid option: -$OPTARG" >&2 + USAGE + exit 1 + ;; + esac +done +shift $(($OPTIND - 1)) + +# Is the last argument a directory? +if [[ -d "$OUTPUTDIR" ]]; then + HASDIR=1 +else + # It isn't a directory, so let's make sure it's a file and not a mistake + if [[ -f "$OUTPUTDIR" ]]; then + OUTPUTDIR=. + HASDIR=0 + else + echo "Error: $OUTPUTDIR was not found." + exit 1 + fi +fi + +# Do we have an iso to work with? +(( $# )) || USAGE + +while (( $# > $HASDIR )) +do + ISO=$1 + shift + + # Check if the ISO is a valid Wii disc + if [[ `wit ll -H "$ISO"` =~ $REG ]]; then + # Grab the info from the output + WIITITLE=`echo ${BASH_REMATCH[4]}|tr -d '\n'|tr '[\:\*]' '_'` + GAMEID=${BASH_REMATCH[1]} + + case $NAMINGSTYLE in + 1) + WBFSFILE=$GAMEID.wbfs + ;; + 2) + WBFSFILE=${GAMEID}_$WIITITLE.wbfs + ;; + 3) + WBFSFILE=$WIITITLE\ \[$GAMEID\].wbfs + ;; + 4) + WBFSFILE=$GAMEID/$GAMEID.wbfs + ;; + 5) + WBFSFILE=${GAMEID}_$WIITITLE/$GAMEID.wbfs + ;; + 6) + WBFSFILE=${WIITITLE}\ \[$GAMEID\]/$GAMEID.wbfs + ;; + esac + + WBFSFILE=$OUTPUTDIR/$WBFSFILE + + if [[ -f "$WBFSFILE" ]]; then + if (( $NOCLOBBER )); then + echo "Error: $WBFSFILE exists." + else + rm "$WBFSFILE" || exit 1 + fi + fi + + # Make the destination folder if it doesn't exist + mkdir -p "`dirname "$WBFSFILE"`" || exit 1 + + # Now just run the copy + wit -BP COPY "$ISO" "$WBFSFILE" + else + echo "Error parsing $ISO" + exit 1 + fi +done \ No newline at end of file diff --git a/bin/jdiff b/bin/jdiff new file mode 100755 index 0000000..c7eb308 --- /dev/null +++ b/bin/jdiff @@ -0,0 +1,3 @@ +#!/usr/bin/env bash + +vimdiff <(jq -S . $1) <(jq -S . $2) diff --git a/bin/kabab b/bin/kabab new file mode 100755 index 0000000..f3eee6b --- /dev/null +++ b/bin/kabab @@ -0,0 +1,3 @@ +#!/usr/bin/env ruby + +puts STDIN.read.split(" ").join("-").downcase diff --git a/bin/killer b/bin/killer new file mode 100755 index 0000000..8f3cfdb --- /dev/null +++ b/bin/killer @@ -0,0 +1,3 @@ +#!/usr/bin/env bash + +kill -9 $(ps aux | fzy | gawk '{print$2}') diff --git a/bin/rgr b/bin/rgr new file mode 100755 index 0000000..a7cd7c0 --- /dev/null +++ b/bin/rgr @@ -0,0 +1,3 @@ +#!/usr/bin/env bash + +rg $1 --files-with-matches -0 | xargs -0 gsed -i "s/$1/$2/g" diff --git a/bin/smell-test b/bin/smell-test new file mode 100755 index 0000000..8916180 --- /dev/null +++ b/bin/smell-test @@ -0,0 +1,5 @@ +#!/usr/bin/env bash + +ag 'binding.pry' . +ag 'debugger' . +ag 'console.log' . diff --git a/bin/strip b/bin/strip new file mode 100755 index 0000000..380c767 --- /dev/null +++ b/bin/strip @@ -0,0 +1,3 @@ +#!/usr/bin/env ruby + +puts ARGV.join(" ").split("#").first diff --git a/bin/sync-ipod b/bin/sync-ipod new file mode 100755 index 0000000..e485ab3 --- /dev/null +++ b/bin/sync-ipod @@ -0,0 +1,8 @@ +#!/usr/bin/env bash + +# Sync the files. +rsync -uva --ignore-existing "/Volumes/media1/lossless" "/Volumes/IPOD 1/" +# Convert the album art to a format Rockbox likes. +# convert-art "/Volumes/IPOD 1/lossless" +# Delete the originals so Rockbox doesn't try and load them. +# rm -rf "/Volumes/IPOD 1/lossless/**/*.jpg" diff --git a/bin/sync-music b/bin/sync-music new file mode 100755 index 0000000..8adeb69 --- /dev/null +++ b/bin/sync-music @@ -0,0 +1,3 @@ +#!/usr/bin/env bash + +rsync -uva --ignore-existing ~/personal/lossless "/Volumes/media1/" diff --git a/bin/ticket b/bin/ticket new file mode 100755 index 0000000..82b1a1a --- /dev/null +++ b/bin/ticket @@ -0,0 +1,3 @@ +#!/usr/bin/env bash + +cat .tickets.csv | fzy | gawk -F, '{print $1}' diff --git a/bin/togif b/bin/togif new file mode 100755 index 0000000..02bd824 --- /dev/null +++ b/bin/togif @@ -0,0 +1,13 @@ +#!/usr/bin/env zsh +if [ "$#" -ne 3 ]; then + echo "Usage: togif \n" + echo "Example with 500px width and auto height:\n" + echo " \$ togif myinput.mov myoutput.gif 500:-1" + exit -1 +fi + +TEMP_FOLDER=/tmp/gifconvert-$(date) +mkdir $TEMP_FOLDER +ffmpeg -i $1 -vf scale=$3 -r 10 $TEMP_FOLDER/ffout%3d.png +convert -delay 8 -loop 0 $TEMP_FOLDER/ffout*.png $2 +rm -rf $TEMP_FOLDER diff --git a/bin/wit b/bin/wit new file mode 100755 index 0000000..3644b3e Binary files /dev/null and b/bin/wit differ diff --git a/bin/write-image b/bin/write-image new file mode 100755 index 0000000..0091580 --- /dev/null +++ b/bin/write-image @@ -0,0 +1,4 @@ +#!/usr/bin/env bash + +# Make sure you have GNU dd as it supports much larger block sizes +sudo gdd if=$1 of=$2 bs=4M status=progress conv=fsync diff --git a/commands.zsh b/commands.zsh new file mode 100644 index 0000000..2e1ec76 --- /dev/null +++ b/commands.zsh @@ -0,0 +1,97 @@ +alias vim=nvim +alias vi=nvim +alias v=nvim +alias vl="VIM_THEME=PaperColor VIM_AIRLINE_THEME=papercolor VIM_BACKGROUND=light v" +alias g=git +alias cat=bat +alias b=bat +alias man=batman +alias c=clear +alias e=exit +alias rm=trash +alias bx='bundle exec' +alias bxr='bx rake' +alias s='bx rspec' +alias ls='lsd -1' +alias r='bin/rails' +alias leaky="pkill -9 -f 'rb-fsevent|rails|puma|node'" +alias awake="sudo pmset -a sleep 0; sudo pmset -a hibernatemode 0; sudo pmset -a disablesleep 1;" +alias sleepy="sudo pmset -a sleep 1; sudo pmset -a hibernatemode 25; sudo pmset -a disablesleep 0;" + +function peek() { + cat $(need) +} + +function thisruby() { + chruby $(cat .ruby-version) +} + +function vls() { + vl $(need) +} + +function vg() { + vim -c "G" +} + +function vs() { + vim $(need) +} + +function vr() { + vim -c Ranger +} + +function ss() { + bundle exec rspec $(need | tee .spec-history) +} + +function ssr() { + bundle exec rspec $(cat .spec-history) +} + +function need() { + rg . -l | fzy +} + +function dig() { + rg . | fzy -l 20 | gawk '{split($0, a, ":"); print a[1]}' +} + +function vd() { + v $(dig) +} + +function dbup() { + pg_ctl -D /usr/local/var/postgres start + redis-server /usr/local/etc/redis.conf --daemonize yes +} + +# TODO stop redis +function dbdown() { + pg_ctl -D /usr/local/var/postgres stop +} + +function smol() { + ffmpeg -i $1 -vcodec libx264 -pix_fmt yuv420p -profile:v baseline -level 3 $2 +} + +function spacify() { + tr '\n' ' ' < $1 +} + +function get_rake_task() { + strip $(bundle exec rake -T | fzy) +} + +function rakey() { + bundle exec $(get_rake_task | tee .rake-history) +} + +function rake_replay() { + bundle exec $(cat .rake-history) +} + +function again() { + $(history -n 1000 | uniq | fzy) +} diff --git a/git-authors.txt b/git-authors.txt new file mode 100644 index 0000000..a940eaf --- /dev/null +++ b/git-authors.txt @@ -0,0 +1,15 @@ +Adam Mueller +Alistair Norman +Jared Norman +Noah Silvera +Graham Bouvier +Madeline Collier +Benjamin Willems +Mike Conlin +Chris Todorov +Alex Blackie +Kendra Chateau +Sam Lee +Sofia Besenski +Mark Zsombor +Senem Soy diff --git a/git.zsh b/git.zsh new file mode 100644 index 0000000..58aa1a4 --- /dev/null +++ b/git.zsh @@ -0,0 +1,58 @@ +alias gs='git status' +alias gsh='git status ./' +alias gd='git diff' +alias gdc='git diff --cached' +alias gdch='git diff --cached ./' +alias gdh='git diff ./' +alias gac='git add . && git commit' +alias ga='git add' +alias gc='git commit' +alias gpc='git commit -t $GIT_AUTHORS_FILE' +alias gcm='gc -m' +alias gpo='git push origin' +alias gpu='git pull' +alias gpuo='git pull origin master' +alias gp='git push' +alias gr='git reset' +alias grh='git reset --hard' +alias gb='git branch' +alias gch='git checkout' +alias grf='git checkout --' +alias grb='git rebase' +alias patchy='git add -p' +alias stash='git stash' +alias poppy='stash pop' +alias gcat='gc --amend' +alias ok='grb --continue' +alias live='gpo $(active_branch) --force-with-lease' +alias dirty_rebase='stash && grbi && poppy' +alias gsch='gch $(g branch | fzy)' +alias pr='gd master HEAD' +alias changelist='git diff-tree --no-commit-id --name-only -r' +alias glog='v -c "Gclog -100"' +alias scrubby='g clean -fd' +alias grecent='git branch --sort=-committerdate --format="%(committerdate:relative)%09%(refname:short)"' + +function gnu () { + git checkout -b $(echo $@ | kabab) +} + +function gblame () { + v $1 -c Gblame +} + +function sblame () { + v $(need) -c Gblame +} + +function quick_fix () { + stash && gch master && gnu $1 && poppy +} + +function active_branch () { + git rev-parse --abbrev-ref HEAD +} + +function grbi () { + git rebase -i --autosquash "HEAD~${1:-12}" +} diff --git a/gitattributes b/gitattributes new file mode 100644 index 0000000..c7be8d9 --- /dev/null +++ b/gitattributes @@ -0,0 +1,31 @@ +*_spec.rb diff=rspec +*.erb diff=html + +# https://gist.github.com/tekin/12500956bd56784728e490d8cef9cb81 + +*.c diff=cpp +*.h diff=cpp +*.c++ diff=cpp +*.h++ diff=cpp +*.cpp diff=cpp +*.hpp diff=cpp +*.cc diff=cpp +*.hh diff=cpp +*.m diff=objc +*.mm diff=objc +*.cs diff=csharp +*.css diff=css +*.html diff=html +*.xhtml diff=html +*.ex diff=elixir +*.exs diff=elixir +*.go diff=golang +*.php diff=php +*.pl diff=perl +*.py diff=python +*.md diff=markdown +*.rb diff=ruby +*.rake diff=ruby +*.rs diff=rust +*.lisp diff=lisp +*.el diff=lisp diff --git a/gitconfig b/gitconfig new file mode 100644 index 0000000..2ac3fa6 --- /dev/null +++ b/gitconfig @@ -0,0 +1,39 @@ +[includeIf "gitdir:~/personal/"] + path = ~/.gitconfig_personal +[includeIf "gitdir:~/work/"] + path = ~/.gitconfig_work + +[core] + excludesfile = ~/.gitignore_global + attributesfile = ~/.gitattributes + pager = bat +[merge] + tool = vimdiff + conflictstyle = diff3 +[pull] + rebase = true + ff = only +[mergetool] + path = nvim +[color] + ui = auto +[credential] + helper = store +[filter "lfs"] + clean = git-lfs clean -- %f + smudge = git-lfs smudge -- %f + process = git-lfs filter-process + required = true +[commit] + gpgSign = true + verbose = true +[gpg] + program = /usr/local/MacGPG2/bin/gpg2 + +[diff "rspec"] + xfuncname = "^[ \t]*((RSpec|describe|context|it|before|after|around|feature|scenario)[ \t].*)$" +[user] + name = Nicholas Van Doorn + email = vandoorn.nick@gmail.com +[init] + defaultBranch = main diff --git a/gitconfig_personal b/gitconfig_personal new file mode 100644 index 0000000..c74f387 --- /dev/null +++ b/gitconfig_personal @@ -0,0 +1,4 @@ + [user] + email = vandoorn.nick@gmail.com + name = Nick Van Doorn + signingkey = EA91B002A8F4238E diff --git a/gitconfig_work b/gitconfig_work new file mode 100644 index 0000000..eb2f9a0 --- /dev/null +++ b/gitconfig_work @@ -0,0 +1,4 @@ + [user] + email = nick@super.gd + name = Nick Van Doorn + signingkey = EA91B002A8F4238E diff --git a/gitignore_global b/gitignore_global new file mode 100644 index 0000000..48fa986 --- /dev/null +++ b/gitignore_global @@ -0,0 +1,14 @@ +.DS_Store +.git-branch-stack.txt +.git-commit-authors.txt +.fixstack.txt +*.swp +bundle +*.out +*.db +.spec-history +.rake-history +.tickets* +.bundle +env +node_modules diff --git a/hosts b/hosts new file mode 100644 index 0000000..32ee152 --- /dev/null +++ b/hosts @@ -0,0 +1,24 @@ +## +# Host Database +# +# localhost is used to configure the loopback interface +# when the system is booting. Do not change this entry. +## +127.0.0.1 localhost +255.255.255.255 broadcasthost +::1 localhost + +# Being productive is important +# but also hard +127.0.0.1 twitter.com +127.0.0.1 api.twitter.com +127.0.0.1 reddit.com +127.0.0.1 news.ycombinator.com + +# I don't even use these sites but their +# reach is way too big +127.0.0.1 instagram.com +127.0.0.1 www.instagram.com +127.0.0.1 linkedin.com +127.0.0.1 facebook.com +127.0.0.1 www.facebook.com diff --git a/init.vim b/init.vim new file mode 100644 index 0000000..3be6f53 --- /dev/null +++ b/init.vim @@ -0,0 +1,182 @@ +function! BuildComposer(info) + if a:info.status != 'unchanged' || a:info.force + if has('nvim') + !cargo build --release + else + !cargo build --release --no-default-features --features json-rpc + endif + endif +endfunction + +if (has("termguicolors")) + set termguicolors +endif + +call plug#begin('~/.local/share/nvim/plugged') + +" Pick a theme, any theme, really +Plug 'NLKNguyen/papercolor-theme' +Plug 'danilo-augusto/vim-afterglow' +Plug 'altercation/vim-colors-solarized' +Plug 'flazz/vim-colorschemes' +Plug 'morhetz/gruvbox' +Plug 'mhartington/oceanic-next' +Plug 'joshdick/onedark.vim' + +" Syntax support +Plug 'euclio/vim-markdown-composer', { 'do': function('BuildComposer') } +Plug 'elixir-editors/vim-elixir' +Plug 'jason0x43/vim-js-indent' +Plug 'leafgarland/typescript-vim' +Plug 'peitalin/vim-jsx-typescript' +Plug 'mustache/vim-mustache-handlebars' +Plug 'mxw/vim-jsx' +Plug 'pangloss/vim-javascript' +Plug 'rust-lang/rust.vim' +Plug 'vim-ruby/vim-ruby' +Plug 'styled-components/vim-styled-components', { 'branch': 'main' } +Plug 'kchmck/vim-coffee-script' + +" Extensions +" Chuch of tpope +Plug 'tpope/vim-endwise' +Plug 'tpope/vim-dispatch' +Plug 'tpope/vim-commentary' +Plug 'tpope/vim-surround' +Plug 'tpope/vim-fugitive' +Plug 'tpope/vim-projectionist' + +Plug 'thoughtbot/vim-rspec' +Plug 'sjl/splice.vim' +Plug 'srstevenson/vim-picker' +Plug 'scrooloose/nerdtree' +Plug 'francoiscabrol/ranger.vim' +Plug 'wellle/targets.vim' +Plug 'bkad/CamelCaseMotion' +Plug 'ConradIrwin/vim-bracketed-paste' +Plug 'vim-airline/vim-airline' +Plug 'vim-airline/vim-airline-themes' +Plug 'airblade/vim-gitgutter' +Plug 'mileszs/ack.vim' +Plug 'preservim/tagbar' +Plug 'ntpeters/vim-better-whitespace' + +call plug#end() + +" General config +syntax enable +if $VIM_BACKGROUND == 'light' + set background=light +endif +if $VIM_BACKGROUND == 'dark' + set background=dark +endif +set shell=$SHELL +set bs=2 +set tabstop=2 +set foldmethod=syntax +set foldlevelstart=99 +set expandtab +set shiftwidth=2 +set softtabstop=2 +set ai +set number +set relativenumber +set mouse=a +filetype plugin on +runtime macros/matchit.vim + +set grepprg=rg\ --vimgrep\ --no-heading +set grepformat=%f:%l:%c:%m,%f:%l:%m +let g:ackprg = 'rg --vimgrep --no-heading' + +" Shorthand commands +cnoreabbrev Spec Dispatch bundle exec rspec % + +" Key bindings +let mapleader = "\" +nnoremap ; : +nnoremap : ; + +let g:rspec_command = "Dispatch bundle exec rspec {spec}" + +" Roll yur own tpope +nnoremap } :set spell +nnoremap { :set spell& +nnoremap ] :cnext +nnoremap [ :cprev +nnoremap r :Ranger +nnoremap n :NERDTree % +nnoremap s :w :call RunNearestSpec() +nnoremap ss :w :call RunCurrentSpecFile() +nnoremap b :Git blame +nnoremap g :G +nnoremap c :Git commit +nnoremap / :noh +nnoremap x :PickerSplit +nnoremap p :PickerEdit +nnoremap t :PickerTabedit +nnoremap v :PickerVsplit +nnoremap u :PickerTag +nnoremap w :TagbarToggle +nnoremap h h +nnoremap j j +nnoremap k k +nnoremap l l +nnoremap h 20< +nnoremap l 20> +nnoremap j 20+ +nnoremap k 20- +nnoremap :tabn +nnoremap :tabp + +map w CamelCaseMotion_w +map b CamelCaseMotion_b +map e CamelCaseMotion_e +map ge CamelCaseMotion_ge +sunmap w +sunmap b +sunmap e +sunmap ge + +let g:picker_custom_find_executable = 'rg' +let g:picker_custom_find_flags = '. -l' + +" Theme +colorscheme $VIM_THEME +let g:airline_powerline_fonts = 1 +let g:airline_theme=$VIM_AIRLINE_THEME +let g:airline#extensions#tabline#enabled = 1 +let g:airline#extensions#tabline#formatter = 'unique_tail' +let g:airline#extensions#tabline#show_buffers = 0 +let g:airline#extensions#tabline#show_tab_nr = 0 +let g:airline#extensions#tabline#show_tab_type = 0 +let g:airline#extensions#tabline#left_sep = '' +let g:airline#extensions#tabline#left_alt_sep = '' +let g:airline#extensions#tabline#right_sep = '' +let g:airline#extensions#tabline#right_alt_sep = '' +let g:airline#extensions#tabline#show_close_button = 0 +let g:airline#extensions#tabline#show_splits = 0 +let g:airline#extensions#tabline#tab_min_count = 2 +let g:airline#extensions#branch#enabled = 0 + +" Distribute windows when resize happens. +au VimResized * :wincmd = + +let g:ctrlp_working_path_mode = 'rw' + +augroup jbuilder + au! + autocmd BufNewFile,BufRead *.jbuilder set syntax=ruby +augroup END + +augroup es + au! + autocmd BufNewFile,BufRead *.es6 set syntax=javascript +augroup END + +set spelllang=en +autocmd FileType markdown setlocal spell +autocmd FileType gitcommit setlocal spell +autocmd FileType markdown setlocal complete+=kspell +autocmd FileType gitcommit setlocal complete+=kspell diff --git a/linky.sh b/linky.sh new file mode 100755 index 0000000..e8c27b5 --- /dev/null +++ b/linky.sh @@ -0,0 +1,9 @@ +ln -sfn $PWD/zshrc $HOME/.zshrc +ln -sfn $PWD/tmux.conf $HOME/.tmux.conf +ln -sfn $PWD/vimrc $HOME/.vimrc +ln -sfn $PWD/gitconfig $HOME/.gitconfig +ln -sfn $PWD/gitconfig_personal $HOME/.gitconfig_personal +ln -sfn $PWD/gitconfig_work $HOME/.gitconfig_work +ln -sfn $PWD/gitignore_global $HOME/.gitignore_global +ln -sfn $PWD/teamocil $HOME/.teamocil +ln -sfn $PWD/mpd.conf $HOME/.mpd/mpd.conf diff --git a/mac-install.sh b/mac-install.sh new file mode 100755 index 0000000..62893cd --- /dev/null +++ b/mac-install.sh @@ -0,0 +1,33 @@ +RUBY_VERSION="2.6.7" + +cat Brewfile | xargs brew install +cat Caskfile | xargs brew install --cask + +# Plug plugin manager for neovim/vim +curl -fLo ~/.local/share/nvim/site/autoload/plug.vim --create-dirs \ + https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim +curl -fLo ~/.vim/autoload/plug.vim --create-dirs \ + https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim + +./linky.sh + +source $HOME/.zshrc +# ruby-install ruby $RUBY_VERSION +chruby ruby-$RUBY_VERSION + + +# This repo can be cloned/installed anywhere but we always make a link here +# such that other scripts know where to find things +ln -sfn $PWD $HOME/.dotfiles + +# This directory may not exist yet, so we make a call to `mkdir` for good +# measure +mkdir -p $HOME/.config/nvim +ln -sfn $PWD/init.vim $HOME/.config/nvim/init.vim + +mkdir $HOME/Screenshots +defaults write com.apple.screencapture location -string $HOME/Screenshots +defaults write com.apple.screencapture show-thumbnail -bool FALSE +defaults write NSGlobalDomain NSAutomaticSpellingCorrectionEnabled -bool false +cd /Applications +sudo chflags hidden Messages.app Mail.app Maps.app Siri.app News.app Home.app FaceTime.app Chess.app Books.app Dictionary.app diff --git a/mpd.conf b/mpd.conf new file mode 100644 index 0000000..4a1470f --- /dev/null +++ b/mpd.conf @@ -0,0 +1,33 @@ +music_directory "/Volumes/media1/lossless" +playlist_directory "~/.mpd/playlists" +db_file "~/.mpd/mpd.db" +log_file "~/.mpd/mpd.log" +pid_file "~/.mpd/mpd.pid" +state_file "~/.mpd/mpdstate" +auto_update "yes" +auto_update_depth "2" +follow_outside_symlinks "yes" +follow_inside_symlinks "yes" + +audio_output { + type "osx" + name "CoreAudio" + mixer_type "software" +} + +audio_output { + type "fifo" + name "mpd_vis_fifo" + path "/tmp/mpd.fifo" + format "44100:16:2" +} + +decoder { + plugin "mp4ff" + enabled "no" +} + +bind_to_address "0.0.0.0" +port "6600" + +user "nick" diff --git a/multi-branch.zsh b/multi-branch.zsh new file mode 100644 index 0000000..dd86eb6 --- /dev/null +++ b/multi-branch.zsh @@ -0,0 +1,57 @@ +export STACK_CACHE_FILE=".git-branch-stack.txt" + +function push_to_branch_stack () { + if [ -z "$1" ] + then + BRANCH_NAME=$(active_branch) + else + BRANCH_NAME=$1 + fi + echo $BRANCH_NAME >> $STACK_CACHE_FILE +} + +function list_branch_stack () { + cat $STACK_CACHE_FILE +} + +function pop_branch_stack () { + LAST_BRANCH=$(head -n 1 $STACK_CACHE_FILE) + NEW_LIST=$(tail -n +2 $STACK_CACHE_FILE) + echo $NEW_LIST > $STACK_CACHE_FILE + echo $LAST_BRANCH +} + +function pop_and_checkout () { + gch $(pop_branch_stack) +} + +function clear_branch_stack () { + rm $STACK_CACHE_FILE +} + +function rebase_each () { + # iterate over each branch in our stack + while read in + do + git checkout $in + git rebase $1 + done < $STACK_CACHE_FILE + git checkout master +} + +function push_each () { + # iterate over each branch in our stack + while read in + do + git checkout $in + git push -f origin $in + done < $STACK_CACHE_FILE + git checkout master +} + +function delete_each () { + while read in + do + git branch -D $in + done < $STACK_CACHE_FILE +} diff --git a/pairing.zsh b/pairing.zsh new file mode 100644 index 0000000..73dad38 --- /dev/null +++ b/pairing.zsh @@ -0,0 +1,23 @@ +# The following functions help me put git author information into a file, later +# loaded when committing (e.g git commit --template .git-commit-authors.txt) +export GIT_AUTHORS_FILE=".git-commit-authors.txt" + +function find_author () { + cat $DOTFILES_PATH/git-authors.txt | fzy +} + +function add_author () { + echo "Co-authored-by: $(find_author)" >> $GIT_AUTHORS_FILE +} + +function show_authors () { + cat $GIT_AUTHORS_FILE +} + +function clear_authors () { + rm $GIT_AUTHORS_FILE +} + +function pair_commit () { + git commit -t $GIT_AUTHORS_FILE +} diff --git a/patched-font.otf b/patched-font.otf new file mode 100644 index 0000000..69ab2e2 Binary files /dev/null and b/patched-font.otf differ diff --git a/rsync-ignore.txt b/rsync-ignore.txt new file mode 100644 index 0000000..e223629 --- /dev/null +++ b/rsync-ignore.txt @@ -0,0 +1,5 @@ +node_modules +.cache +tmp +vendor/bundle +.DS_Store diff --git a/tmux.conf b/tmux.conf new file mode 100644 index 0000000..5a18595 --- /dev/null +++ b/tmux.conf @@ -0,0 +1,66 @@ +# some weird fucking hack to make my colours work properly +# https://www.reddit.com/r/vim/comments/5416d0/true_colors_in_vim_under_tmux/d7y2fif/ +set -g default-terminal 'screen-256color' +set -ga terminal-overrides ',screen-256color:Tc' + +set -sg escape-time 0 +set-option -g mouse on + +unbind C-b +set-option -g prefix C-a +bind-key C-a send-prefix +bind j resize-pane -D 10 +bind k resize-pane -U 10 +bind l resize-pane -L 10 +bind h resize-pane -R 10 + +set-option -g status-position top + +## COLORSCHEME: gruvbox dark +set-option -g status "on" + +# default statusbar color +set-option -g status-style bg=colour237,fg=colour223 # bg=bg1, fg=fg1 + +# default window title colors +set-window-option -g window-status-style bg=colour214,fg=colour237 # bg=yellow, fg=bg1 + +# default window with an activity alert +set-window-option -g window-status-activity-style bg=colour237,fg=colour248 # bg=bg1, fg=fg3 + +# active window title colors +set-window-option -g window-status-current-style bg=red,fg=colour237 # fg=bg1 + +# pane border +set-option -g pane-active-border-style fg=colour250 #fg2 +set-option -g pane-border-style fg=colour237 #bg1 + +# message infos +set-option -g message-style bg=colour239,fg=colour223 # bg=bg2, fg=fg1 + +# writing commands inactive +set-option -g message-command-style bg=colour239,fg=colour223 # bg=fg3, fg=bg1 + +# pane number display +set-option -g display-panes-active-colour colour250 #fg2 +set-option -g display-panes-colour colour237 #bg1 + +# clock +set-window-option -g clock-mode-colour colour109 #blue + +# bell +set-window-option -g window-status-bell-style bg=colour167,fg=colour235 # bg=red, fg=bg + +## Theme settings mixed with colors (unfortunately, but there is no cleaner way) +set-option -g status-justify "left" +set-option -g status-left-style none +set-option -g status-left-length "80" +set-option -g status-right-style none +set-option -g status-right-length "80" +set-window-option -g window-status-separator "" +set-option -g status-right '' + +set-option -g status-left "#[fg=colour248, bg=colour241] #S #[fg=colour241, bg=colour237, nobold, noitalics, nounderscore]" + +set-window-option -g window-status-current-format "#[fg=colour237, bg=colour214, nobold, noitalics, nounderscore]#[fg=colour239, bg=colour214] #I #[fg=colour239, bg=colour214, bold] #W #[fg=colour214, bg=colour237, nobold, noitalics, nounderscore]" +set-window-option -g window-status-format "#[fg=colour237,bg=colour239,noitalics]#[fg=colour223,bg=colour239] #I #[fg=colour223, bg=colour239] #W #[fg=colour239, bg=colour237, noitalics]" diff --git a/vimrc b/vimrc new file mode 100644 index 0000000..a8335ec --- /dev/null +++ b/vimrc @@ -0,0 +1,175 @@ +function! BuildComposer(info) + if a:info.status != 'unchanged' || a:info.force + if has('nvim') + !cargo build --release + else + !cargo build --release --no-default-features --features json-rpc + endif + endif +endfunction + + + +call plug#begin('~/.vim/plugged') + +" Pick a theme, any theme, really +Plug 'NLKNguyen/papercolor-theme' +Plug 'danilo-augusto/vim-afterglow' +Plug 'altercation/vim-colors-solarized' +Plug 'flazz/vim-colorschemes' +Plug 'morhetz/gruvbox' +Plug 'mhartington/oceanic-next' +Plug 'joshdick/onedark.vim' + +" Syntax support +Plug 'euclio/vim-markdown-composer', { 'do': function('BuildComposer') } +Plug 'elixir-editors/vim-elixir' +Plug 'jason0x43/vim-js-indent' +Plug 'leafgarland/typescript-vim' +Plug 'peitalin/vim-jsx-typescript' +Plug 'mustache/vim-mustache-handlebars' +Plug 'mxw/vim-jsx' +Plug 'pangloss/vim-javascript' +Plug 'rust-lang/rust.vim' +Plug 'vim-ruby/vim-ruby' +Plug 'styled-components/vim-styled-components', { 'branch': 'main' } +Plug 'kchmck/vim-coffee-script' + +" Extensions +" Chuch of tpope +Plug 'tpope/vim-endwise' +Plug 'tpope/vim-dispatch' +Plug 'tpope/vim-commentary' +Plug 'tpope/vim-surround' +Plug 'tpope/vim-fugitive' + +Plug 'sjl/splice.vim' +Plug 'srstevenson/vim-picker' +Plug 'scrooloose/nerdtree' +Plug 'francoiscabrol/ranger.vim' +Plug 'wellle/targets.vim' +Plug 'bkad/CamelCaseMotion' +Plug 'ConradIrwin/vim-bracketed-paste' +Plug 'vim-airline/vim-airline' +Plug 'vim-airline/vim-airline-themes' +Plug 'airblade/vim-gitgutter' +Plug 'mileszs/ack.vim' +Plug 'preservim/tagbar' + +call plug#end() + +" General config +syntax enable +if $VIM_BACKGROUND == 'light' + set background=light +endif +if $VIM_BACKGROUND == 'dark' + set background=dark +endif +set shell=$SHELL +set bs=2 +set tabstop=2 +set foldmethod=syntax +set foldlevelstart=99 +set expandtab +set shiftwidth=2 +set softtabstop=2 +set ai +set number +set relativenumber +set mouse=a +filetype plugin on +runtime macros/matchit.vim + +set grepprg=rg\ --vimgrep\ --no-heading +set grepformat=%f:%l:%c:%m,%f:%l:%m +let g:ackprg = 'rg --vimgrep --no-heading' + +" Shorthand commands +cnoreabbrev Spec Dispatch bundle exec rspec % + +" Key bindings +let mapleader = "\" +nnoremap ; : +nnoremap : ; + +" Roll yur own tpope +nnoremap } :set spell +nnoremap { :set spell& +nnoremap ] :cnext +nnoremap [ :cprev +nnoremap r :Ranger +nnoremap n :NERDTree % +nnoremap s :w :Dispatch bundle exec rspec --only-failures --fail-fast % +nnoremap ss :w :Dispatch bundle exec rspec % +nnoremap b :Git blame +nnoremap g :G +nnoremap c :Git commit +nnoremap / :noh +nnoremap x :PickerSplit +nnoremap p :PickerEdit +nnoremap t :PickerTabedit +nnoremap v :PickerVsplit +nnoremap u :PickerTag +nnoremap w :TagbarToggle +nnoremap h h +nnoremap j j +nnoremap k k +nnoremap l l +nnoremap h 20< +nnoremap l 20> +nnoremap j 20+ +nnoremap k 20- +nnoremap :tabn +nnoremap :tabp + +map w CamelCaseMotion_w +map b CamelCaseMotion_b +map e CamelCaseMotion_e +map ge CamelCaseMotion_ge +sunmap w +sunmap b +sunmap e +sunmap ge + +let g:picker_custom_find_executable = 'rg' +let g:picker_custom_find_flags = '. -l' + +" Theme +colorscheme $VIM_THEME +let g:airline_powerline_fonts = 1 +let g:airline_theme=$VIM_AIRLINE_THEME +let g:airline#extensions#tabline#enabled = 1 +let g:airline#extensions#tabline#formatter = 'unique_tail' +let g:airline#extensions#tabline#show_buffers = 0 +let g:airline#extensions#tabline#show_tab_nr = 0 +let g:airline#extensions#tabline#show_tab_type = 0 +let g:airline#extensions#tabline#left_sep = '' +let g:airline#extensions#tabline#left_alt_sep = '' +let g:airline#extensions#tabline#right_sep = '' +let g:airline#extensions#tabline#right_alt_sep = '' +let g:airline#extensions#tabline#show_close_button = 0 +let g:airline#extensions#tabline#show_splits = 0 +let g:airline#extensions#tabline#tab_min_count = 2 +let g:airline#extensions#branch#enabled = 0 + +" Distribute windows when resize happens. +au VimResized * :wincmd = + +let g:ctrlp_working_path_mode = 'rw' + +augroup jbuilder + au! + autocmd BufNewFile,BufRead *.jbuilder set syntax=ruby +augroup END + +augroup es + au! + autocmd BufNewFile,BufRead *.es6 set syntax=javascript +augroup END + +set spelllang=en +autocmd FileType markdown setlocal spell +autocmd FileType gitcommit setlocal spell +autocmd FileType markdown setlocal complete+=kspell +autocmd FileType gitcommit setlocal complete+=kspell diff --git a/work.zsh b/work.zsh new file mode 100644 index 0000000..747649b --- /dev/null +++ b/work.zsh @@ -0,0 +1,6 @@ +alias cdball='cd $HOME/work/smartballot' +alias cdone='cd $HOME/work/one_feather' +alias one_pr='live && hub pull-request -r "OneFeather/super-good-developers"' +alias rowan_pr='live && hub pull-request -r "watg/super-good-developers"' +export DISABLE_HEADLESS_FEATURE_SPECS=true +export CFLAGS="-Wno-error=implicit-function-declaration" diff --git a/zshrc b/zshrc new file mode 100644 index 0000000..fa0994c --- /dev/null +++ b/zshrc @@ -0,0 +1,67 @@ +# Environment +export DOTFILES_PATH=$HOME/.dotfiles +export KEYTIMEOUT=1 +export VISUAL=nvim +export EDITOR=$VISUAL +export TERM=screen-256color +export VIM_BACKGROUND=dark +export VIM_THEME=gruvbox +export VIM_AIRLINE_THEME=gruvbox +export DISABLE_HEADLESS_FEATURE_TESTS="true" + +# Custom shell functions +source $DOTFILES_PATH/pairing.zsh +source $DOTFILES_PATH/multi-branch.zsh +source $DOTFILES_PATH/git.zsh +source $DOTFILES_PATH/commands.zsh +source $DOTFILES_PATH/work.zsh + +# Version managers +eval "`fnm env --use-on-cd`" +source /usr/local/share/chruby/chruby.sh +source /usr/local/share/chruby/auto.sh +source $HOME/.cargo/env + +# Use the latest ruby for shells by default +chruby $(ls ~/.rubies | tail -n 1) + +export PATH="$DOTFILES_PATH/bin:$PATH" +export PATH="$HOME/go/bin:$PATH" + +export PYENV_ROOT="$HOME/.pyenv" +export PATH="$PYENV_ROOT/bin:$PATH" +eval "$(pyenv init --path)" + +# Auto complete +zmodload zsh/complist +autoload -Uz compinit +compinit + +# Prompt style +autoload -U colors zsh/terminfo +colors +autoload -Uz vcs_info +zstyle ':vcs_info:*' enable git +zstyle ':vcs_info:*' check-for-changes true +zstyle ':vcs_info:*' check-for-staged-changes true +zstyle ':vcs_info:*' stagedstr '%F{2}*' +zstyle ':vcs_info:*' unstagedstr '%F{1}*' +zstyle ':vcs_info:git*' formats " %F{14}%b%u%c%m%{$reset_color%}" +precmd() { vcs_info } + +setprompt() { + setopt prompt_subst + + PS1=${(j::Q)${(Z:Cn:):-$' + %F{4}%~%f + ${vcs_info_msg_0_} + %F{5}%(1j. %j.)%f + " " + %(?.%F{10}.%F{1})λ%f + " " + '}} +} +setprompt + +bindkey -v +ulimit -Sn 10240 -- cgit v1.2.3