From 1da6e2625ff57146b52c915aa58fef7d15a4184f Mon Sep 17 00:00:00 2001 From: Maksim Totmin Date: Mon, 6 Jan 2025 16:12:11 +0700 Subject: [PATCH] add tmux config --- rockethype/config/tmux/statusbar | 11 +++++++++ rockethype/config/tmux/tmux.conf | 38 ++++++++++++++++++++++++++++++++ 2 files changed, 49 insertions(+) create mode 100755 rockethype/config/tmux/statusbar create mode 100644 rockethype/config/tmux/tmux.conf diff --git a/rockethype/config/tmux/statusbar b/rockethype/config/tmux/statusbar new file mode 100755 index 0000000..f32f126 --- /dev/null +++ b/rockethype/config/tmux/statusbar @@ -0,0 +1,11 @@ +#!/usr/bin/env bash + +##CPU loading +CPULOAD=$(top -bn1 | sed -n '/Cpu/p' | awk '{print $2}' | sed 's/..,//') + +##RAM usege +RAMLOAD=$(free | grep Mem | awk '{print $3/$2 * 100.0}' | cut -d. -f1) + +echo \ +"|  $CPULOAD% |" \ +" $RAMLOAD% " diff --git a/rockethype/config/tmux/tmux.conf b/rockethype/config/tmux/tmux.conf new file mode 100644 index 0000000..4925707 --- /dev/null +++ b/rockethype/config/tmux/tmux.conf @@ -0,0 +1,38 @@ +# tmux cozy config +set -g mouse on + +# Set the default terminal mode to 256color mode +set -g default-terminal "screen-256color" +set -g status-style fg=black,bg=blue + +# Start windows and panes at 1, not 0 +set -g base-index 1 +set -g pane-base-index 1 +set-window-option -g pane-base-index 1 +set-option -g renumber-windows on + +set -g @plugin 'tmux-plugins/tpm' +set -g @plugin 'tmux-plugins/tmux-sensible' +set -g @plugin 'christoomey/vim-tmux-navigator' +set -g @plugin 'tmux-plugins/tmux-yank' +set -g @plugin 'thewtex/tmux-mem-cpu-load' + +run '~/.tmux/plugins/tpm/tpm' + +# set vi-mode +set-window-option -g mode-keys vi +# keybindings +bind-key -T copy-mode-vi v send-keys -X begin-selection +bind-key -T copy-mode-vi C-v send-keys -X rectangle-toggle +bind-key -T copy-mode-vi y send-keys -X copy-selection-and-cancel + +unbind C-b +set -g prefix C-Space +bind C-Space send-prefix +bind '"' split-window -v -c "#{pane_current_path}" +bind % split-window -h -c "#{pane_current_path}" + +set -g status-interval 1 +set-option -g status-left "[ #S]" +set-option -g status-right "#(~/.config/tmux/statusbar)" +