dot

packages and services management
Log | Files | Refs | README

commit 5cfacb4a65616b646a05a126712dc9cbbc03c724
parent ccf847c626ffb65b4cd1826f25f9c1a57115a939
Author: josuah <mail@josuah.net>
Date:   Tue,  4 Oct 2016 16:30:20 -0400

Added tmux new-session command

Diffstat:
Mshell/.profile | 7+------
Mtmux/.tmux.conf | 136+++++++++++++++++++++++++++++++++++++++++--------------------------------------
Atmux/.tmux/new-session | 15+++++++++++++++
3 files changed, 86 insertions(+), 72 deletions(-)

diff --git a/shell/.profile b/shell/.profile @@ -7,11 +7,6 @@ #\/============================================================================= -# Only load the .profile once -[ "$PREFIX_LOADED" = 1 ] && return 0 -export PROFILE_LOADED=1 - - # VARIABLES #------------------------------------------------------------------------------- @@ -274,4 +269,4 @@ then fi # Start tmux right away -command -v tmux &> /dev/null && [ -z "$TMUX" ] && tmux attach +command -v tmux &> /dev/null && [ -z "$TMUX" ] && tmux attach || : diff --git a/tmux/.tmux.conf b/tmux/.tmux.conf @@ -2,117 +2,121 @@ # / /_ ________ __ /\ __ __ # / ___\/ __ __ \ / / / / \ \' / # / / / / / / / // /_/ / ,' ,' -# \/ \/ \/ \/ \____/ /_,\_\ 2016-10-03 +# \/ \/ \/ \/ \____/ /_,\_\ 2016-10-04 #=============================================================================== # GLOBAL OPTIONS 2016-10-03 #------------------------------------------------------------------------------- -set -g base-index 1 -set -g pane-base-index 1 -set -g renumber-windows on -set -g display-time 2000 -set -g detach-on-destroy off +set -g base-index 1 +set -g pane-base-index 1 +set -g renumber-windows on +set -g display-time 2000 +set -g repeat-time 500 +set -g detach-on-destroy off -# KEYBINDINGS 2016-09-21 +# KEYBINDINGS 2016-10-04 # ------------------------------------------------------------------------------ -set -g prefix C-Space -unbind C-b -bind C-Space send-key C-Space +set -g status-keys vi -set-option -g status-keys vi +set -g prefix C-Space +unbind C-b +bind C-Space send-key C-Space # Copy mode -bind -t vi-copy v begin-selection -bind -t vi-copy C-v rectangle-toggle +bind -t vi-copy v begin-selection +bind -t vi-copy C-v rectangle-toggle bind -t vi-copy y copy-pipe 'xclip -i' -bind -n PPage if-shell -F '#{alternate_on}' \ +bind -n PPage if-shell -F '#{alternate_on}' \ 'send-keys PPage' 'copy-mode -e; send-keys PPage' -# Start from shell -bind r if-shell -F '#{alternate_on}' \ - 'run-shell "fzf-tmux"' 'send-keys "dmenu_run\n"' - # Pane management -bind -r k select-pane -U -bind -r j select-pane -D -bind -r h select-pane -L -bind -r l select-pane -R -bind -r o select-pane -t :.+ -bind -r C-k resize-pane -U 3 -bind -r C-j resize-pane -D 3 -bind -r C-h resize-pane -L 8 -bind -r C-l resize-pane -R 8 -bind % split-window -h -c '#{pane_current_path}' -bind '"' split-window -v -c '#{pane_current_path}' +bind -r k select-pane -U +bind -r j select-pane -D +bind -r h select-pane -L +bind -r l select-pane -R +bind -r o select-pane -t :.+ +bind -r C-k resize-pane -U 3 +bind -r C-j resize-pane -D 3 +bind -r C-h resize-pane -L 8 +bind -r C-l resize-pane -R 8 +bind % split-window -h -c '#{pane_current_path}' +bind '"' split-window -v -c '#{pane_current_path}' # Window management -bind -r < swap-window -t - -bind -r > swap-window -t + -bind -r p previous-window -bind -r n next-window -bind -r Tab last-window -bind c new-window -c '#{pane_current_path}' -bind C new-window +bind -r < swap-window -t - +bind -r > swap-window -t + +bind -r p previous-window +bind -r n next-window +bind -r Tab last-window +bind c new-window -c '#{pane_current_path}' +bind C new-window # Sessions management -bind -n C-z detach -bind S new-session \; command-prompt "rename-session '%%'" +bind -n C-z detach +bind S new-session \; send-keys ". ~/.tmux/new-session\n" # Reload config -bind r source-file ~/.tmux.conf\; display-message "Config reloaded" +bind r source-file ~/.tmux.conf\; display-message "Config loaded" -# APPEARANCE 2016-09-23 +# GLOBAL APPEARANCE 2016-10-04 #------------------------------------------------------------------------------- -set -g message-fg white -set -g message-bg black -set -g message-attr bright +# Messages +set -g message-style bold,fg=white +set -g message-command-style bg=green -set -g display-panes-colour red +# Display-panes mode +set -g display-panes-colour white +set -g display-panes-active-style fg=green +# Clock mode +set -g clock-mode-colour green +set -g clock-mode-style 24 -# STATUS 2016-10-03 +# Menus +set -g mode-style bold,fg=green + + +# STATUS 2016-10-04 #------------------------------------------------------------------------------- -set -g status-position top -set -g status-keys vi -set -g status-justify centre +# Layout +set -g status-position top +set -g status-justify centre -set -g status-left "#[bold,fg=green] #S " -set -g status-right " %y-%m-%d #[bold] %R " +# Left +set -g status-left " #S " +set -g status-left-style bold,fg=white -set -g status-fg white -set -g status-bg black +# Right +set -g status-right " %y-%m-%d #[bold] %R " +set -g status-right-style fg=white set -g window-status-separator " " +# Background windows set -g window-status-format \ " #{?window_zoomed_flag,[, }#I #W#{?window_zoomed_flag,], } " -set -g window-status-style bold -set -g window-status-fg black +set -g window-status-style bold,fg=black +# Foreground windows set -g window-status-current-format \ " #{?window_zoomed_flag,[, }#I #W#{?window_zoomed_flag,], } " -set -g window-status-current-style bold -set -g window-status-current-fg white - -set -g window-status-bell-fg red -set -g window-status-bell-bg white +set -g window-status-current-style bold,fg=green -set -g window-status-activity-fg yellow -set -g window-status-activity-bg white +# Urgent windows +set -g window-status-bell-style fg=white,bg=red +set -g window-status-activity-style fg=white,bg=yellow -# BORDERS 2016-10-03 +# BORDERS 2016-10-04 #------------------------------------------------------------------------------- -set -g pane-border-style bold -set -g pane-border-fg white -set -g pane-active-border-style bold -set -g pane-active-border-fg green +set -g pane-border-style bold,fg=white +set -g pane-active-border-style bold,fg=green set -g pane-border-status top set -g pane-border-format " #{pane_index} #{pane_current_command} " diff --git a/tmux/.tmux/new-session b/tmux/.tmux/new-session @@ -0,0 +1,15 @@ +#!/bin/sh + +dir="$( + find "$HOME/" -maxdepth 3 ! -path '*/.*' -type d | while read line + do printf '%s\n' "~${line#$HOME}" + done | fzf --margin=4,8 +)" + +cd "$HOME${dir#\~}" + +dir="${dir##*/}" +dir="$(printf '%s\n' "$dir" | cut -c 1 | tr [a-z] [A-Z])${dir#?}" +tmux rename-session "$dir" + +clear