Skip to content

Instantly share code, notes, and snippets.

View jpaton's full-sized avatar

James Paton jpaton

View GitHub Profile
unbind C-b
set -g prefix C-z
bind C-z send-prefix
unbind C-b
set -g prefix C-z
bind C-z send-prefix
# Smart pane switching with awareness of vim splits
# See: https://github.com/christoomey/vim-tmux-navigator
is_vim='echo "#{pane_current_command}" | grep -iqE "(^|\/)g?(view|n?vim?x?)(diff)?$"'
bind -n C-h if-shell "$is_vim" "send-keys C-h" "select-pane -L"
bind -n C-j if-shell "$is_vim" "send-keys C-j" "select-pane -D"
bind -n C-k if-shell "$is_vim" "send-keys C-k" "select-pane -U"
@jpaton
jpaton / infinite_random_ints.hs
Last active August 29, 2015 13:57
Generate a list of random things
newRandoms :: Random n => IO([n])
newRandoms = do
gen <- newStdGen
let initial = random gen -- :: (n, StdGen)
pairs = initial : map (random . snd) pairs -- :: [(n, StdGen)]
mkRandomInts = map fst pairs -- :: [n]
return mkRandomInts