Add tmux dotfiles and install script
This commit is contained in:
parent
7b0e02a45d
commit
b561fd7b23
21
install/tmux
Normal file
21
install/tmux
Normal file
|
@ -0,0 +1,21 @@
|
||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
echo "[TMUX]"
|
||||||
|
if [ ! `command -v "brew"` ]; then
|
||||||
|
echo "Requires homebrew"
|
||||||
|
exit
|
||||||
|
fi
|
||||||
|
|
||||||
|
echo
|
||||||
|
if [ ! `command -v "tmux"` ]; then
|
||||||
|
echo "* Installing tmux & reattach-to-user-namespace"
|
||||||
|
brew install tmux reattach-to-user-namespace
|
||||||
|
else
|
||||||
|
echo "* Tmux is already installed!"
|
||||||
|
fi
|
||||||
|
|
||||||
|
echo
|
||||||
|
echo "* Setting up symlinks"
|
||||||
|
src=$(cd "$(dirname "$0")"; pwd)
|
||||||
|
|
||||||
|
ln -sf $src/tmux.conf ~/.tmux.conf
|
42
tmux.conf
Normal file
42
tmux.conf
Normal file
|
@ -0,0 +1,42 @@
|
||||||
|
# go zsh, go
|
||||||
|
set-option -g default-shell $SHELL
|
||||||
|
|
||||||
|
# set utf-8
|
||||||
|
set-window-option -g utf8 on
|
||||||
|
set -g status-utf8 on
|
||||||
|
|
||||||
|
# look good
|
||||||
|
set-option -g default-terminal "screen-256color"
|
||||||
|
|
||||||
|
# act like GNU screen
|
||||||
|
unbind C-b
|
||||||
|
set -g prefix C-a
|
||||||
|
|
||||||
|
# set vi bind
|
||||||
|
set-window-option -g mode-keys vi
|
||||||
|
|
||||||
|
# share clipboard
|
||||||
|
set-option -g default-command "/usr/local/bin/reattach-to-user-namespace -l $SHELL"
|
||||||
|
|
||||||
|
# a mouse
|
||||||
|
set -g mode-mouse on
|
||||||
|
setw -g mouse-select-window on
|
||||||
|
setw -g mouse-select-pane on
|
||||||
|
|
||||||
|
# act like vim
|
||||||
|
setw -g mode-keys vi
|
||||||
|
bind h select-pane -L
|
||||||
|
bind j select-pane -D
|
||||||
|
bind k select-pane -U
|
||||||
|
bind l select-pane -R
|
||||||
|
bind-key -r C-h select-window -t :-
|
||||||
|
bind-key -r C-l select-window -t :+
|
||||||
|
unbind [
|
||||||
|
bind ` copy-mode
|
||||||
|
unbind p
|
||||||
|
bind p paste-buffer
|
||||||
|
bind -t vi-copy v begin-selection
|
||||||
|
bind -t vi-copy y copy-selection
|
||||||
|
|
||||||
|
# after copying to a tmux buffer, hit y again to copy to clipboard
|
||||||
|
bind y run "tmux save-buffer - | reattach-to-user-namespace pbcopy"
|
Loading…
Reference in a new issue