Instantly share code, notes, and snippets.

Embed
What would you like to do?
My Dot Files

I'm running OSX on my main machine, so these dot files are mainly configured for that. However, most of it should work fine on other *NIX platforms.

These dot files require a couple things to work properly.

  1. The bash_profile uses a powerline font for the solid > symbol. I've found that some the standard powerline fonts don't work correctly in OSX, so I've modified one by hand. It's available for download here: http://squeg.net/downloads/MenloForPowerline-Regular.ttf

    Personally, I'm using the Hack font, which works fine right out of the box.

  2. The tmux config uses the "reattach-to-user-namespace" script to fix tmux permissions and access the pasteboard on OSX. It can be installed with: brew install reattach-to-user-namespace

  3. The vimrc can optionally use The Silver Searcher for Ctrlp and grepping. It can be installed with: brew install the_silver_searcher. Maybe I should eventually add support for ripgrep: brew install ripgrep.

  4. I've included a slightly modified version of the Solarized Dark theme for iTerm2... it darkens the background and lightens the selection highlighting.

  5. I'm using a program called Hammerspoon to automatically make some changes to my iTerm profile (font size) and the size of my Dock. My .hammerspoon/init.lua file is below.

  6. Favorite linters. These are automatically used by the vim plugin "ale":

Some of my favorite tools, installed via homebrew:

Some additional notes:

  • I use a dvorak layout. OSX doesn't have a way to set the default keyboard layout on the login screen. To fix, setup your account's keyboard layout the way you'd like and then:

    sudo cp ~/Library/Preferences/com.apple.HIToolbox.plist /Library/Preferences
