From 9c6b47f9b348de632e740b7e92223c2a2cfcbd9d Mon Sep 17 00:00:00 2001 From: Joao P Dubas Date: Wed, 11 Oct 2023 11:25:13 +0000 Subject: [PATCH 1/4] 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 f20ddc2..267a7fc 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: -- 2.47.2 From 041ca8f1faead679dc90528790f2520a7c1af4f4 Mon Sep 17 00:00:00 2001 From: Joao P Dubas Date: Sun, 15 Oct 2023 20:53:13 +0000 Subject: [PATCH 2/4] fix(tmux): use proper name for tmuxp configurations --- config/tmuxp/work | 15 --------------- config/tmuxp/{personal.yml => work.yml} | 0 2 files changed, 15 deletions(-) delete mode 100644 config/tmuxp/work rename config/tmuxp/{personal.yml => work.yml} (100%) diff --git a/config/tmuxp/work b/config/tmuxp/work deleted file mode 100644 index 7287328..0000000 --- a/config/tmuxp/work +++ /dev/null @@ -1,15 +0,0 @@ -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/personal.yml b/config/tmuxp/work.yml similarity index 100% rename from config/tmuxp/personal.yml rename to config/tmuxp/work.yml -- 2.47.2 From 2a641a01583f8c3074a1ebb21d3953769496409f Mon Sep 17 00:00:00 2001 From: Joao P Dubas Date: Sun, 15 Oct 2023 20:53:57 +0000 Subject: [PATCH 3/4] chore(tmux): use XDG_CONFIG_HOME to setup plugins Also update tmux config to reflect this change, and mount a plugin dir. --- config/tmux/tmux.conf | 8 ++++---- docker-compose.yml | 6 ++++-- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/config/tmux/tmux.conf b/config/tmux/tmux.conf index 8f334c0..4191da8 100644 --- a/config/tmux/tmux.conf +++ b/config/tmux/tmux.conf @@ -89,11 +89,11 @@ set-option -g display-panes-colour colour166 #orange # clock set-window-option -g clock-mode-colour colour64 #green +# buffer size +set -g history-limit 50000 + # 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 +run '~/.config/tmux/plugins/tpm/tpm' diff --git a/docker-compose.yml b/docker-compose.yml index fab67b2..fd8a816 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -9,13 +9,15 @@ services: entrypoint: sleep command: infinity volumes: - - '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' + - 'home_cache:/home/coder/.cache' + - 'home_local_share:/home/coder/.local/share' + - 'home_plugins_tmux:/home/coder/.config/tmux/plugins' volumes: home_cache: {} home_local_share: {} + home_plugins_tmux: {} -- 2.47.2 From 6aadc3965041cb34c384f301a8b83f932ce06f3f Mon Sep 17 00:00:00 2001 From: Joao P Dubas Date: Sun, 15 Oct 2023 20:55:03 +0000 Subject: [PATCH 4/4] feat(tmux): install tmux plugin manager --- Dockerfile | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 267a7fc..b4117c4 100644 --- a/Dockerfile +++ b/Dockerfile @@ -132,7 +132,8 @@ ENV SHELL /usr/bin/bash # command line utilities RUN curl https://rtx.pub/install.sh | sh \ - && curl -sS https://raw.githubusercontent.com/ajeetdsouza/zoxide/main/install.sh | bash + && curl -sS https://raw.githubusercontent.com/ajeetdsouza/zoxide/main/install.sh | bash \ + && git clone https://github.com/tmux-plugins/tpm.git ${XDG_CONFIG_HOME}/tmux/plugins/tpm # git configuration COPY ./patch/kickstart.nvim/updates.patch /tmp -- 2.47.2