diff --git a/sh/bashrc b/sh/bashrc index 545424c..74bcf9b 100644 --- a/sh/bashrc +++ b/sh/bashrc @@ -26,6 +26,7 @@ alias .....="cd ../../../.." alias ......="cd ../../../../.." # tmux aliases +alias tmux='TERM=screen-256color-bce tmux' # syntax higlighting for vim in tmux alias tmnew="tmux new -s" alias tmls="tmux list-sessions" alias tmatt="tmux attach -t" diff --git a/sh/link.bash b/sh/link.bash index c79fb77..5e18aad 100755 --- a/sh/link.bash +++ b/sh/link.bash @@ -8,7 +8,7 @@ rm "$HOME/.bash_profile" rm "$HOME/.tmux.conf" ln -s "$DOTFILES_PATH/sh/bashrc" "$HOME/.bashrc" ln -s "$DOTFILES_PATH/sh/bash_profile" "$HOME/.bash_profile" -ln -s "$DOTFILES_PATH/sh/.tmux.conf" "$HOME/.tmux.conf" +ln -s "$DOTFILES_PATH/sh/tmux.conf" "$HOME/.tmux.conf" sed -i "/export DOTFILES_PATH/c export DOTFILES_PATH=\"$DIR\"" "$HOME/.bashrc" diff --git a/sh/tmux.conf b/sh/tmux.conf index e69de29..6145674 100644 --- a/sh/tmux.conf +++ b/sh/tmux.conf @@ -0,0 +1,120 @@ +# ^s as prefix +unbind C-b +set -g prefix C-s +bind-key s send-prefix + +# statusbar on top +set-option -g status-position top + +# better resizing +setw -g aggressive-resize on + +set -s escape-time 1 + +# terminal +set -g default-terminal "screen-256color" +set-window-option -g utf8 on +set-window-option -g xterm-keys on +set-window-option -g mode-keys vi +set-window-option -g monitor-activity on + +# status bar +set -g status-interval 5 +set -g status-utf8 on +setw -g mode-bg black +set-option -g status-bg default +set-option -g status-fg default +set-option -g status-attr default +set-option -g message-bg default +set-option -g message-fg yellow +set -g status-left '#[fg=green]#(whoami)@#24h > #12S #[fg=default]| ' +set -g status-left-length 64 +set -g status-right '#[fg=blue]%b %d %H:%M' +set -g window-status-current-format '#[fg=blue]#I #W ' +set -g window-status-format '#I #W ' +set -g status + +# splitting +bind-key v split-window -h +bind-key b split-window +bind-key H set status + +# pane switching +bind h select-pane -L +bind j select-pane -D +bind k select-pane -U +bind l select-pane -R + +# pane resizing +bind-key -r M-k resize-pane -U 5 +bind-key -r M-j resize-pane -D 5 +bind-key -r M-h resize-pane -L 5 +bind-key -r M-l resize-pane -R 5 +bind-key -r C-k resize-pane -U +bind-key -r C-j resize-pane -D +bind-key -r C-h resize-pane -L +bind-key -r C-l resize-pane -R + +# vim copying +setw -g mode-keys vi +bind-key -t vi-copy 'v' begin-selection +bind-key -t vi-copy 'y' copy-selection + +# Similar to 'C-w j' to navigate windows in Vim +unbind-key j +bind-key j select-pane -D +unbind-key k +bind-key k select-pane -U +unbind-key h +bind-key h select-pane -L +unbind-key l +bind-key l select-pane -R + +# Enable mouse support (works in iTerm) +# set-window-option -g mode-mouse on +# set-option -g mouse-select-pane on +# set-option -g mouse-resize-pane on +set -g mouse on + +# Start windows and panes at 1, not 0 +set -g base-index 1 +set -g pane-base-index 1 + +# If we want Vim to be told about focus: http://git.io/2UqSgQ +set -g focus-events on + +# fix pbcopy/pbpaste +if 'command -v reattach-to-user-namespace >/dev/null' \ + 'set -gq @osx-pasteboard true' +if 'tmux show -gv @osx-clipboard' \ + 'set -g default-command "reattach-to-user-namespace -l $SHELL"' + +# Copy top of tmux paste buffer stack to OS clipboard. +# Alternatively, this will always immediately copy to system pasteboard: +# bind-key -t vi-copy y copy-pipe "reattach-to-user-namespace pbcopy" +if 'tmux show -gv @osx-clipboard' \ + 'bind y run "tmux save-buffer - | reattach-to-user-namespace pbcopy"' + +is_vim='echo "#{pane_current_command}" | grep -iqE "(^|\/)g?(view|n?vim?)(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" +bind -n C-l if-shell "$is_vim" "send-keys C-l" "select-pane -R" +bind -n C-\ if-shell "$is_vim" "send-keys C-\\" "select-pane -l" + +# present a menu of URLs to open from the visible pane. sweet. +bind-key u capture-pane \;\ + save-buffer /tmp/tmux-buffer \;\ + split-window -l 10 "urlview /tmp/tmux-buffer" + +# List of plugins +set -g @plugin 'tmux-plugins/tpm' +set -g @plugin 'tmux-plugins/tmux-sensible' +set -g @plugin 'tmux-plugins/tmux-resurrect' + +# Initialize TMUX plugin manager (keep this line at the very bottom of tmux.conf) +run '~/.tmux/plugins/tpm/tpm' + +set -g @resurrect-save 'S' +set -g @resurrect-restore 'R' + diff --git a/x/.xinitrc b/x/.xinitrc deleted file mode 100644 index 1420934..0000000 --- a/x/.xinitrc +++ /dev/null @@ -1,52 +0,0 @@ -#!/bin/sh - -userresources=$HOME/.Xresources -usermodmap=$HOME/.Xmodmap -sysresources=/etc/X11/xinit/.Xresources -sysmodmap=/etc/X11/xinit/.Xmodmap - -# merge in defaults and keymaps - -if [ -f $sysresources ]; then - - - - - - - - xrdb -merge $sysresources - -fi - -if [ -f $sysmodmap ]; then - xmodmap $sysmodmap -fi - -if [ -f "$userresources" ]; then - - - - - - - - xrdb -merge "$userresources" - -fi - -if [ -f "$usermodmap" ]; then - xmodmap "$usermodmap" -fi - -# start some nice programs - -if [ -d /etc/X11/xinit/xinitrc.d ] ; then - for f in /etc/X11/xinit/xinitrc.d/?*.sh ; do - [ -x "$f" ] && . "$f" - done - unset f -fi - -sxhkd & -exec bspwm