Skip to content

Instantly share code, notes, and snippets.

@bsag
Created February 10, 2013 19:32
Show Gist options
  • Save bsag/4750745 to your computer and use it in GitHub Desktop.
Save bsag/4750745 to your computer and use it in GitHub Desktop.
My Slate config
# My slate file
# 10-02-2013
# Basic mappings and bindings for moving screens around
# I have set up my right command key to trigger ctrl+alt+shift+cmd
# see http://stevelosh.com/blog/2012/10/a-modern-space-cadet/#hyper for details
config defaultToCurrentScreen true
config windowHintsShowIcons true
config windowHintsIgnoreHiddenWindows false
config windowHintsSpread true
config windowHintsSpreadSearchWidth 80
config windowHintsSpreadSearchHeight 80
config windowHintsFontColor "0;255;255;1.0"
config windowHintsDuration 4
config nudgePercentOf screenSize
config resizePercentOf screenSize
# Aliases for monitors
alias mon-dell 1920x1200
alias mon-air 1366x768
alias mon-imac 1920x1080
alias mon-main 1
alias mon-aux 0
# HYPER binding
alias hyper ctrl;shift;alt;cmd
############ Position and resize windows ##################################################
alias full move screenOriginX;screenOriginY screenSizeX;screenSizeY
# vertical halves of screen
alias lefthalf move screenOriginX;screenOriginY screenSizeX/2;screenSizeY
alias righthalf move screenOriginX+screenSizeX/2;screenOriginY screenSizeX/2;screenSizeY
# vertical 1/3 and 2/3 of screen
alias leftmost move screenOriginX;screenOriginY screenSizeX*0.6;screenSizeY
alias leftless move screenOriginX;screenOriginY screenSizeX*0.4;screenSizeY
alias rightmost move screenOriginX+screenSizeX*0.4;screenOriginY screenSizeX*0.6;screenSizeY
alias rightless move screenOriginX+screenSizeX*0.6;screenOriginY screenSizeX*0.4;screenSizeY
# quarters of screen
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
# centred, half screen width
alias centre move screenOriginX+screenSizeX/4;screenOriginY screenSizeX/2;screenSizeY
###########################################################################################
############# Layouts ############################################
# Blogging layout with larger ST2 on left, Marked smaller on right
layout writing-m 'Sublime Text 2':REPEAT ${lefthalf}
layout writing-m 'Marked' ${righthalf}
layout writing-p 'Sublime Text 2':REPEAT ${lefthalf}
layout writing-p 'Preview' ${righthalf}
# 1 monitor layout
layout 1mon 'Path Finder' ${full}
layout 1mon 'Mail' ${full}
layout 1mon 'Sublime Text 2':REPEAT ${centre}
layout 1mon 'Google Chrome':REPEAT ${full}
layout 1mon 'Things' ${lefthalf}
layout 1mon 'Wedge' corner top-right resize:screenSizeX*0.25;screenSizeY*0.75
# 2 monitor layout
layout 2mon 'Path Finder' ${full} ${mon-dell}
layout 2mon 'Mail' ${full} ${mon-dell}
layout 2mon 'Sublime Text 2':REPEAT ${centre} ${mon-dell}
layout 2mon 'Google Chrome':REPEAT ${full} ${mon-dell}
layout 2mon 'Things' ${lefthalf} ${mon-dell}
layout 2mon 'Wedge' ${rightless} ${mon-air}
# Default layouts
default 2mon resolutions:${mon-dell};${mon-air}
default 1mon resolutions:${mon-dell}
default 1mon resolutions:${mon-imac}
default 1mon resolutions:${mon-air}
##################################################################
############ Resize Bindings ##########################
bind right:${hyper} resize +10% +0
bind left:${hyper} resize -10% +0
bind up:${hyper} resize +0 -10%
bind down:${hyper} resize +0 +10%
#######################################################
############ Nudge Bindings ###########################
bind ]:${hyper} nudge +10% +0
bind [:${hyper} nudge -10% +0
# bind up:shift;alt nudge +0 -10%
# bind down:shift;alt nudge +0 +10%
#######################################################
############ Throw Bindings ###################################
# Move focused window to named screen and resize appropriately
# 0 when only screen
# when laptop and Dell screen both active, laptop=1, dell=0
bind 1:${hyper} throw 0 resize
bind 2:${hyper} throw 1 resize
###############################################################
############ Main movement bindings ###########################
bind k:${hyper} ${full}
bind j:${hyper} ${lefthalf}
bind l:${hyper} ${righthalf}
bind n:${hyper} chain ${leftmost} | ${rightmost}
bind m:${hyper} chain ${rightless} | ${leftless}
bind =:${hyper} ${centre}
###############################################################
############ Focus bindings ######################################
# Focus specific apps
# Focus nvALT with one press of hyper-f3 and hide with two presses
bind f3:${hyper} chain focus 'nvALT' | hide 'nvALT'
bind e:${hyper} focus 'Mail'
bind b:${hyper} focus 'Google Chrome'
bind t:${hyper} focus 'Sublime Text 2'
bind x:${hyper} focus 'Terminal'
bind f:${hyper} focus 'Things'
bind a:${hyper} focus 'Path Finder'
# Focus left/right
# This works well to toggle focus between two windows side-by-side
bind ;:${hyper} focus left
bind ':${hyper} focus right
###################################################################
########### Layout bindings #######################################
bind 3:${hyper} layout 1mon # fix sizing and layout on Air
# Layout and focus bindings make it easier to return to side-by-side windows
# You can visit another unrelated window and snap back to the 'writing windows' in one go
# Layout and focus ST2 plus Marked, side-by-side
bind 4:${hyper} sequence layout writing-m | focus 'Sublime Text 2' | focus 'Marked'
# Layout and ST2 plus Preview, side-by-side
bind 5:${hyper} sequence layout writing-p | focus 'Sublime Text 2' | focus 'Preview'
###################################################################
# Window Hints
bind esc:cmd hint HJKLYUIOPVBNM # keys to use for overlay
# Switcher
# bind tab:cmd switch
# Grid
bind esc:ctrl grid padding:5 ${mon-air}:6,2 ${mon-dell}:8,3 ${mon-imac}:8,3
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment