Skip to content

Commit

Permalink
fix: Refine TMUX configuration files and key bindings (#107)
Browse files Browse the repository at this point in the history
  • Loading branch information
mdsanima authored Jun 16, 2024
1 parent 2aabaaa commit 5f55b63
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 28 deletions.
40 changes: 20 additions & 20 deletions config/tmux/mdsanima.conf
Original file line number Diff line number Diff line change
@@ -1,42 +1,42 @@
# Copyright (c) 2024 MDSANIMA DEV. All rights reserved.
# Licensed under the MIT license.

# This is a tmux custom session configuration settings for my home labs hosts
# like Raspberry Pi, nVidia Jetson Nano, Oracle Cloud, and other providers.
# This is a TMUX custom configuration settings for my home lab hosts. This configuration file is
# for Raspberry Pi and NVIDIA Jetson Nano, Oracle Cloud Infrastructure, and other clouds providers.

# For launch this configuration, type `tmux source-file mdsanima.conf` in the
# terminal and then connect to the session, type `tmux attach -t mdsanima`.
# Or if you are on tmux already just type `tmux source mdsanima.conf` to load.
# For launch this configuration just type `tmux source-file mdsanima.conf` in you shell terminal and
# then connect to the session, type `tmux attach -t mdsanima` to connect. Or if you are on TMUX
# already just type `tmux source mdsanima.conf` to load. This is still work in progress.

# Uncomment the ssh options if you want to connect for the host.

# Custom names for session, and first window
rename-session mdsanima
rename-window dev

# Create new window, and panes for nVidia Jetson Nano hosts
new-window -n "jet" #"ssh mdsanima@jet-1"
split-window -h -p 50 #"ssh mdsanima@jet-2"
# Create new window, and panes for Jetson Nano hosts
new-window -n "jet" #"ssh mdsanima@jet-1"
split-window -h -p 50 #"ssh mdsanima@jet-2"

# Create new window, and panes for Raspberry Pi hosts
new-window -n "rpi" #"ssh mdsanima@rpi-0"
split-window -v -p 50 #"ssh mdsanima@rpi-4"
new-window -n "rpi" #"ssh mdsanima@rpi-0"
split-window -v -p 50 #"ssh mdsanima@rpi-4"
select-pane -t 1
split-window -h -p 75 #"ssh mdsanima@rpi-1"
split-window -h -p 67 #"ssh mdsanima@rpi-2"
split-window -h -p 50 #"ssh mdsanima@rpi-3"
split-window -h -p 75 #"ssh mdsanima@rpi-1"
split-window -h -p 67 #"ssh mdsanima@rpi-2"
split-window -h -p 50 #"ssh mdsanima@rpi-3"
select-pane -t 5
split-window -h -p 75 #"ssh mdsanima@rpi-5"
split-window -h -p 67 #"ssh mdsanima@rpi-6"
split-window -h -p 50 #"ssh mdsanima@rpi-7"
split-window -h -p 75 #"ssh mdsanima@rpi-5"
split-window -h -p 67 #"ssh mdsanima@rpi-6"
split-window -h -p 50 #"ssh mdsanima@rpi-7"

# Create new window, and panes for Oracle Cloud hosts
new-window -n "oracle" #"ssh oracle-node-1"
split-window -v -p 50 #"ssh oracle-node-3"
new-window -n "oci" #"ssh oracle-node-1"
split-window -v -p 50 #"ssh oracle-node-3"
select-pane -t 1
split-window -h -p 50 #"ssh oracle-node-2"
split-window -h -p 50 #"ssh oracle-node-2"
select-pane -t 3
split-window -h -p 50 #"ssh oracle-node-4"
split-window -h -p 50 #"ssh oracle-node-4"

# Back to the dev window
select-window -t dev
16 changes: 8 additions & 8 deletions config/tmux/tmux.conf
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
# Copyright (c) 2024 MDSANIMA DEV. All rights reserved.
# Licensed under the MIT license.

# This is a tmux base global configuration settings for my home lab hosts and
# is simple as possible. Check out the other custom configuration files.
# This is a TMUX base global configuration settings for my home lab hosts. This is simple as
# possible. Check out the other custom configuration file for the full details.

# Unbind default prefix
unbind C-b
Expand All @@ -19,7 +19,7 @@ set-option -sa terminal-overrides ",xterm-256color:Tc"
set -g history-limit 100000
set -g display-time 1000

# Enable vim moiton and full mouse support
# Enable Vim moiton and full mouse support
set -g mode-keys vi
set -g mouse on

Expand All @@ -30,20 +30,20 @@ set -g automatic-rename on
set -g renumber-windows on

# ALT+R => Reload tmux.conf does not reset current config
bind-key -n M-r source "$HOME/.config/tmux/tmux.conf" \; display-message "Config reloaded..."
bind-key -n M-r source "$HOME/.config/tmux/tmux.conf" \; display-message "Config reloaded ..."

# ALT+J => New window
bind-key -n M-j new-window

# ALT+H or ALT+L => Select window to the left or the right
bind-key -n M-h select-window -t :-
bind-key -n M-l select-window -t :+
# ALT+SHIFT+H or ALT+SHIFT+L => Select window to the left or the right
bind-key -n M-H select-window -t :-
bind-key -n M-L select-window -t :+

# ALT+B or ALT+V => Split window and set path as the current directory
bind-key -n M-b split-window -v -c "#[pane_current_path]"
bind-key -n M-v split-window -h -c "#[pane_current_path]"

# CTRL+Vim style => Switch panes
# CTRL+VimStyle => Switch panes
bind-key -n C-h select-pane -L
bind-key -n C-j select-pane -D
bind-key -n C-k select-pane -U
Expand Down

0 comments on commit 5f55b63

Please sign in to comment.