-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtmux.conf
104 lines (87 loc) · 3.83 KB
/
tmux.conf
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
##############################
# _
# | |_ _ __ ___ _ ___ __
# | __| '_ ` _ \| | | \ \/ /
# | |_| | | | | | |_| |> <
# \__|_| |_| |_|\__,_/_/\_\
#
#############################
############################################################################
############################################################################
# Based on https://gist.github.com/snuggs/800936
############################################################################
############################################################################
############################################################################
# Resources
#
# https://gist.github.com/andreyvit/2921703 -> Cheat Sheet
# http://code.tutsplus.com/tutorials/intro-to-tmux--net-33889 -> Okay
# http://danielmiessler.com/study/tmux/#recommendations -> Pretty good
# http://robots.thoughtbot.com/a-tmux-crash-course -> Very good article
#
# http://www.hamvocke.com/blog/a-guide-to-customizing-your-tmux-conf/ -> Good
############################################################################
############################################################################
############################################################################
# Reset Prefix
############################################################################
set -g prefix C-a
bind-key a send-prefix # for nested tmux sessions
############################################################################
## Global options
## These are overriden by powerline if they are commented out
#############################################################################
# large history
set-option -g history-limit 10000
# colors
set-option -g default-terminal "xterm-256color" #"xterm-256color" # "screen-256color"
#set-option -g pane-active-border-fg green
# utf8 support
#set-window-option -g utf8 on
#set -g status on
#set -g status-utf8 on
# force a reload of the config file
unbind r
bind r source-file ~/.tmux.conf
#set-option -g default-command "reattach-to-user-namespace -l zsh"
# start window numbering at 1 for easier switching
set -g base-index 1
# Mouse interation
# Mouse interaction on Tmux 2.1 and macOS
# https://ryanfb.github.io/etc/2015/10/19/tmux_mouse_mode_on_el_capitan.html
set -g mouse on
# Restore behavior to have mouse scroll tmux history
bind-key -T copy-mode-vi WheelUpPane send-keys -X scroll-up
bind-key -T copy-mode-vi WheelDownPane send-keys -X scroll-down
############################################################################
## panes
#############################################################################
# Navigation ---------------------------------------------------------------
# use the vim motion keys to move between panes
bind-key h select-pane -L
bind-key j select-pane -D
bind-key k select-pane -U
bind-key l select-pane -R
# Resizing ---------------------------------------------------------------
bind-key C-h resize-pane -L
bind-key C-j resize-pane -D
bind-key C-k resize-pane -U
bind-key C-l resize-pane -R
#############################################################################
## Copy and Paste
## From https://robots.thoughtbot.com/tmux-copy-paste-on-os-x-a-better-future
## - /~https://github.com/thoughtbot/laptop/issues/491 - has fixes for tmux 2.x
#############################################################################
#
# Use vim keybindings in copy mode
setw -g mode-keys vi
#
# # Setup 'v' to begin selection as in Vim
bind-key -T copy-mode-vi v send-keys -X begin-selection
bind-key -T copy-mode-vi y send-keys -X copy-pipe "reattach-to-user-namespace pbcopy"
#
# # Update default binding of `Enter` to also use copy-pipe
unbind -T copy-mode-vi Enter
bind-key -T copy-mode-vi Enter send -X copy-pipe-and-cancel "reattach-to-user-namespace pbcopy"
# Load our theme, this sets colors and status bar
source-file ~/dotfiles/tmux/theme.conf