From 742b5307ee9636be12e68ef8b501e29f2a058efd Mon Sep 17 00:00:00 2001 From: Joao P Dubas Date: Wed, 11 Oct 2023 11:25:13 +0000 Subject: [PATCH] feat: add tmux and tmuxp Also add the respective configurations. --- Dockerfile | 2 + config/tmux/tmux.conf | 99 +++++++++++++++++++++++++++++++++++++++ config/tmuxp/dev.yml | 23 +++++++++ config/tmuxp/personal.yml | 15 ++++++ config/tmuxp/work | 15 ++++++ docker-compose.yml | 2 + 6 files changed, 156 insertions(+) create mode 100644 config/tmux/tmux.conf create mode 100644 config/tmuxp/dev.yml create mode 100644 config/tmuxp/personal.yml create mode 100644 config/tmuxp/work diff --git a/Dockerfile b/Dockerfile index 7766cf1..af95c30 100644 --- a/Dockerfile +++ b/Dockerfile @@ -59,6 +59,8 @@ RUN apt-get update \ python3-openssl \ sudo \ tk-dev \ + tmux \ + tmuxp \ unixodbc-dev \ unzip \ uuid-dev \ diff --git a/config/tmux/tmux.conf b/config/tmux/tmux.conf new file mode 100644 index 0000000..8f334c0 --- /dev/null +++ b/config/tmux/tmux.conf @@ -0,0 +1,99 @@ +# Based on: +# https://github.com/henrik/dotfiles/blob/master/tmux.conf + +# Remap Prefix to C-a +unbind C-b +set -g prefix C-a + +# Improve pane split +bind | split-window -h +bind - split-window -v + +# Improve pane move +bind h select-pane -L +bind j select-pane -D +bind k select-pane -U +bind l select-pane -R + +# Improve window move +bind -r C-h select-window -t :- +bind -r C-l select-window -t :+ + +# Improve resize pane +bind -r H resize-pane -L 5 +bind -r J resize-pane -D 5 +bind -r K resize-pane -U 5 +bind -r L resize-pane -R 5 + +# Enable vim keys +set-window-option -g mode-keys vi + +# Make [shift]-arrows, [ctrl]-arrows, etc work in vim +set -g xterm-keys on + +# Attempt to fixes slows [esc] issues +set -s escape-time 0 + +# Disable mouse +# set -g mode-mouse off + +# Status bar styling and content +set -g status-bg black +set -g status-fg white +# set -g status-left "#$" + +# Highlight the active window in the status bar +set-window-option -g window-status-current-bg yellow +set-window-option -g window-status-current-fg black + +# Don't prompt to kill panes/windows +bind-key x kill-pane +bind-key & kill-window + +# Reload tmux conf +unbind r +bind r source-file ~/.tmux.conf\; display "Reloaded conf." + +# Full color for vim +set -g default-terminal "screen-256color" + +#### COLOUR (Solarized 256) + +# default statusbar colors +set-option -g status-bg colour235 #base02 +set-option -g status-fg colour136 #yellow +set-option -g status-attr default + +# default window title colors +set-window-option -g window-status-fg colour244 #base0 +set-window-option -g window-status-bg default +#set-window-option -g window-status-attr dim + +# active window title colors +set-window-option -g window-status-current-fg colour166 #orange +set-window-option -g window-status-current-bg default +#set-window-option -g window-status-current-attr bright + +# pane border +set-option -g pane-border-fg colour235 #base02 +set-option -g pane-active-border-fg colour240 #base01 + +# message text +set-option -g message-bg colour235 #base02 +set-option -g message-fg colour166 #orange + +# pane number display +set-option -g display-panes-active-colour colour33 #blue +set-option -g display-panes-colour colour166 #orange + +# clock +set-window-option -g clock-mode-colour colour64 #green + +# list plugins +set -g @plugin 'tmux-plugins/tpm' +set -g @plugin 'Morantron/tmux-fingers' +set -g @plugin 'tmux-plugins/tmux-yank' +run '~/.tmux/plugins/tpm/tpm' + +# buffer size +set -g history-limit 50000 diff --git a/config/tmuxp/dev.yml b/config/tmuxp/dev.yml new file mode 100644 index 0000000..a498974 --- /dev/null +++ b/config/tmuxp/dev.yml @@ -0,0 +1,23 @@ +--- +session_name: dev +start_directory: /opt/work +windows: + - window_name: main + layout: even-vertical + focus: true + panes: + - focus: true + - pane + - window_name: support + layout: even-vertical + start_directory: support + panes: + - shell_command: + - docker compose exec pgcli bash + - pane + - window_name: local + layout: even-vertical + start_directory: local + panes: + - pane + - pane diff --git a/config/tmuxp/personal.yml b/config/tmuxp/personal.yml new file mode 100644 index 0000000..7287328 --- /dev/null +++ b/config/tmuxp/personal.yml @@ -0,0 +1,15 @@ +session_name: personal +start_directory: /opt/personal +windows: + - window_name: labs + focus: true + layout: even-vertical + start_directory: labs/ + panes: + - focus: true + - pane + - window_name: ide + layout: even-vertical + panes: + - focus: true + - pane diff --git a/config/tmuxp/work b/config/tmuxp/work new file mode 100644 index 0000000..7287328 --- /dev/null +++ b/config/tmuxp/work @@ -0,0 +1,15 @@ +session_name: personal +start_directory: /opt/personal +windows: + - window_name: labs + focus: true + layout: even-vertical + start_directory: labs/ + panes: + - focus: true + - pane + - window_name: ide + layout: even-vertical + panes: + - focus: true + - pane diff --git a/docker-compose.yml b/docker-compose.yml index 84086e2..fab67b2 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -12,6 +12,8 @@ services: - 'home_cache:/home/coder/.cache' - 'home_local_share:/home/coder/.local/share' - './config/rtx:/home/coder/.config/rtx' + - './config/tmux:/home/coder/.config/tmux' + - './config/tmuxp:/home/coder/.config/tmuxp' - './config/nvim/lua/custom:/home/coder/.config/nvim/lua/custom' volumes: