-
-
Save kamicut/aa2424d7bd861c930619 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
############################## | |
# _ | |
# | |_ _ __ ___ _ ___ __ | |
# | __| '_ ` _ \| | | \ \/ / | |
# | |_| | | | | | |_| |> < | |
# \__|_| |_| |_|\__,_/_/\_\ | |
# | |
# FROM https://gist.github.com/snuggs/800936 | |
############################# | |
# | |
# COPY AND PASTE | |
# http://robots.thoughtbot.com/tmux-copy-paste-on-os-x-a-better-future | |
# | |
# Use vim keybindings in copy mode | |
setw -g mode-keys vi | |
# Setup 'v' to begin selection as in Vim | |
bind-key -t vi-copy v begin-selection | |
bind-key -t vi-copy y copy-pipe "reattach-to-user-namespace pbcopy" | |
############################################################################ | |
############################################################################ | |
# tmux-powerline | |
############################################################################ | |
set -g default-terminal "screen-256color" | |
set -g status-bg colour235 | |
set-option -g status on | |
set-option -g status-interval 2 | |
set-option -g status-utf8 on | |
set-option -g status-justify "centre" | |
set-option -g status-left-length 60 | |
set-option -g status-right-length 90 | |
set-option -g status-left "#(~/bin/tmux-powerline/powerline.sh left)" | |
set-option -g status-right "#(~/bin/tmux-powerline/powerline.sh right)" | |
set-window-option -g window-status-current-format "#[fg=colour255, bg=colour235] #W #[fg=colour27, bg=colour255]" | |
# Update default binding of `Enter` to also use copy-pipe | |
# unbind -t vi-copy Enter | |
# bind-key -t vi-copy Enter copy-pipe "reattach-to-user-namespace pbcopy" | |
# | |
############################################################################ | |
############################################################################ | |
# Reset Prefix | |
############################################################################ | |
set -g prefix C-a | |
bind-key a send-prefix # for nested tmux sessions | |
############################################################################ | |
# Global options | |
############################################################################ | |
# large history | |
set-option -g history-limit 10000 | |
# utf8 support | |
set-window-option -g utf8 on | |
# basic settings | |
set-window-option -g xterm-keys on # for vim | |
set-window-option -g mode-keys vi # vi key | |
set-window-option -g monitor-activity on | |
set-window-option -g window-status-current-fg white | |
setw -g window-status-current-attr reverse | |
# Automatically set window title | |
setw -g automatic-rename | |
# use mouse # More on mouse support http://floriancrouzat.net/2010/07/run-tmux-with-mouse-support-in-mac-os-x-terminal-app/ | |
setw -g mode-mouse on | |
setw -g mouse-resize-pane on | |
set -g mouse-select-window on | |
set -g mouse-select-pane on | |
set -g terminal-overrides 'xterm*:smcup@:rmcup@' | |
# vi movement keys | |
# set-option -g status-keys vi | |
############################################################################ | |
# Unbindings | |
############################################################################ | |
unbind [ # copy mode bound to escape key | |
unbind j | |
unbind C-b # unbind default leader key | |
unbind '"' # unbind horizontal split | |
unbind % # unbind vertical split | |
############################################################################ | |
# Bindings | |
############################################################################ | |
# reload tmux conf | |
bind-key r source-file ~/.tmux.conf | |
bind-key ` copy-mode | |
# new split in current pane (horizontal / vertical) | |
bind-key - split-window -v # split pane horizontally | |
bind-key \ split-window -h # split pane vertically | |
# list panes | |
bind-key Space list-panes | |
# break-pane | |
bind-key Enter break-pane | |
# join-pane [-dhv] [-l size | -p percentage] [-s src-pane] | |
# [-t:dst-window.dst-pane] (destination window (dot) destination pane | |
# (alias: joinp) | |
# | |
#bind C-j command-prompt "joinp" | |
#bind C-j command-prompt "join-pane" | |
#bind-key j command-prompt "join-pane -s '%%'" | |
#bind-key j command-prompt "joinp -t:0" | |
bind-key Space command-prompt "joinp -t:%%" # %% = prompt for window.pane [-V|H] # vert|hor split | |
#previous pane | |
bind-key -n C-up prev | |
bind-key -n C-left prev | |
#next pane | |
bind-key -n C-right next | |
bind-key -n C-down next | |
############################################################################ | |
# windows | |
############################################################################ | |
set-window-option -g window-status-current-bg red | |
bind C-j previous-window | |
bind C-k next-window | |
bind-key C-a last-window # C-a C-a for last active window | |
bind A command-prompt "rename-window %%" | |
# By default, all windows in a session are constrained to the size of the | |
# smallest client connected to that session, | |
# even if both clients are looking at different windows. | |
# It seems that in this particular case, Screen has the better default | |
# where a window is only constrained in size if a smaller client | |
# is actively looking at it. | |
setw -g aggressive-resize on | |
############################################################################ | |
# 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 | |
# use vim motion keys while in copy mode | |
setw -g mode-keys vi | |
############################################################################ | |
# layouts | |
############################################################################ | |
bind o select-layout "active-only" | |
bind M-- select-layout "even-vertical" | |
bind M-| select-layout "even-horizontal" | |
bind M-r rotate-window | |
# focus on first window | |
# select-window -t 0 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment