Skip to content

Instantly share code, notes, and snippets.

@roc
Created May 5, 2020 09:25
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save roc/b2d16eec9a134e00d5588f654f3a9537 to your computer and use it in GitHub Desktop.
Save roc/b2d16eec9a134e00d5588f654f3a9537 to your computer and use it in GitHub Desktop.
Slate config 5-may-2020
# 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
config windowHintsShowIcons true
# HYPER KEY
# -------------------------------------------------------------------
# The "hyper" key is a shortcut for CTRL + ALT + CMD
alias hyper ctrl;alt;cmd
# MONITOR ALIASES
# -------------------------------------------------------------------
# alias monitor-macbook 1280x800
# alias monitor-dell 1440x900
# APPLICATION ALIASES AND BINDINGS
# -------------------------------------------------------------------
# alias editor 'MacVim'
# 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:cmd;shift focus 'nvALT'
# SLATE FEATURES
# -------------------------------------------------------------------
# Show quick key overlays for each window
# config windowHintsShowIcons true
# config windowHintsSpread true
# config windowHintsIgnoreHiddenWindows false
bind i:cmd;shift hint ASDFHJKLQWERTYUIOPCVBNG
# Show a positioning grid for each monitor
bind g:${hyper} grid padding:5 0:10,5 1:8,3
# Better application switcher
# bind tab:cmd switch
# Reload Slate configuration file
bind s:${hyper} relaunch
# GENERAL POSITION ALIASES AND BINDINGS
# -------------------------------------------------------------------
# These positions are not tied to any screen. Each position gets an
# alias and then a keybinding. The keybindings are all mapped to the
# numberpad, with each row grouping a denominator.
# fullscreen
alias full move screenOriginX;screenOriginY screenSizeX;screenSizeY
bind m:${hyper} ${full}
# halves
alias lefthalf move screenOriginX;screenOriginY screenSizeX/2;screenSizeY
bind left:${hyper} ${lefthalf}
alias righthalf move screenOriginX+screenSizeX/2;screenOriginY screenSizeX/2;screenSizeY
bind right:${hyper} ${righthalf}
alias tophalf move screenOriginX;screenOriginY screenSizeX;screenSizeY/2
bind up:${hyper} ${tophalf}
alias bottomhalf move screenOriginX;screenOriginY+screenSizeY/2 screenSizeX;screenSizeY/2
bind down:${hyper} ${bottomhalf}
# thirds
alias rightthird move screenOriginX+2*screenSizeX/3;screenOriginY screenSizeX/3;screenSizeY
bind ]:${hyper} ${rightthird}
alias lefttwothirds move screenOriginX;screenOriginY 2*screenSizeX/3;screenSizeY
bind [:${hyper} ${lefttwothirds}
# sizing aliases
alias sox screenOriginX
alias soy screenOriginY
alias ssx screenSizeX
alias ssy screenSizeY
alias wsx windowSizeX
alias wsy windowSizeY
# large window
alias middleguy move screenOriginX+40;screenOriginY+40 screenSizeX-80;screenSizeY-80
bind u:${hyper} ${middleguy}
# smaller window
alias smaller move screenOriginX+screenSizeX/4;screenOriginY+screenSizeY/4 screenSizeX/2;screenSizeY/2
bind j:${hyper} ${smaller}
alias phoney move screenOriginX+screenSizeX/2;screenOriginY screenSizeX/3.2;screenSizeY/1.2
bind p:${hyper} ${phoney}
# Keypad row 79 = eighths
# alias leftfifth move screenOriginX;screenOriginY screenSizeX/5;screenSizeY
# bind pad7:${hyper} ${leftfifth}
# bind 7:${hyper} ${leftfifth}
# alias rightfourfifths move (screenOriginX+screenSizeX/5)+14;screenOriginY (4*screenSizeX/5)-14;screenSizeY
# bind pad9:${hyper} ${rightfourfifths}
# bind 9:${hyper} ${rightfourfifths}
# Keypad column 28 = top and bottom halves
# alias tophalf move screenOriginX;screenOriginY screenSizeX;screenSizeY/2
# bind pad8:${hyper} ${tophalf}
# bind 8:${hyper} ${tophalf}
# alias bottomhalf move screenOriginX;screenOriginY+screenSizeY/2 screenSizeX;screenSizeY/2
# bind pad2:${hyper} ${bottomhalf}
# bind 2:${hyper} ${bottomhalf}
# MONITOR-BASED POSITION ALIASES
# -------------------------------------------------------------------
# These aliases are move windows to specific positions on a specific
# monitor.
# Laptop monitor
# alias macbook-full move screenOriginX;screenOriginY screenSizeX;screenSizeY ${monitor-macbook}
# alias macbook-lefthalf move screenOriginX;screenOriginY screenSizeX/2;screenSizeY ${monitor-macbook}
# alias macbook-righthalf move screenOriginX+screenSizeX/2;screenOriginY screenSizeX/2;screenSizeY ${monitor-macbook}
# alias macbook-leftthird move screenOriginX;screenOriginY screenSizeX/3;screenSizeY ${monitor-macbook}
# alias macbook-righttwothirds move screenOriginX+screenSizeX/3;screenOriginY 2*screenSizeX/3;screenSizeY ${monitor-macbook}
# alias macbook-leftfifth move screenOriginX;screenOriginY screenSizeX/5;screenSizeY ${monitor-macbook}
# alias macbook-rightfourfifths move (screenOriginX+screenSizeX/5)+45;screenOriginY (4*screenSizeX/5)-45;screenSizeY ${monitor-macbook}
# alias macbook-tophalf move screenOriginX;screenOriginY screenSizeX;screenSizeY/2 ${monitor-macbook}
# alias macbook-bottomhalf move screenOriginX;screenOriginY+screenSizeY/2 screenSizeX;screenSizeY/2 ${monitor-macbook}
# Dell monitor
# alias dell-full move screenOriginX;screenOriginY screenSizeX;screenSizeY ${monitor-dell}
# alias dell-lefthalf move screenOriginX;screenOriginY screenSizeX/2;screenSizeY ${monitor-dell}
# alias dell-righthalf move screenOriginX+screenSizeX/2;screenOriginY screenSizeX/2;screenSizeY ${monitor-dell}
# alias dell-leftthird move screenOriginX;screenOriginY screenSizeX/3;screenSizeY ${monitor-dell}
# alias dell-righttwothirds move screenOriginX+screenSizeX/3;screenOriginY 2*screenSizeX/3;screenSizeY ${monitor-dell}
# alias dell-leftfifth move screenOriginX;screenOriginY screenSizeX/5;screenSizeY ${monitor-dell}
# alias dell-rightfourfifths move (screenOriginX+screenSizeX/5)+14;screenOriginY (4*screenSizeX/5)-14;screenSizeY ${monitor-dell}
# alias dell-tophalf move screenOriginX;screenOriginY screenSizeX;screenSizeY/2 ${monitor-dell}
# alias dell-bottomhalf move screenOriginX;screenOriginY+screenSizeY/2 screenSizeX;screenSizeY/2 ${monitor-dell}
# TWO MONITOR LAYOUT
# -------------------------------------------------------------------
# layout 2monitors ${editor}:MAIN_FIRST ${macbook-lefthalf}
# layout 2monitors ${terminal}:MAIN_FIRST ${macbook-righthalf}
# layout 2monitors ${browser}:REPEAT ${dell-rightfourfifths}
# layout 2monitors 'Twitter':REPEAT ${dell-leftfifth}
# layout 2monitors 'Things':REPEAT ${dell-lefthalf}
# layout 2monitors 'nvALT':REPEAT ${dell-righthalf}
# Bind a key to trigger this layout
# bind pad*:${hyper} layout 2monitors
# Trigger this layout automatically when 2 monitors are present
# default 2monitors resolutions:${monitor-macbook};${monitor-dell}
# ONE MONITOR LAYOUT
# -------------------------------------------------------------------
# layout 1monitors ${editor}:MAIN_FIRST ${macbook-lefthalf}
# layout 1monitors ${terminal}:MAIN_FIRST ${macbook-righthalf}
# layout 1monitors ${browser}:REPEAT ${macbook-rightfourfifths}
# layout 1monitors 'Twitter':REPEAT ${macbook-leftfifth}
# layout 1monitors 'Things':REPEAT ${macbook-lefthalf}
# layout 1monitors 'nvALT':REPEAT ${macbook-righthalf}
# Bind a key to trigger this layout
# bind pad/:${hyper} layout 1monitors
# bind /:${hyper} layout 1monitors
# Trigger this layout automatically when 1 monitors are present
# default 1monitors resolutions:${monitor-macbook}
# BINDINGS
# -------------------------------------------------------------------
# Mostly taken from
# https://github.com/jigish/slate/blob/master/Slate/default.slate
# Focus
# bind right:cmd;ctrl focus right
# bind left:cmd;ctrl focus left
# bind up:cmd;ctrl focus behind
# bind down:cmd;ctrl focus behind
# bind ]:alt;shift focus right
# bind [:alt;shift focus left
# bind =:alt;shift focus behind
# Throw
bind n:${hyper} throw next
bind ':${hyper} throw next resize
# bind left:fn;ctrl throw left resize full
# bind right:fn;ctrl throw right resize full
# bind ]:${hyper} throw right resize full
# bind [:${hyper} throw left resize full
# # Resize
# bind right:alt;cmd resize +5% +0
# bind left:alt;cmd resize -5% +0
# bind up:alt;cmd resize +0 -5%
# bind down:alt;cmd resize +0 +5%
# # Nudge
# bind right:${hyper} nudge +10% +0
# bind left:${hyper} nudge -10% +0
# bind up:${hyper} nudge +0 -10%
# bind down:${hyper} nudge +0 +10%
# Push
# bind right:ctrl;cmd push right bar-resize:screenSizeX/3
# bind left:ctrl;cmd push left bar-resize:screenSizeX/3
# bind up:ctrl;cmd push up bar-resize:screenSizeY/2
# bind down:ctrl;cmd push down bar-resize:screenSizeY/2
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment