aboutsummaryrefslogtreecommitdiff
path: root/tmux
diff options
context:
space:
mode:
authorMitchell Riedstra <mitch@riedstra.dev>2024-01-27 10:30:19 -0500
committerMitchell Riedstra <mitch@riedstra.dev>2024-01-27 10:30:37 -0500
commit5962fcf05a2af92d5fc2e0990836a3af0e7fbdd3 (patch)
tree5cf1b4bb0a19acc889f7472ff5a8e7f6ad8b9120 /tmux
parent01349d12add3f9568c226acfdca0ec7dd368c061 (diff)
downloaddotfiles-5962fcf05a2af92d5fc2e0990836a3af0e7fbdd3.tar.gz
dotfiles-5962fcf05a2af92d5fc2e0990836a3af0e7fbdd3.tar.xz
Fix minor bugs. Sort Fedora packages. Add btop
Diffstat (limited to 'tmux')
-rw-r--r--tmux/tmux.conf89
-rw-r--r--tmux/tmux_helper.sh28
-rw-r--r--tmux/tmx.sh55
3 files changed, 0 insertions, 172 deletions
diff --git a/tmux/tmux.conf b/tmux/tmux.conf
deleted file mode 100644
index a47df0b..0000000
--- a/tmux/tmux.conf
+++ /dev/null
@@ -1,89 +0,0 @@
-set -g status-style "fg=green,bg=black"
-set-window-option -g window-status-current-style "bg=green,fg=black"
-set -g status-right "#[fg=black,bg=green] #(whoami)@#h|m:#(sh $HOME/.tmux_helper.sh memory)|l:#(sh $HOME/.tmux_helper.sh load)|#(sh $HOME/.tmux_helper.sh uptime)"
-# For a basic tmux configuration without the helper
-# set -g status-right "#[fg=black,bg=green] #(whoami)@#h"
-
-set -g status-position bottom
-# Despite my preference for vi bindings elsewhere
-set -g status-keys emacs
-
-# If you mark a pane with c-b m you can swap it tapping this
-bind -N "Swap with marked pane" M-S swap-pane
-bind -N "Swap with marked pane" '`' swap-pane
-
-# Pretty nifty little option to mirror input for all panes
-bind -N "Syncronize input between panes" M-s set synchronize-panes
-
-# Allow the hotkeys to be switched using M-x to C-x, M-b to C-b, and so forth
-bind -N "Change prefix" M-x set prefix C-x
-bind -N "Change prefix" M-b set prefix C-b
-bind -N "Change prefix" M-a set prefix C-a
-
-bind -N "Resize pane to 35% width" '|' resizep -x 35%
-bind -N "Resize pane to 35% height" '\' resizep -y 35%
-bind -N "Resize pane to 35% with and height, but prompt first" \
- '+' command-prompt -I "resizep -x 35% -y 35%"
-
-set -g mode-keys vi
-# set -g aggressive-resize on
-
-# This has previously not given me any issues other than 'set termguicolors' in
-# vim
-# set -g default-terminal "screen-256color"
-
-# This seems to fix that problem, it may cause other issues but I'm going to
-# keep an eye on it
-# set-option -g default-terminal "tmux-256color"
-set-option -g default-terminal "screen-256color"
-set-option -ga terminal-overrides ",xterm*:Tc"
-
-
-# Don't let command rename our windows
-set-option -g allow-rename off
-
-# Press v to "visually" and y to "yank" the text
-# Press `c-b ]` to paste
-# If you ever want to look up a keybind use `c-b ?`
-bind-key -T copy-mode-vi v send-keys -X begin-selection
-bind-key -T copy-mode-vi y send-keys -X copy-selection
-
-# This one is also useful if you don't want to do what is listed above
-# bind p paste-buffer
-
-# Rather large histroy buffer so I don't lose shit
-set-option -g history-limit 16000
-
-# Fix for certian applications such as Nvim
-set -sg escape-time 0
-
-# Select panes with vim like bindings
-bind-key -N "Select pane above" M-k select-pane -U
-bind-key -N "Select pane below" M-j select-pane -D
-bind-key -N "Select pane to the left" M-h select-pane -L
-bind-key -N "Select pane to the right" M-l select-pane -R
-
-
-# Reload configuration
-bind-key r source ~/.tmux.conf
-# Respawn the pane # Useful if you have `set -g remain-on-exit on` or so
-bind-key -N "Respawn pane" M-r respawn-pane
-
-# Change the status line a little bit, most are close to defaults
-set -g status-left-length 35
-set -g status-left "[#S] "
-
-set -g status-right-length 40
-set -g window-status-format "#I:#W#F"
-
-set -g set-titles on
-set -g set-titles-string "tmux: #{session_name} [#I]#{window_name} -- #T"
-
-
-# If you still want to select text out of the terminal as you normally would
-# You should hold the shift key ( Linux ) Option/Alt works in iTerm2 on MacOS
-# Does not seem to work with the native terminal.
-set -g mouse on
-
-# If you want any local configuration
-source ~/.tmux.conf.local
diff --git a/tmux/tmux_helper.sh b/tmux/tmux_helper.sh
deleted file mode 100644
index 7ce68bd..0000000
--- a/tmux/tmux_helper.sh
+++ /dev/null
@@ -1,28 +0,0 @@
-#!/bin/sh
-
-
-# Little helper script to clean up the nasty embeded commands in my tmux configuration
-# Functions ripped out of `mkshrc`, worth checking out
-
-_sys_memory() {
- if [ `uname` = "Linux" ] ; then
- vmstat | tail -n1 | awk '{print $4/1024}' | sed -e's/\..*$//g'
- elif [ `uname` = "FreeBSD" ] ; then
- vmstat | tail -n1 | awk '{print $5/1024}' | sed -e's/\..*$//g'
- elif [ `uname` = "OpenBSD" ] ; then
- vmstat | sed -n '$p' | awk '{print $4}' | sed 's/M$//'
- fi
-}
-
-_sys_load() {
- # Works on BSD too, neat.
- uptime | sed -re's/^.*load averages?: ([0-9]+\.[0-9]+).*$/\1/g'
-}
-
-_sys_uptime() {
- # Took awhile to figure out, but this works on BSD as well
- uptime | sed -re's/^.*up[ ]+//g' -e's/^([^,]*),.*/\1/g' -e's/^([^ ]+)[ ]*(.).*/\1\2/g'
-}
-
-
-_sys_$1
diff --git a/tmux/tmx.sh b/tmux/tmx.sh
deleted file mode 100644
index 0d66c27..0000000
--- a/tmux/tmx.sh
+++ /dev/null
@@ -1,55 +0,0 @@
-#!/bin/sh
-
-# Modified further by Mitchell Riedstra to be compatible with /bin/sh
-
-#
-# Modified TMUX start script from:
-# http://forums.gentoo.org/viewtopic-t-836006-start-0.html
-#
-# Store it to `~/bin/tmx` and issue `chmod +x`.
-#
-
-# Works because bash automatically trims by assigning to variables and by
-# passing arguments
-trim() { echo $1; }
-
-if [ -z "$1" ]; then
- echo "Specify session name as the first argument"
- exit
-fi
-
-# Only because I often issue `ls` to this script by accident
-if [ "$1" == "ls" ]; then
- tmux ls
- exit
-fi
-
-base_session="$1"
-# This actually works without the trim() on all systems except OSX
-tmux_nb=$(trim `tmux ls | grep "^$base_session" | wc -l`)
-if [ "$tmux_nb" == "0" ]; then
- echo "Launching tmux base session $base_session ..."
- tmux new-session -s $base_session
-else
- # Make sure we are not already in a tmux session
- if [ -z "$TMUX" ]; then
- # Kill defunct sessions first
- old_sessions=$(tmux ls 2>/dev/null | egrep "^[0-9]{14}.*[0-9]+\)$" | cut -f 1 -d:)
- for old_session_id in $old_sessions; do
- tmux kill-session -t $old_session_id
- done
-
- echo "Launching copy of base session $base_session ..."
- # Session is is date and time to prevent conflict
- session_id=`date +%Y%m%d%H%M%S`
- # Create a new session (without attaching it) and link to base session
- # to share windows
- tmux new-session -d -t $base_session -s $session_id
- # Create a new window in that session
- #tmux new-window
- # Attach to the new session
- tmux attach-session -t $session_id
- # When we detach from it, kill the session
- tmux kill-session -t $session_id
- fi
-fi