#--Paste'n'copy
bind p paste-buffer
bind-key -t vi-copy 'v' begin-selection
bind-key -t vi-copy 'y' copy-selection
# copy tmux buffer to clipboard
bind-key Y save-buffer ~/.tmux/buffer \; run-shell "xsel -i -p <~/.tmux/buffer && rm ~/.tmux/buffer"
# ctrl+up/down arrows cycles through windows
bind-key -n C-up select-pane -t :.-
bind-key -n C-down select-pane -t :.+
# reload config without killing server
bind r source-file ~/.tmux.conf
# more intuitive keybindings for splitting
# set vi keys
unbind [
bind Escape copy-mode
bind-key -t vi-copy 'v' begin-selection
bind-key -t vi-copy 'y' copy-selection
# send the prefix to client inside window (ala nested sessions)
bind-key a send-prefix
# toggle last window like screen
bind-key C-b last-window
# confirm before killing a window or the server
bind-key k kill-window
bind-key K confirm kill-server
# toggle statusbar
bind-key b set-option status
# ctrl+left/right cycles thru windows
bind-key -n C-right next
bind-key -n C-left prev
# open a man page in new window
bind m command-prompt "split-window 'exec man %%'"
# quick view of processes
bind '~' "exec ranger"