From 675a2d9922ffc1f2cf88dd3d871f22136b7e525c Mon Sep 17 00:00:00 2001 From: Billy Mathews Date: Wed, 17 Jan 2018 00:08:38 +0000 Subject: feat(tmux): add `tmuxconf` alias to edit .tmux.conf (#6555) Closes #6555 --- plugins/tmux/README.md | 21 +++++++++++---------- plugins/tmux/tmux.plugin.zsh | 1 + 2 files changed, 12 insertions(+), 10 deletions(-) (limited to 'plugins/tmux') diff --git a/plugins/tmux/README.md b/plugins/tmux/README.md index 551814a39..bc192a40c 100644 --- a/plugins/tmux/README.md +++ b/plugins/tmux/README.md @@ -15,20 +15,21 @@ The plugin also supports the following: ## Aliases -| Alias | Command | Description | -| ------ | -----------------------|---------------------------------------------------------- | -| `ta` | tmux attach -t | Attach new tmux session to already running named session | -| `tad` | tmux attach -d -t | Detach named tmux session | -| `ts` | tmux new-session -s | Create a new named tmux session | -| `tl` | tmux list-sessions | Displays a list of running tmux sessions | -| `tksv` | tmux kill-server | Terminate all running tmux sessions | -| `tkss` | tmux kill-session -t | Terminate named running tmux session | -| `tmux` | `_zsh_tmux_plugin_run` | Start a new tmux session | +| Alias | Command | Description | +| ---------- | ---------------------- | -------------------------------------------------------- | +| `ta` | tmux attach -t | Attach new tmux session to already running named session | +| `tad` | tmux attach -d -t | Detach named tmux session | +| `ts` | tmux new-session -s | Create a new named tmux session | +| `tl` | tmux list-sessions | Displays a list of running tmux sessions | +| `tksv` | tmux kill-server | Terminate all running tmux sessions | +| `tkss` | tmux kill-session -t | Terminate named running tmux session | +| `tmux` | `_zsh_tmux_plugin_run` | Start a new tmux session | +| `tmuxconf` | `$EDITOR ~/.tmux.conf` | Open .tmux.conf file with an editor | ## Configuration Variables | Variable | Description | -|-------------------------------------|-------------------------------------------------------------------------------| +| ----------------------------------- | ----------------------------------------------------------------------------- | | `ZSH_TMUX_AUTOSTART` | Automatically starts tmux (default: `false`) | | `ZSH_TMUX_AUTOSTART_ONCE` | Autostart only if tmux hasn't been started previously (default: `true`) | | `ZSH_TMUX_AUTOCONNECT` | Automatically connect to a previous session if it exits (default: `true`) | diff --git a/plugins/tmux/tmux.plugin.zsh b/plugins/tmux/tmux.plugin.zsh index 5474c3522..9d333257e 100644 --- a/plugins/tmux/tmux.plugin.zsh +++ b/plugins/tmux/tmux.plugin.zsh @@ -11,6 +11,7 @@ alias ts='tmux new-session -s' alias tl='tmux list-sessions' alias tksv='tmux kill-server' alias tkss='tmux kill-session -t' +alias tmuxconf='$EDITOR ~/.tmux.conf' # CONFIGURATION VARIABLES # Automatically start tmux -- cgit v1.2.3-70-g09d2 From ad8220bc6d4529db43c0968175f1b8d0e6637db0 Mon Sep 17 00:00:00 2001 From: ajr-dev Date: Thu, 27 Jan 2022 17:59:04 +0100 Subject: fix(tmux): use `$ZSH_TMUX_CONFIG` setting in tmuxconf alias --- plugins/tmux/README.md | 20 ++++++++++---------- plugins/tmux/tmux.plugin.zsh | 20 ++++++++++---------- 2 files changed, 20 insertions(+), 20 deletions(-) (limited to 'plugins/tmux') diff --git a/plugins/tmux/README.md b/plugins/tmux/README.md index bc192a40c..7348f77c9 100644 --- a/plugins/tmux/README.md +++ b/plugins/tmux/README.md @@ -15,16 +15,16 @@ The plugin also supports the following: ## Aliases -| Alias | Command | Description | -| ---------- | ---------------------- | -------------------------------------------------------- | -| `ta` | tmux attach -t | Attach new tmux session to already running named session | -| `tad` | tmux attach -d -t | Detach named tmux session | -| `ts` | tmux new-session -s | Create a new named tmux session | -| `tl` | tmux list-sessions | Displays a list of running tmux sessions | -| `tksv` | tmux kill-server | Terminate all running tmux sessions | -| `tkss` | tmux kill-session -t | Terminate named running tmux session | -| `tmux` | `_zsh_tmux_plugin_run` | Start a new tmux session | -| `tmuxconf` | `$EDITOR ~/.tmux.conf` | Open .tmux.conf file with an editor | +| Alias | Command | Description | +| ---------- | -------------------------- | -------------------------------------------------------- | +| `ta` | tmux attach -t | Attach new tmux session to already running named session | +| `tad` | tmux attach -d -t | Detach named tmux session | +| `ts` | tmux new-session -s | Create a new named tmux session | +| `tl` | tmux list-sessions | Displays a list of running tmux sessions | +| `tksv` | tmux kill-server | Terminate all running tmux sessions | +| `tkss` | tmux kill-session -t | Terminate named running tmux session | +| `tmux` | `_zsh_tmux_plugin_run` | Start a new tmux session | +| `tmuxconf` | `$EDITOR $ZSH_TMUX_CONFIG` | Open .tmux.conf file with an editor | ## Configuration Variables diff --git a/plugins/tmux/tmux.plugin.zsh b/plugins/tmux/tmux.plugin.zsh index 9d333257e..b9bb66d59 100644 --- a/plugins/tmux/tmux.plugin.zsh +++ b/plugins/tmux/tmux.plugin.zsh @@ -3,16 +3,6 @@ if ! (( $+commands[tmux] )); then return 1 fi -# ALIASES - -alias ta='tmux attach -t' -alias tad='tmux attach -d -t' -alias ts='tmux new-session -s' -alias tl='tmux list-sessions' -alias tksv='tmux kill-server' -alias tkss='tmux kill-session -t' -alias tmuxconf='$EDITOR ~/.tmux.conf' - # CONFIGURATION VARIABLES # Automatically start tmux : ${ZSH_TMUX_AUTOSTART:=false} @@ -40,6 +30,16 @@ alias tmuxconf='$EDITOR ~/.tmux.conf' # Set -u option to support unicode : ${ZSH_TMUX_UNICODE:=false} +# ALIASES + +alias ta='tmux attach -t' +alias tad='tmux attach -d -t' +alias ts='tmux new-session -s' +alias tl='tmux list-sessions' +alias tksv='tmux kill-server' +alias tkss='tmux kill-session -t' +alias tmuxconf='$EDITOR $ZSH_TMUX_CONFIG' + # Determine if the terminal supports 256 colors if [[ $terminfo[colors] == 256 ]]; then export ZSH_TMUX_TERM=$ZSH_TMUX_FIXTERM_WITH_256COLOR -- cgit v1.2.3-70-g09d2