From 44a63ba8a47359418f6fd6d68144b086190f9d6d Mon Sep 17 00:00:00 2001 From: Marko Korhonen Date: Sat, 3 Sep 2022 14:11:09 +0300 Subject: [PATCH] Zsh: move tmux lauch to it's own configuration file and make it the first one executed --- home/.config/zsh/01-tmux.zsh | 8 ++++++++ home/.config/zsh/{01-env.zsh => 02-env.zsh} | 0 .../.config/zsh/{02-plugins.zsh => 03-plugins.zsh} | 0 .../.config/zsh/{03-aliases.zsh => 04-aliases.zsh} | 0 home/.config/zsh/05-misc.zsh | 14 -------------- .../zsh/{04-keybinds.zsh => 06-keybinds.zsh} | 0 home/.config/zsh/07-misc.zsh | 5 +++++ home/.config/zsh/{06-pacman.zsh => 08-pacman.zsh} | 0 8 files changed, 13 insertions(+), 14 deletions(-) create mode 100644 home/.config/zsh/01-tmux.zsh rename home/.config/zsh/{01-env.zsh => 02-env.zsh} (100%) rename home/.config/zsh/{02-plugins.zsh => 03-plugins.zsh} (100%) rename home/.config/zsh/{03-aliases.zsh => 04-aliases.zsh} (100%) delete mode 100644 home/.config/zsh/05-misc.zsh rename home/.config/zsh/{04-keybinds.zsh => 06-keybinds.zsh} (100%) create mode 100644 home/.config/zsh/07-misc.zsh rename home/.config/zsh/{06-pacman.zsh => 08-pacman.zsh} (100%) diff --git a/home/.config/zsh/01-tmux.zsh b/home/.config/zsh/01-tmux.zsh new file mode 100644 index 0000000..3e329c8 --- /dev/null +++ b/home/.config/zsh/01-tmux.zsh @@ -0,0 +1,8 @@ +# Launch tmux if logging in over ssh +if [[ -z "$TMUX" ]] && [[ -n "$SSH_CONNECTION" ]]; then + if tmux has-session -t ssh_tmux &2>/dev/null; then + exec tmux -2 attach-session -t ssh_tmux + else + exec tmux -2 new-session -s ssh_tmux + fi +fi diff --git a/home/.config/zsh/01-env.zsh b/home/.config/zsh/02-env.zsh similarity index 100% rename from home/.config/zsh/01-env.zsh rename to home/.config/zsh/02-env.zsh diff --git a/home/.config/zsh/02-plugins.zsh b/home/.config/zsh/03-plugins.zsh similarity index 100% rename from home/.config/zsh/02-plugins.zsh rename to home/.config/zsh/03-plugins.zsh diff --git a/home/.config/zsh/03-aliases.zsh b/home/.config/zsh/04-aliases.zsh similarity index 100% rename from home/.config/zsh/03-aliases.zsh rename to home/.config/zsh/04-aliases.zsh diff --git a/home/.config/zsh/05-misc.zsh b/home/.config/zsh/05-misc.zsh deleted file mode 100644 index 68b0658..0000000 --- a/home/.config/zsh/05-misc.zsh +++ /dev/null @@ -1,14 +0,0 @@ -# Launch tmux if logging in over ssh -if [[ -z "$TMUX" ]] && [ "$SSH_CONNECTION" != "" ]; then - if tmux has-session &2>/dev/null; then - exec tmux attach-session -t ssh_tmux - else - exec tmux new-session -s ssh_tmux - fi -fi - -# share history between running zsh instances -setopt share_history - -# ignore commands with leading space from history -setopt histignorespace diff --git a/home/.config/zsh/04-keybinds.zsh b/home/.config/zsh/06-keybinds.zsh similarity index 100% rename from home/.config/zsh/04-keybinds.zsh rename to home/.config/zsh/06-keybinds.zsh diff --git a/home/.config/zsh/07-misc.zsh b/home/.config/zsh/07-misc.zsh new file mode 100644 index 0000000..7f84ba4 --- /dev/null +++ b/home/.config/zsh/07-misc.zsh @@ -0,0 +1,5 @@ +# share history between running zsh instances +setopt share_history + +# ignore commands with leading space from history +setopt histignorespace diff --git a/home/.config/zsh/06-pacman.zsh b/home/.config/zsh/08-pacman.zsh similarity index 100% rename from home/.config/zsh/06-pacman.zsh rename to home/.config/zsh/08-pacman.zsh