Skip to content

Instantly share code, notes, and snippets.

@alexg0
Last active December 26, 2015 14:19
Show Gist options
  • Save alexg0/7165009 to your computer and use it in GitHub Desktop.
Save alexg0/7165009 to your computer and use it in GitHub Desktop.
#! slate
# install with following command:
# cd /Applications && curl http://www.ninjamonkeysoftware.com/slate/versions/slate-latest.tar.gz | tar -xz
# GLOBAL CONFIGURATIONS
# -------------------------------------------------------------------
# See https://github.com/jigish/slate/wiki/Global-Configs
config defaultToCurrentScreen true
config secondsBeforeRepeat 0.4
config secondsBetweenRepeat 0.1
config keyboardLayout "qwerty"
config nudgePercentOf screenSize
config resizePercentOf screenSize
# HYPER KEY
# -------------------------------------------------------------------
# The "hyper" key is a shortcut for CTRL + ALT + CMD
# APPLICATION ALIASES AND BINDINGS
# -------------------------------------------------------------------
alias editor 'Emacs'
bind z:alt;shift focus ${editor}
alias terminal 'iTerm'
bind x:alt;shift focus ${terminal}
alias browser 'Google Chrome'
bind c:alt;shift focus ${browser}
## bind t:${hyper} focus 'Twitter'
## bind g:${hyper} focus 'Things'
bind v:alt;shift focus 'nvALT'
###########################
# Window Position Aliases #
###########################
# from: https://gist.github.com/mcallan83/5104492
alias full push right bar-resize:screenSizeX
alias center move screenOriginX+screenSizeX/6;screenOriginY+screenSizeY/6 screenSizeX/6*4;screenSizeY/6*4
alias lefthalf push left bar-resize:screenSizeX/2
alias righthalf push right bar-resize:screenSizeX/2
alias left_plus push left bar-resize:screenSizeX*0.66
alias right_plus push right bar-resize:screenSizeX*0.66
alias tophalf push top bar-resize:screenSizeY/2
alias bottomhalf push bottom bar-resize:screenSizeY/2
alias topleft corner top-left resize:screenSizeX/2;screenSizeY/2
alias topright corner top-right resize:screenSizeX/2;screenSizeY/2
alias bottomleft corner bottom-left resize:screenSizeX/2;screenSizeY/2
alias bottomright corner bottom-right resize:screenSizeX/2;screenSizeY/2
# next monitor aliases
alias full_next ${full} next
alias center_next ${center} next
alias lefthalf_next ${lefthalf} next
alias righthalf_next ${righthalf} next
alias left_plus_next ${left_plus} next
alias right_plus_next ${right_plus} next
alias tophalf_next ${tophalf} next
alias bottomhalf_next ${bottomhalf} next
alias topleft_next ${topleft} next
alias topright_next ${topright} next
alias bottomleft_next ${bottomleft} next
alias bottomright_next ${bottomright} next
alias full_chain chain ${full} | ${full_next} | ${full_next}
alias center_chain chain ${center} | ${center_next} | ${center_next}
alias lefthalf_chain chain ${lefthalf} | ${lefthalf_next} | ${lefthalf_next}
alias righthalf_chain chain ${righthalf} | ${righthalf_next} | ${righthalf_next}
alias left_plus_chain chain ${left_plus} | ${left_plus_next} | ${left_plus_next}
alias right_plus_chain chain ${right_plus} | ${right_plus_next} | ${right_plus_next}
alias tophalf_chain chain ${tophalf} | ${tophalf_next} | ${tophalf_next}
alias bottomhalf_chain chain ${bottomhalf} | ${bottomhalf_next} | ${bottomhalf_next}
alias topleft_chain chain ${topleft} | ${topleft_next} | ${topleft_next}
alias topright_chain chain ${topright} | ${topright_next} | ${topright_next}
alias bottomleft_chain chain ${bottomleft} | ${bottomleft_next} | ${bottomleft_next}
alias bottomright_chain chain ${bottomright} | ${bottomright_next} | ${bottomright_next}
alias divvy grid padding:3 0:6,6 1:6,6 2:6,6
# Resize Bindings
bind right:alt resize +10% +0
bind left:alt resize -10% +0
bind up:alt resize +0 -10%
bind down:alt resize +0 +10%
bind right:ctrl;alt resize -10% +0 bottom-right
bind left:ctrl;alt resize +10% +0 bottom-right
bind up:ctrl;alt resize +0 +10% bottom-right
bind down:ctrl;alt resize +0 -10% bottom-right
# Nudge Bindings
bind right:shift;alt nudge +10% +0
bind left:shift;alt nudge -10% +0
bind up:shift;alt nudge +0 -10%
bind down:shift;alt nudge +0 +10%
# Window Positions
bind f:alt;cmd ${full_chain}
bind c:alt;cmd ${center_chain}
bind left:alt;cmd ${lefthalf_chain}
bind right:alt;cmd ${righthalf_chain}
bind left:alt;cmd;shift ${left_plus_chain}
bind right:alt;cmd;shift ${right_plus_chain}
bind up:alt;cmd ${tophalf_chain}
bind down:alt;cmd ${bottomhalf_chain}
bind left:alt;cmd;ctrl ${topleft_chain}
bind up:alt;cmd;ctrl ${topright_chain}
bind right:alt;cmd;ctrl ${bottomright_chain}
bind down:alt;cmd;ctrl ${bottomleft_chain}
# extras
bind /:cmd ${divvy} # divvy like
bind z:cmd;alt undo
# Throw Bindings
bind 1:ctrl;alt throw 0 resize
bind 2:ctrl;alt throw 1 resize
bind 3:ctrl;alt throw 2 resize
bind right:ctrl;alt;cmd throw right resize
bind left:ctrl;alt;cmd throw left resize
bind up:ctrl;alt;cmd throw up resize
bind down:ctrl;alt;cmd throw down resize
# Focus Bindings
bind right:shift;cmd focus right
bind left:shift;cmd focus left
bind up:shift;cmd focus up
bind down:shift;cmd focus down
bind up:shift:cmd;alt focus behind
bind down:shift:cmd;alt focus behind
# Window Hints
bind esc:cmd hint
bind tab:ctrl;cmd switch
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment