mirror of
https://github.com/jimeh/tmuxifier.git
synced 2026-02-19 09:56:39 +00:00
Compare commits
17 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 8987dd4492 | |||
| 9049818b25 | |||
| 47ef3bd857 | |||
| a9ca566c28 | |||
| 87e31a03c9 | |||
| 7f3ec1cd5b | |||
| 9baadfbb1e | |||
| 2adc885bb8 | |||
| 7cc0fa2d0e | |||
|
|
e41b15c515 | ||
|
|
690a4465b0 | ||
|
|
9bcfbd3428 | ||
| 7aeeaf31d1 | |||
| ca6dcfaaf2 | |||
|
|
fdbb1704e0 | ||
|
|
499c5abd83 | ||
|
|
3c37e18987 |
@@ -8,7 +8,7 @@ env:
|
|||||||
before_install:
|
before_install:
|
||||||
- sudo apt-get update
|
- sudo apt-get update
|
||||||
- sudo apt-get install -y bc build-essential libevent-dev libncurses5-dev
|
- sudo apt-get install -y bc build-essential libevent-dev libncurses5-dev
|
||||||
- wget http://downloads.sourceforge.net/tmux/tmux-${TMUX_VERSION}.tar.gz
|
- wget https://github.com/tmux/tmux/releases/download/${TMUX_VERSION}/tmux-${TMUX_VERSION}.tar.gz
|
||||||
- tar -zxf tmux-${TMUX_VERSION}.tar.gz
|
- tar -zxf tmux-${TMUX_VERSION}.tar.gz
|
||||||
- cd tmux-${TMUX_VERSION}
|
- cd tmux-${TMUX_VERSION}
|
||||||
- ./configure && make && sudo make install
|
- ./configure && make && sudo make install
|
||||||
|
|||||||
@@ -105,7 +105,7 @@ __In fish:__
|
|||||||
And add the following to your `~/.config/fish/config.fish` or equivalent:
|
And add the following to your `~/.config/fish/config.fish` or equivalent:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
eval (tmuxifier init -)
|
eval (tmuxifier init - fish)
|
||||||
```
|
```
|
||||||
|
|
||||||
### Custom Tmux Arguments
|
### Custom Tmux Arguments
|
||||||
|
|||||||
@@ -11,7 +11,10 @@ end
|
|||||||
# If `tmuxifier` is available, and `$TMUXIFIER_NO_COMPLETE` is not set, then
|
# If `tmuxifier` is available, and `$TMUXIFIER_NO_COMPLETE` is not set, then
|
||||||
# load Tmuxifier shell completion.
|
# load Tmuxifier shell completion.
|
||||||
if test -n (which tmuxifier); and test -z $TMUXIFIER_NO_COMPLETE
|
if test -n (which tmuxifier); and test -z $TMUXIFIER_NO_COMPLETE
|
||||||
|
# fish shell 2.0.0 does not have the source alias
|
||||||
|
if [ (fish --version 2>| awk -F'version ' '{print $2}') = '2.0.0' ];
|
||||||
|
. "$TMUXIFIER/completion/tmuxifier.fish"
|
||||||
|
else
|
||||||
source "$TMUXIFIER/completion/tmuxifier.fish"
|
source "$TMUXIFIER/completion/tmuxifier.fish"
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -105,6 +105,44 @@ select_pane() {
|
|||||||
tmuxifier-tmux select-pane -t "$session:$window.$1"
|
tmuxifier-tmux select-pane -t "$session:$window.$1"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# Balance windows vertically with the "even-vertical" layout.
|
||||||
|
#
|
||||||
|
# Arguments:
|
||||||
|
# - $1: (optional) Window ID or name to operate on.
|
||||||
|
#
|
||||||
|
balance_windows_vertical() {
|
||||||
|
tmuxifier-tmux select-layout -t "$session:${1:-$window}" even-vertical
|
||||||
|
}
|
||||||
|
|
||||||
|
# Balance windows horizontally with the "even-horizontal" layout.
|
||||||
|
#
|
||||||
|
# Arguments:
|
||||||
|
# - $1: (optional) Window ID or name to operate on.
|
||||||
|
#
|
||||||
|
balance_windows_horizontal() {
|
||||||
|
tmuxifier-tmux select-layout -t "$session:${1:-$window}" even-horizontal
|
||||||
|
}
|
||||||
|
|
||||||
|
# Turn on synchronize-panes in a window.
|
||||||
|
#
|
||||||
|
# Arguments:
|
||||||
|
# - $1: (optional) Window ID or name to operate on.
|
||||||
|
#
|
||||||
|
synchronize_on() {
|
||||||
|
tmuxifier-tmux set-window-option -t "$session:${1:-$window}" \
|
||||||
|
synchronize-panes on
|
||||||
|
}
|
||||||
|
|
||||||
|
# Turn off synchronize-panes in a window.
|
||||||
|
#
|
||||||
|
# Arguments:
|
||||||
|
# - $1: (optional) Window ID or name to operate on.
|
||||||
|
#
|
||||||
|
synchronize_off() {
|
||||||
|
tmuxifier-tmux set-window-option -t "$session:${1:-$window}" \
|
||||||
|
synchronize-panes off
|
||||||
|
}
|
||||||
|
|
||||||
# Send/paste keys to the currently active pane/window.
|
# Send/paste keys to the currently active pane/window.
|
||||||
#
|
#
|
||||||
# Arguments:
|
# Arguments:
|
||||||
@@ -245,7 +283,7 @@ initialize_session() {
|
|||||||
tmuxifier-tmux start-server
|
tmuxifier-tmux start-server
|
||||||
|
|
||||||
# Check if the named session already exists.
|
# Check if the named session already exists.
|
||||||
if tmuxifier-tmux has-session -t "$session:" 2>/dev/null; then
|
if tmuxifier-tmux list-sessions | grep -q "^$session:"; then
|
||||||
return 1
|
return 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|||||||
@@ -76,7 +76,12 @@ case "$shell" in
|
|||||||
;;
|
;;
|
||||||
fish )
|
fish )
|
||||||
echo "set -gx TMUXIFIER \"$TMUXIFIER\";"
|
echo "set -gx TMUXIFIER \"$TMUXIFIER\";"
|
||||||
|
# fish shell 2.0.0 does not have the source alias
|
||||||
|
if [[ $(fish --version 2>&1 | awk -F'version ' '{print $2}') = '2.0.0' ]]; then
|
||||||
|
echo ". \"\$TMUXIFIER/init.fish\";"
|
||||||
|
else
|
||||||
echo "source \"\$TMUXIFIER/init.fish\";"
|
echo "source \"\$TMUXIFIER/init.fish\";"
|
||||||
|
fi
|
||||||
;;
|
;;
|
||||||
* )
|
* )
|
||||||
echo "export TMUXIFIER=\"$TMUXIFIER\";"
|
echo "export TMUXIFIER=\"$TMUXIFIER\";"
|
||||||
|
|||||||
@@ -15,7 +15,7 @@ List all session layouts."
|
|||||||
exit
|
exit
|
||||||
fi
|
fi
|
||||||
|
|
||||||
list=$(find -L "$TMUXIFIER_LAYOUT_PATH" -name "*.session.sh")
|
list=$(find -L "$TMUXIFIER_LAYOUT_PATH" -name "*.session.sh" | sort)
|
||||||
for file in $list; do
|
for file in $list; do
|
||||||
file=${file/$TMUXIFIER_LAYOUT_PATH\//}
|
file=${file/$TMUXIFIER_LAYOUT_PATH\//}
|
||||||
echo "${file/.session.sh/}"
|
echo "${file/.session.sh/}"
|
||||||
|
|||||||
@@ -15,7 +15,7 @@ List all window layouts."
|
|||||||
exit
|
exit
|
||||||
fi
|
fi
|
||||||
|
|
||||||
list=$(find -L "$TMUXIFIER_LAYOUT_PATH" -name "*.window.sh")
|
list=$(find -L "$TMUXIFIER_LAYOUT_PATH" -name "*.window.sh" | sort)
|
||||||
for file in $list; do
|
for file in $list; do
|
||||||
file=${file/$TMUXIFIER_LAYOUT_PATH\//}
|
file=${file/$TMUXIFIER_LAYOUT_PATH\//}
|
||||||
echo "${file/.window.sh/}"
|
echo "${file/.window.sh/}"
|
||||||
|
|||||||
@@ -11,7 +11,7 @@ if calling-help "$@"; then
|
|||||||
|
|
||||||
Outputs current Tmux version. If given optional target-version it outputs one
|
Outputs current Tmux version. If given optional target-version it outputs one
|
||||||
of three possible characters indicating if the current Tmux version number is
|
of three possible characters indicating if the current Tmux version number is
|
||||||
equal to, less than, or greater than the [target-version].
|
equal to, less than, or greater than the <target-version>.
|
||||||
|
|
||||||
The three possible outputs are \"=\", \"<\", and \">\"."
|
The three possible outputs are \"=\", \"<\", and \">\"."
|
||||||
exit
|
exit
|
||||||
@@ -44,7 +44,16 @@ vercomp () {
|
|||||||
version=$(tmux -V)
|
version=$(tmux -V)
|
||||||
version=${version/tmux /}
|
version=${version/tmux /}
|
||||||
|
|
||||||
if [ -n "$1" ]; then
|
if [ -z "$1" ]; then
|
||||||
|
echo "$version"
|
||||||
|
exit
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [ "$version" == "master" ]; then
|
||||||
|
# When version string is "master", tmux was compiled from source, and we
|
||||||
|
# assume it's later than whatever the <target-version> is.
|
||||||
|
echo '>'
|
||||||
|
else
|
||||||
# Fix for "1.9a" version comparison, as vercomp() can only deal with
|
# Fix for "1.9a" version comparison, as vercomp() can only deal with
|
||||||
# purely numeric version numbers.
|
# purely numeric version numbers.
|
||||||
version=${version//+([a-zA-Z])/}
|
version=${version//+([a-zA-Z])/}
|
||||||
@@ -55,6 +64,4 @@ if [ -n "$1" ]; then
|
|||||||
1) echo '>';;
|
1) echo '>';;
|
||||||
2) echo '<';;
|
2) echo '<';;
|
||||||
esac
|
esac
|
||||||
else
|
|
||||||
echo "$version"
|
|
||||||
fi
|
fi
|
||||||
|
|||||||
@@ -13,4 +13,4 @@ Outputs Tmuxifier version."
|
|||||||
exit
|
exit
|
||||||
fi
|
fi
|
||||||
|
|
||||||
echo "0.12.2"
|
echo "0.13.0"
|
||||||
|
|||||||
Reference in New Issue
Block a user