# ~/.bash_profile
# Load RVM
[[ -s "$HOME/.rvm/scripts/rvm" ]] && source "$HOME/.rvm/scripts/rvm"
# OCaml OPAM
. ~/.opam/opam-init/init.sh > /dev/null 2> /dev/null || true
# Function that echos as much of a string as possible,
# and automatically adds an ellipsis if necessary.
# It returns the length of the output
function ellipsis_echo {
if [ ${#1} -lt $2 ]; then
echo -en "$1"
return ${#1}
else
local MAX=$(( $2 - 3 ))
echo -en "${1:0:$MAX}..."
return $MAX
fi
}
# Custom command prompt shows current directory,
# current rvm gemset, and current git/hg branch
# NOTE: Requires a powerline compatible font.
function prompt {
local HARD_ARROW="\xEE\x82\xB0"
local DIR="${PWD/$HOME/~}"
local WIDTH=$(( $(tput cols) - 3 ))
local HAS_PYENV=0
local HAS_RVM=0
local HAS_RBENV=0
local HAS_GIT=0
local HAS_HG=0
local DIR_PREFIX=""
for i in $(seq 1 $(echo "$DIR"|tr -cd '/'|wc -c)); do
if [[ -f "${DIR_PREFIX}.python-version" ]]; then HAS_PYENV=$i; fi
if [[ -f "${DIR_PREFIX}.rvmrc" ]]; then HAS_RVM=$i; fi
if [[ -f "${DIR_PREFIX}.ruby-version" ]]; then HAS_RBENV=$i; fi
if [[ -d "${DIR_PREFIX}.git" ]]; then HAS_GIT=$i; fi
if [[ -d "${DIR_PREFIX}.hg" ]]; then HAS_HG=$i; fi
DIR_PREFIX="${DIR_PREFIX}../"
done
echo
echo -en "$(tput bold)$(tput setab 23)$(tput setaf 15)"
ellipsis_echo "$DIR" $WIDTH
WIDTH=$(( $WIDTH - $? ))
echo -en " $(tput sgr0)$(tput setaf 23)"
# don't show both pyenv and rvm - prefer whichever one is closest in the
# directory hierarchy.
if [ $HAS_PYENV -gt 0 -a $HAS_RVM -gt 0 ]; then
if [ $HAS_PYENV -lt $HAS_RVM ]; then
HAS_RVM=0
else
HAS_PYENV=0
fi
fi
if [ $HAS_RVM -gt 0 -a $WIDTH -gt 0 ]; then
echo -en "$(tput setab 29)$HARD_ARROW $(tput setaf 15)$(tput bold)"
ellipsis_echo "$(rvm tools identifier 2>/dev/null)" $WIDTH
WIDTH=$(( $WIDTH - $? - 3 ))
echo -en " $(tput sgr0)$(tput setaf 29)"
elif [ $HAS_RBENV -gt 0 -a $WIDTH -gt 0 ]; then
echo -en "$(tput setab 29)$HARD_ARROW $(tput setaf 15)$(tput bold)"
ellipsis_echo "$(rbenv version | awk '{print $1}' 2>/dev/null)" $WIDTH
echo -en " $(tput sgr0)$(tput setaf 29)"
elif [ $HAS_PYENV -gt 0 -a $WIDTH -gt 0 ]; then
echo -en "$(tput setab 29)$HARD_ARROW $(tput setaf 15)$(tput bold)"
ellipsis_echo "$(pyenv version-name 2>/dev/null)" $WIDTH
WIDTH=$(( $WIDTH - $? - 3 ))
echo -en " $(tput sgr0)$(tput setaf 29)"
fi
if [ $HAS_GIT -gt 0 -a $WIDTH -gt 0 ]; then
echo -en "$(tput setab 35)$HARD_ARROW $(tput setaf 15)$(tput bold)"
ellipsis_echo "$(git status -bs --porcelain | awk 'NR==1{w=substr($0,4,match($0,/\.{3}|$/)-4);x=y=z=""};!x&&$1~/\?/{x="?"};!y&&$1~/M/{y="*"};!z&&$1~/[ADRCU]/{z="+"};x&&y&&z{exit};END{print z y x w}')" $WIDTH
WIDTH=$(( $WIDTH - $? - 3 ))
echo -en " $(tput sgr0)$(tput setaf 35)"
fi
if [ $HAS_HG -gt 0 -a $WIDTH -gt 0 ]; then
echo -en "$(tput setab 35)$HARD_ARROW $(tput setaf 15)$(tput bold)"
ellipsis_echo "$(hg branches | awk '1{print $1}')" $WIDTH
WIDTH=$(( $WIDTH - $? - 3 ))
echo -en " $(tput sgr0)$(tput setaf 35)"
fi
echo -e "$HARD_ARROW$(tput sgr0)"
}
PROMPT_COMMAND=prompt
PS1="\$ "
# Colors for ls and grep
alias ls='ls -GFh'
alias gr='cd $(git root)'
alias preview='qlmanage -p &>/dev/null'
export CLICOLOR=1
export LSCOLORS=ExFxBxDxCxegedabagacad
export GREP_OPTIONS='--color=auto'
export HISTCONTROL=ignoreboth
export LESS='-FRX'
# Path - include MySQL lib
PATH="/usr/local/hsandbox:$PATH" # hsandbox
PATH="/usr/local/heroku/bin:$PATH" # Heroku
PATH="/usr/local/mysql/bin:$PATH" # MySQL
PATH="$HOME/go/bin:$PATH" # Go
PATH="/opt/local/bin:/opt/local/sbin:$PATH"
export PATH="/usr/local/bin:/usr/local/sbin:$PATH"
export DYLD_LIBRARY_PATH=/usr/local/mysql/lib
# postgres - https://postgresapp.com/
export PATH=$PATH:/Applications/Postgres.app/Contents/Versions/latest/bin
# node
export PATH=$PATH:./node_modules/.bin
# Load rbenv - brew install rbenv
if which rbenv > /dev/null; then eval "$(rbenv init -)"; fi
# Load pyenv - brew install pyenv pyenv-virtualenv
if which pyenv > /dev/null; then eval "$(pyenv init -)"; fi
if which pyenv-virtualenv-init > /dev/null; then eval "$(pyenv virtualenv-init -)"; fi
export VIRTUAL_ENV_DISABLE_PROMPT=1
# Load goenv - brew install goenv
if which goenv > /dev/null; then eval "$(goenv init -)"; fi
# Misc
alias vi='vim'
export EDITOR=vim
export VISUAL=vim
# fuck (https://github.com/nvbn/thefuck)
eval $(thefuck --alias)
# brew install fzf (https://github.com/junegunn/fzf)
# brew install fd (https://github.com/sharkdp/fd)
# brew install bat (https://github.com/sharkdp/bat)
[ -f ~/.fzf.bash ] && source ~/.fzf.bash
export FZF_DEFAULT_OPTS='--height 20% --no-mouse --bind="ctrl-o:execute(vim {})+abort" --border'
export FZF_DEFAULT_COMMAND='(git ls-tree -r --name-only HEAD || fd -tf -tl) 2> /dev/null'
export BAT_THEME="zenburn"
alias preview="fzf --preview 'bat --color \"always\" {}' --height 100% --no-border"
complete -F _fzf_path_completion -o default -o bashdefault bat
complete -F _fzf_dir_completion -o default -o bashdefault fd
complete -F _fzf_dir_completion -o default -o bashdefault rg
# Audio stops working on my Macbook Pro with Touchbar ALL THE DAMN TIME.
function fixaudio {
sudo killall coreaudiod
}
export -f fixaudio
# Start TMUX, but only if it exists, we're in an
# interactive shell, and we aren't inside tmux.
if command -v tmux >/dev/null && [[ $- == *i* && -z "$TMUX" ]]; then
if tmux has >/dev/null; then exec tmux att; else exec tmux; fi
fi
# ~/.config/flake8
# pip install flake8
[flake8]
max-line-length = 160
---
# ~/.config/yamllint/config
# pip install yamllint
extends: default
rules:
line-length: disable
---
# ~/.eslintrc.yml
# npm install eslint eslint-plugin-import eslint-plugin-node \
# eslint-plugin-promise eslint-plugin-standard eslint-config-standard -g
extends: standard
env:
expect: true
jquery: true
mocha: true
rules:
space-before-function-paren:
- "off"
spaced-comment:
- error
- always
- line:
markers:
- "*package"
- "="
- "!"
- "/"
- ","
block:
balanced: true
markers:
- "*package"
- "="
- "!"
- ","
- ":"
- "::"
- "flow-include"
exceptions:
- "*"
# ~/.gemrc
gem: --no-ri --no-rdoc
# ~/.gitconfig
[user]
name = me!
email = my email!
[push]
default = current
followTags = true
[merge]
tool = opendiff
conflictstyle = diff3
[diff]
tool = opendiff
[color]
ui = auto
[alias]
lg = log --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cblue(%aN)%Creset %Cgreen(%cr)%Creset' --abbrev-commit --date=relative
lgf = "!_() { local SHA=`git lg | fzf --no-sort --ansi | sed 's/^[^a-z0-9]*//;/^$/d' | awk '{print $1}'`; [ -n \"${SHA}\" ] && git show ${SHA}; }; _"
new = !bash -c 'git lg $1@{1}..$1@{0} "$@"'
show-deleted = "!_() { local HASH=`git rev-list --max-count=1 --all -- $1`; git show ${HASH}^:$1; }; _"
root = "!pwd"
[core]
excludesfile = /Users/bmatcuk/.gitignore_global
# ~/.gitignore_global
*.swp
*.gem
*.byebug_history
.env.local
.DS_Store
-- ~/.hammerspoon/init.lua
local hadExternalMonitor = nil
function hasExternalMonitor()
for _, screen in pairs(hs.screen.allScreens()) do
if screen:name() ~= "Color LCD" then
return true
end
end
return false
end
function setItem2Profile(hasExternal)
--[[
-- Both ExternalMonitorProfile.json and NonExternalMonitor.json should look
-- something like the following, the only difference is the font size:
--
-- {
-- "Profiles": [
-- {
-- "Name": "Default+DynamicMonitor",
-- "Guid": "7BB34877-4B5A-468C-BFAE-C73C934ECA3A",
-- "Dynamic Profile Parent Name": "Default",
-- "Normal Font": "Hack-Regular 11",
-- "Non Ascii Font": "Hack-Regular 11"
-- }
-- ]
-- }
--]]
symlinkPath = os.getenv("HOME") .. "/Library/Application\\ Support/iTerm2/DynamicProfiles/Dynamic.json"
profilePath = os.getenv("HOME") .. "/Library/Mobile\\ Documents/com~apple~CloudDocs/iterm2/"
if hasExternal then
profilePath = profilePath .. "ExternalMonitorProfile.json"
else
profilePath = profilePath .. "NonExternalMonitorProfile.json"
end
print("Setting iTerm profile to:", profilePath)
hs.execute("ln -sf " .. profilePath .. " " .. symlinkPath)
end
function setDockSize(hasExternal)
size = "32"
if hasExternal then
size = "64"
end
print("Changing Dock size to:", size)
hs.execute("defaults write com.apple.dock tilesize -int " .. size .. "; killall Dock")
end
function displayWatcherCallback()
hasExternal = hasExternalMonitor()
if hadExternalMonitor == nil or hasExternal ~= hadExternalMonitor then
hadExternalMonitor = hasExternal
setItem2Profile(hasExternal)
setDockSize(hasExternal)
end
end
local monitorWatcher = hs.screen.watcher.new(displayWatcherCallback)
monitorWatcher:start()
displayWatcherCallback()
# ~/.inputrc
set editing-mode vi
$if mode=vi
set keymap vi-command
Control-l: clear-screen
set keymap vi-insert
Control-l: clear-screen
$endif
; ~/.npmrc
save-prefix = "~"
# ~/.pylint.rc
# pip install pylint
[MASTER]
profile=no
persistent=yes
ignore=migrations
cache-size=500
[MESSAGES CONTROL]
# C0103 Invalid name (we use dashes in the filename for management commands)
# C0111 Missing docstring
# I0011 Warning locally suppressed using disable-msg
# I0012 Warning locally suppressed using disable-msg
# W0704 Except doesn't do anything Used when an except clause does nothing but "pass" and there is no "else" clause
# W0142 Used * or * magic* Used when a function or method is called using *args or **kwargs to dispatch arguments.
# W0212 Access to a protected member %s of a client class
# W0232 Class has no __init__ method Used when a class has no __init__ method, neither its parent classes.
# W0613 Unused argument %r Used when a function or method argument is not used.
# W0702 No exception's type specified Used when an except clause doesn't specify exceptions type to catch.
# R0201 Method could be a function
# E1101 This causes errors when using abstract base classes
# W0621 Redefining variable name from outer scope - def pets newline pets
# R0902 Too many instance attributes (is dumb re: test cases)
# R0904 Too many public methods (is dumb re: test cases)
# E1103 Has no attr but cannot infer some (dumb dumb)
# R0901 Too many ancestors (RoverTestCase children already exceed 8)
# E1120 No value passed for parameter (Class-based views always trigger this)
disable=C0103,C0111,I0011,I0012,W0704,W0142,W0212,W0232,W0613,W0702,R0201,E1101,W0621,R0904,E1103,R0902,R0801,R0901,E1120
[REPORTS]
output-format=parseable
include-ids=yes
[BASIC]
no-docstring-rgx=__.*__|_.*
class-rgx=[A-Z_][a-zA-Z0-9_]+$
function-rgx=[a-zA_][a-zA-Z0-9_]{2,70}$
method-rgx=[a-z_][a-zA-Z0-9_]{2,70}$
const-rgx=(([A-Z_][A-Z0-9_]*)|([a-z_][a-z0-9_]*)|(__.*__)|register|urlpatterns)$
good-names=_,i,j,k,e,pk,setUp,tearDown
[TYPECHECK]
# Tells whether missing members accessed in mixin class should be ignored. A
# mixin class is detected if its name ends with "mixin" (case insensitive).
ignore-mixin-members=yes
# List of classes names for which member attributes should not be checked
# (useful for classes with attributes dynamically set).
ignored-classes=SQLObject
# When zope mode is activated, add a predefined set of Zope acquired attributes
# to generated-members.
zope=no
# List of members which are set dynamically and missed by pylint inference
# system, and so shouldn't trigger E0201 when accessed.
generated-members=objects,DoesNotExist,id,pk,_meta,base_fields,context
# List of method names used to declare (i.e. assign) instance attributes
defining-attr-methods=__init__,__new__,setUp
[VARIABLES]
init-import=no
dummy-variables-rgx=_|dummy|i|j|k
[SIMILARITIES]
min-similarity-lines=6
ignore-comments=yes
ignore-docstrings=yes
[MISCELLANEOUS]
notes=FIXME,XXX,TODO
[FORMAT]
max-line-length=160
max-module-lines=500
indent-string=' '
[DESIGN]
max-args=10
max-locals=15
max-returns=6
max-branchs=12
max-statements=50
max-parents=7
max-attributes=7
min-public-methods=0
max-public-methods=50
# Copy this file to: $(rbenv root)/default-gems
# mkdir -p $(rbenv root)/plugins
# git clone https://github.com/rbenv/rbenv-default-gems.git $(rbenv root)/plugins/rbenv-default-gems
bundler
rubocop
rubocop-rspec
reek
brakeman
---
# ~/.reek
TooManyStatements:
max_statements: 20
"app/controllers":
IrresponsibleModule:
enabled: false
NestedIterators:
max_allowed_nesting: 2
UnusedPrivateMethod:
enabled: false
InstanceVariableAssumption:
enabled: false
"app/helpers":
IrresponsibleModule:
enabled: false
UtilityFunction:
enabled: false
"app/mailers":
InstanceVariableAssumption:
enabled: false
---
# ~/.rubocop.yml
require: rubocop-rspec
AllCops:
TargetRubyVersion: 2.3
Documentation:
Enabled: false
Metrics/LineLength:
Max: 150
Metrics/MethodLength:
Max: 20
Metrics/AbcSize:
Max: 30
Style/ClassAndModuleChildren:
Enabled: false
Layout/IndentArray:
EnforcedStyle: consistent
Style/NumericLiterals:
MinDigits: 7
Style/RaiseArgs:
EnforcedStyle: compact
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Ansi 0 Color</key>
<dict>
<key>Blue Component</key>
<real>0.19370138645172119</real>
<key>Green Component</key>
<real>0.15575926005840302</real>
<key>Red Component</key>
<real>0.0</real>
</dict>
<key>Ansi 1 Color</key>
<dict>
<key>Blue Component</key>
<real>0.14145714044570923</real>
<key>Green Component</key>
<real>0.10840655118227005</real>
<key>Red Component</key>
<real>0.81926977634429932</real>
</dict>
<key>Ansi 10 Color</key>
<dict>
<key>Blue Component</key>
<real>0.38298487663269043</real>
<key>Green Component</key>
<real>0.35665956139564514</real>
<key>Red Component</key>
<real>0.27671992778778076</real>
</dict>
<key>Ansi 11 Color</key>
<dict>
<key>Blue Component</key>
<real>0.43850564956665039</real>
<key>Green Component</key>
<real>0.40717673301696777</real>
<key>Red Component</key>
<real>0.32436618208885193</real>
</dict>
<key>Ansi 12 Color</key>
<dict>
<key>Blue Component</key>
<real>0.51685798168182373</real>
<key>Green Component</key>
<real>0.50962930917739868</real>
<key>Red Component</key>
<real>0.44058024883270264</real>
</dict>
<key>Ansi 13 Color</key>
<dict>
<key>Blue Component</key>
<real>0.72908437252044678</real>
<key>Green Component</key>
<real>0.33896297216415405</real>
<key>Red Component</key>
<real>0.34798634052276611</real>
</dict>
<key>Ansi 14 Color</key>
<dict>
<key>Blue Component</key>
<real>0.56363654136657715</real>
<key>Green Component</key>
<real>0.56485837697982788</real>
<key>Red Component</key>
<real>0.50599193572998047</real>
</dict>
<key>Ansi 15 Color</key>
<dict>
<key>Blue Component</key>
<real>0.86405980587005615</real>
<key>Green Component</key>
<real>0.95794391632080078</real>
<key>Red Component</key>
<real>0.98943418264389038</real>
</dict>
<key>Ansi 2 Color</key>
<dict>
<key>Blue Component</key>
<real>0.020208755508065224</real>
<key>Green Component</key>
<real>0.54115492105484009</real>
<key>Red Component</key>
<real>0.44977453351020813</real>
</dict>
<key>Ansi 3 Color</key>
<dict>
<key>Blue Component</key>
<real>0.023484811186790466</real>
<key>Green Component</key>
<real>0.46751424670219421</real>
<key>Red Component</key>
<real>0.64746475219726562</real>
</dict>
<key>Ansi 4 Color</key>
<dict>
<key>Blue Component</key>
<real>0.78231418132781982</real>
<key>Green Component</key>
<real>0.46265947818756104</real>
<key>Red Component</key>
<real>0.12754884362220764</real>
</dict>
<key>Ansi 5 Color</key>
<dict>
<key>Blue Component</key>
<real>0.43516635894775391</real>
<key>Green Component</key>
<real>0.10802463442087173</real>
<key>Red Component</key>
<real>0.77738940715789795</real>
</dict>
<key>Ansi 6 Color</key>
<dict>
<key>Blue Component</key>
<real>0.52502274513244629</real>
<key>Green Component</key>
<real>0.57082360982894897</real>
<key>Red Component</key>
<real>0.14679534733295441</real>
</dict>
<key>Ansi 7 Color</key>
<dict>
<key>Blue Component</key>
<real>0.79781103134155273</real>
<key>Green Component</key>
<real>0.89001238346099854</real>
<key>Red Component</key>
<real>0.91611063480377197</real>
</dict>
<key>Ansi 8 Color</key>
<dict>
<key>Blue Component</key>
<real>0.15170273184776306</real>
<key>Green Component</key>
<real>0.11783610284328461</real>
<key>Red Component</key>
<real>0.0</real>
</dict>
<key>Ansi 9 Color</key>
<dict>
<key>Blue Component</key>
<real>0.073530435562133789</real>
<key>Green Component</key>
<real>0.21325300633907318</real>
<key>Red Component</key>
<real>0.74176257848739624</real>
</dict>
<key>Background Color</key>
<dict>
<key>Blue Component</key>
<real>0.075632777149321262</real>
<key>Green Component</key>
<real>0.058586207218864823</real>
<key>Red Component</key>
<real>0.0</real>
</dict>
<key>Bold Color</key>
<dict>
<key>Blue Component</key>
<real>0.56363654136657715</real>
<key>Green Component</key>
<real>0.56485837697982788</real>
<key>Red Component</key>
<real>0.50599193572998047</real>
</dict>
<key>Cursor Color</key>
<dict>
<key>Blue Component</key>
<real>0.51685798168182373</real>
<key>Green Component</key>
<real>0.50962930917739868</real>
<key>Red Component</key>
<real>0.44058024883270264</real>
</dict>
<key>Cursor Text Color</key>
<dict>
<key>Blue Component</key>
<real>0.19370138645172119</real>
<key>Green Component</key>
<real>0.15575926005840302</real>
<key>Red Component</key>
<real>0.0</real>
</dict>
<key>Foreground Color</key>
<dict>
<key>Blue Component</key>
<real>0.51685798168182373</real>
<key>Green Component</key>
<real>0.50962930917739868</real>
<key>Red Component</key>
<real>0.44058024883270264</real>
</dict>
<key>Selected Text Color</key>
<dict>
<key>Blue Component</key>
<real>0.56363654136657715</real>
<key>Green Component</key>
<real>0.56485837697982788</real>
<key>Red Component</key>
<real>0.50599193572998047</real>
</dict>
<key>Selection Color</key>
<dict>
<key>Blue Component</key>
<real>0.2604991515837104</real>
<key>Green Component</key>
<real>0.20841278339455549</real>
<key>Red Component</key>
<real>0.0</real>
</dict>
</dict>
</plist>
# ~/.ssh/config
Host trustedhost.com
ForwardAgent yes
Host anotherident.com
IdentityFile ~/.ssh/different_key
Host *
AddKeysToAgent yes
ControlMaster auto
ControlPath "/tmp/ssh-%r@%h:%p"
ControlPersist 5m
SendEnv LANG LC_*
ServerAliveInterval 120
---
# ~/.stylelintrc.yml
# npm install stylelint stylelint-config-standard -g
extends: /usr/local/lib/node_modules/stylelint-config-standard
# ~/.tigrc
set show-changes = true
set ignore-case = true
set git-colors = no
# Solarized Dark color scheme influenced by altercation/vim-colors-solarized and tpope/vim-fugitive
color "---" default default
color "diff --" yellow default
color "--- " yellow default
color "+++ " yellow default
color "@@" blue default
color "+" green default
color " +" green default
color "-" red default
color " -" red default
color "index " red default
color "old file mode " yellow default
color "new file mode " yellow default
color "deleted file mode " yellow default
color "copy from " yellow default
color "copy to " yellow default
color "rename from " yellow default
color "rename to " yellow default
color "similarity " yellow default
color "dissimilarity " yellow default
color "diff-tree " yellow default
color "Author: " blue default
color "Commit: " blue default
color "Tagger: " blue default
color "Merge: " blue default
color "Date: " blue default
color "AuthorDate: " blue default
color "CommitDate: " blue default
color "TaggerDate: " blue default
color "Refs: " blue default
color "Reflog: " blue default
color "Reflog message: " blue default
color "stash@{" blue default
color "commit " green default
color "parent " green default
color "tree " green default
color "author " green default
color "committer " green default
color " Signed-off-by" green default
color " Acked-by" green default
color " Tested-by" green default
color " Reviewed-by" green default
color default 14 8 normal
color cursor default default reverse
color status 10 0
color delimiter default default
color date cyan default
color mode cyan default
color id blue default
color overflow 10 0
color header yellow default
color section yellow default
color directory yellow default
color file yellow default
color grep.file yellow default
color file-size default default
color line-number 10 0
color title-blur 0 11
color title-focus white 3 bold
color main-commit default default
color main-tag 11 default
color main-local-tag 11 default
color main-remote yellow default
color main-replace yellow default
color main-tracked yellow default bold
color main-ref yellow default
color main-head yellow default bold
color stat-none default default
color stat-staged 10 default bold
color stat-unstaged red default bold
color stat-untracked 7 default bold
color help-group blue default
color help-action yellow default
color diff-stat default default
color palette-0 default default
color palette-1 7 default
color palette-2 white default
color palette-3 cyan default
color palette-4 blue default
color palette-5 yellow default
color palette-6 green default
color palette-7 default default bold
color palette-8 7 default bold
color palette-9 white default bold
color palette-10 cyan default bold
color palette-11 blue default bold
color palette-12 yellow default bold
color palette-13 green default bold
color graph-commit default default
color search-result 8 yellow
# ~/.tmux.conf
# use vi keys for different modes
set -g status-keys vi
setw -g mode-keys vi
# set base index to 1 for windows so it's easier to change quickly
set -g base-index 1
set -g renumber-windows on
# monitor windows for activity
setw -g monitor-activity on
# no delay after hitting escape
set -sg escape-time 0
# misc
set -g history-limit 10000
set -g default-terminal "screen-256color"
set -g repeat-time 200
# status line settings
set -g display-time 1000
set -g status-left ""
set -g status-left-length 0
set -g status-right ""
set -g status-right-length 0
set -g status-style "bg=colour53,fg=colour15,bold"
# styles - run :XtermColorTable in vim for color options
set -g message-style "bg=colour51,fg=colour16,bold"
set -g message-command-style "bg=colour234,fg=colour51"
set -g pane-active-border-style "fg=colour6"
set -g pane-border-style "fg=colour235"
set -g mode-style "bg=colour208,fg=colour16,bold"
set -g window-status-activity-style "bg=colour91"
set -g window-status-bell-style "bg=colour52"
# without this, any application started within the shell will not use retina rendering in Mavericks
# install with: brew install reattach-to-user-namespace
set-option -g default-command "reattach-to-user-namespace -l bash"
# copy buffer <-> clipboard
bind C-c run "tmux save-buffer - | reattach-to-user-namespace pbcopy"
bind C-v run "reattach-to-user-namespace pbpaste | tmux load-buffer - ';' paste-buffer -d"
# move windows
bind C-S-Left swap-window -t -1
bind C-S-Right swap-window -t +1
# toggle synchronize-panes
bind ` setw synchronize-panes
# clear screen
bind C-l send-keys \; clear-history
" ~/.vimrc
syntax on
set nocompatible
filetype off
" some ale config options should be set before ale is loaded...
let g:ale_lint_on_text_changed = 'never'
let g:ale_lint_on_insert_leave = 1
set rtp+=~/.vim/bundle/Vundle.vim
call vundle#begin()
Plugin 'gmarik/Vundle.vim'
Plugin 'guns/xterm-color-table.vim'
Plugin 'altercation/vim-colors-solarized'
Plugin 'kchmck/vim-coffee-script'
Plugin 'lambdatoast/elm.vim'
Plugin 'ctrlpvim/ctrlp.vim'
Plugin 'rking/ag.vim'
Plugin 'fatih/vim-go'
Plugin 'luochen1990/rainbow'
Plugin 'tpope/vim-surround.git'
Plugin 'terryma/vim-multiple-cursors.git'
Plugin 'vim-airline/vim-airline'
Plugin 'vim-airline/vim-airline-themes'
Plugin 'tpope/vim-fugitive'
Plugin 'tpope/vim-unimpaired'
Plugin 'tpope/vim-dispatch'
Plugin 'tpope/vim-rails'
Plugin 'tpope/vim-bundler'
Plugin 'vim-scripts/dbext.vim'
Plugin 'vim-scripts/restore_view.vim'
Plugin 'tikhomirov/vim-glsl'
Plugin 'elixir-lang/vim-elixir'
Plugin 'digitaltoad/vim-jade'
Plugin 'jlanzarotta/bufexplorer'
Plugin 'vim-erlang/vim-erlang-runtime'
Plugin 'vim-erlang/vim-erlang-compiler'
Plugin 'vim-erlang/vim-erlang-omnicomplete'
Plugin 'vim-erlang/vim-erlang-tags'
Plugin 'editorconfig/editorconfig-vim'
Plugin 'wellle/targets.vim'
Plugin 'Olical/vim-enmasse'
Plugin 'Shougo/unite.vim'
Plugin 'Shougo/vimfiler.vim'
Plugin 'bmatcuk/vimfiler-prompt'
Plugin 't9md/vim-choosewin'
Plugin 'LnL7/vim-nix'
Plugin 'wesQ3/vim-windowswap'
Plugin 'airblade/vim-gitgutter'
Plugin 'godlygeek/tabular'
Plugin 'tpope/vim-repeat'
Plugin 'tpope/vim-speeddating'
Plugin 'tpope/vim-abolish'
Plugin 'tpope/vim-commentary'
Plugin 'tpope/vim-projectionist'
Plugin 'tpope/vim-fireplace'
Plugin 'tpope/vim-salve'
Plugin 'vim-scripts/paredit.vim'
Plugin 'w0rp/ale'
Plugin 'vim-scripts/groovyindent-unix'
Plugin 'martinda/Jenkinsfile-vim-syntax'
Plugin 'hashivim/vim-terraform'
Plugin 'HerringtonDarkholme/yats.vim'
Plugin 'jremmen/vim-ripgrep'
call vundle#end()
filetype plugin indent on
" brew install ripgrep
" brew install the_silver_searcher
if executable('rg')
set grepprg=rg\ --color=never
let g:ctrlp_user_command = 'rg %s --files --color=never --glob ""'
let g:ctrlp_use_caching = 0
let g:rg_derive_root = 1
nnoremap \ :Rg<SPACE>
elseif executable('ag')
" Use ag over grep
set grepprg=ag\ --nogroup\ --nocolor
" Use ag in CtrlP for listing files. Lighting fast and respects .gitignore
let g:ctrlp_user_command = 'ag %s -l --nocolor -g ""'
" ag is fast enough that CtrlP doesn't need to cache
let g:ctrlp_use_caching = 0
" start an AG search with backslash
command -nargs=+ -complete=file -bar Ag silent! grep! <args>|cwindow|redraw!
nnoremap \ :Ag<SPACE>
endif
" bind K to grep word under cursor
nnoremap K :grep! "\b<C-R><C-W>\b"<CR>:cw<CR>
set tabstop=2
set expandtab
set shiftwidth=2
set softtabstop=2
set ruler
set number
set relativenumber
set wildmenu
set splitbelow
set splitright
set laststatus=2
set hidden
set backspace=indent,eol,start
set showmatch
set hlsearch
set incsearch
set ignorecase
set smartcase
set list
set listchars=tab:␉·,trail:␠,nbsp:⎵,extends:#
set viewoptions=cursor,folds
set updatetime=250
set wildignore+=*/.git/*,*/tmp/*,*.swp
let mapleader=","
nnoremap <silent> <leader>/ :nohlsearch<CR>
set background=dark
colorscheme solarized
autocmd filetype crontab setlocal nobackup nowritebackup
" vim-airline settings
let g:airline_theme='solarized'
let g:airline_powerline_fonts=1
let g:airline#extensions#tabline#enabled = 1
let g:airline#extensions#virtualenv#enabled = 0
let g:airline#extensions#tabline#show_close_button = 0
call airline#parts#define('linenr', {
\ 'raw': '%{g:airline_symbols.linenr}%#__accent_bold#%4l%#__restore__#',
\ 'accent': 'none'})
" Couple bindings for fugitive
function! MyGlog(count, lst)
if a:count > 0
if a:lst
exe 'Glog -' . a:count . ' -- %'
else
exe 'Glog -' . a:count
endif
else
if a:lst
exe 'Glog -- %'
else
exe 'Glog'
endif
endif
endfunction
" http://stackoverflow.com/questions/30745536/vi-fugitive-gpush-does-not-exit-sometimes
let g:fugitive_git_executable = "env GIT_SSH_COMMAND='ssh -o ControlPersist=no' git"
let g:dispatch_handlers = ['tmux']
nnoremap <silent> <leader>gs :Gstatus<cr>
nnoremap <silent> <leader>gl :<C-U>silent call MyGlog(v:count,0)<CR>
nnoremap <silent> <leader>gL :<C-U>silent call MyGlog(v:count,1)<CR>
nnoremap <silent> <leader>gb :Gblame<cr>
nnoremap <silent> <leader>gp :Gpush<cr>
nnoremap <silent> <leader>gf :Gpull<cr>
nnoremap <silent> <leader>gd :Gdiff<cr>
nnoremap <leader>ge :Gedit<space>
nnoremap <leader>gg :silent Ggrep<space>
autocmd BufReadPost fugitive://* set bufhidden=delete
autocmd BufReadPost fugitive://* xnoremap <buffer> dp :diffput<cr>|xnoremap <buffer> do :diffget<cr>
autocmd QuickFixCmdPost *grep* cwindow
" disable editorconfig in fugitive buffers
let g:EditorConfig_exclude_patterns = ['fugitive://.*']
" gitgutter
set signcolumn=yes
" settings by filetype
autocmd Filetype go highlight SpecialKey term=none cterm=none ctermfg=16 ctermbg=0 guifg=Cyan
autocmd FileType terraform setlocal commentstring=#%s
" execute macros over a visual selection with @x where x = macro register
xnoremap @ :<C-u>call ExecuteMacroOverVisualRange()<CR>
function! ExecuteMacroOverVisualRange()
echo "@".getcmdline()
execute ":'<,'>normal @".nr2char(getchar())
endfunction
" highlight current match with *, rather than moving to the next match
nnoremap <silent> * :let stay_star_view = winsaveview()<CR>*:call winrestview(stay_star_view)<CR>
" use vimfiler instead of netrw and other vimfiler settings
let g:vimfiler_as_default_explorer = 1
let g:loaded_netrwPlugin = 1
autocmd FileType vimfiler nmap <buffer> i :VimFilerPrompt<CR>
nnoremap <silent> <leader>e :VimFilerBufferDir -force-quit -explorer<CR>
nnoremap <silent> <leader>E :VimFiler -force-quit -explorer -project<CR>
" choosewin
nmap - <Plug>(choosewin)
let g:choosewin_overlay_enable = 1
" vim-go
let g:go_fmt_options = {
\ 'gofmt': '-s',
\}
" ale
let g:ale_echo_msg_format = '[%linter%] %s [%severity%]'
nmap <silent> <C-k> <Plug>(ale_previous_wrap)
nmap <silent> <C-j> <Plug>(ale_next_wrap)
call ale#linter#Define('eruby', {
\ 'name': 'erubylint_custom',
\ 'executable': 'erb',
\ 'output_stream': 'stderr',
\ 'command': "sed -e 's/<%=/<%/g' -e 's/-%>/%>/g' %t | erb -P -x | ruby -c",
\ 'callback': 'ale#handlers#ruby#HandleSyntaxErrors',
\})
let g:ale_linters = {
\ 'eruby': ['erubylint_custom']
\}
" rainbow settings
let g:rainbow_active = 1
let g:rainbow_conf = {
\ 'guifgs': ['#df0000', '#df5f00', '#dfdf00', '#00af00', '#005fff', '#5f00ff', '#8700df'],
\ 'ctermfgs': ['160', '166', '184', '34', '27', '57', '92'],
\ 'operators': '_,_',
\ 'parentheses': ['start=/(/ end=/)/ fold', 'start=/\[/ end=/\]/ fold', 'start=/{/ end=/}/ fold'],
\ 'separately': {
\ '*': {},
\ 'tex': {
\ 'parentheses': ['start=/(/ end=/)/', 'start=/\[/ end=/\]/'],
\ },
\ 'vim': {
\ 'parentheses': ['start=/(/ end=/)/', 'start=/\[/ end=/\]/', 'start=/{/ end=/}/ fold', 'start=/(/ end=/)/ containedin=vimFuncBody', 'start=/\[/ end=/\]/ containedin=vimFuncBody', 'start=/{/ end=/}/ fold containedin=vimFuncBody'],
\ },
\ 'xml': {
\ 'parentheses': ['start=/\v\<\z([-_:a-zA-Z0-9]+)(\s+[-_:a-zA-Z0-9]+(\=("[^"]*"|'."'".'[^'."'".']*'."'".'))?)*\>/ end=#</\z1># fold'],
\ },
\ 'xhtml': {
\ 'parentheses': ['start=/\v\<\z([-_:a-zA-Z0-9]+)(\s+[-_:a-zA-Z0-9]+(\=("[^"]*"|'."'".'[^'."'".']*'."'".'))?)*\>/ end=#</\z1># fold'],
\ },
\ 'html': {
\ 'parentheses': ['start=/\v\<((area|base|br|col|embed|hr|img|input|keygen|link|menuitem|meta|param|source|track|wbr)[ >])@!\z([-_:a-zA-Z0-9]+)(\s+[-_:a-zA-Z0-9]+(\=("[^"]*"|'."'".'[^'."'".']*'."'".'|[^ '."'".'"><=`]*))?)*\>/ end=#</\z1># fold'],
\ },
\ 'php': {
\ 'parentheses': ['start=/\v\<((area|base|br|col|embed|hr|img|input|keygen|link|menuitem|meta|param|source|track|wbr)[ >])@!\z([-_:a-zA-Z0-9]+)(\s+[-_:a-zA-Z0-9]+(\=("[^"]*"|'."'".'[^'."'".']*'."'".'|[^ '."'".'"><=`]*))?)*\>/ end=#</\z1># fold', 'start=/(/ end=/)/ containedin=@htmlPreproc contains=@phpClTop', 'start=/\[/ end=/\]/ containedin=@htmlPreproc contains=@phpClTop', 'start=/{/ end=/}/ containedin=@htmlPreproc contains=@phpClTop'],
\ },
\ 'css': 0,
\ }
\}
# ~/.yarnrc
# Add the following to the bottom of the file
save-prefix "~"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment