mirror of
https://github.com/jimeh/tmuxifier.git
synced 2026-02-19 09:56:39 +00:00
Compare commits
16 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| da1354d5b7 | |||
| f01c789de4 | |||
| b52ef20be8 | |||
|
|
212693b1e9 | ||
| 908152bb57 | |||
| a0365273d0 | |||
| 6c8777adc2 | |||
|
|
5e33aefa7d | ||
| e15ae597e4 | |||
| d982588302 | |||
|
|
0fc1f20af7 | ||
|
|
8c2582a948 | ||
| c1ecc0a7c8 | |||
| 85718b9a9e | |||
| 1b5c451e39 | |||
| 887bbc4fbc |
2
LICENSE
2
LICENSE
@@ -1,4 +1,4 @@
|
|||||||
Copyright (c) 2012 Jim Myhrberg.
|
Copyright (c) 2013 Jim Myhrberg.
|
||||||
|
|
||||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||||
of this software and associated documentation files (the "Software"), to deal
|
of this software and associated documentation files (the "Software"), to deal
|
||||||
|
|||||||
25
README.md
25
README.md
@@ -42,9 +42,7 @@ select_pane 0
|
|||||||
You can then load that window layout into a new window in the
|
You can then load that window layout into a new window in the
|
||||||
current tmux session using:
|
current tmux session using:
|
||||||
|
|
||||||
```bash
|
tmuxifier load-window example
|
||||||
tmuxifier load-window example
|
|
||||||
```
|
|
||||||
|
|
||||||
Which will yield a Tmux window looking like this:
|
Which will yield a Tmux window looking like this:
|
||||||
|
|
||||||
@@ -54,9 +52,7 @@ Which will yield a Tmux window looking like this:
|
|||||||
|
|
||||||
Clone the repo to your machine:
|
Clone the repo to your machine:
|
||||||
|
|
||||||
```bash
|
git clone https://github.com/jimeh/tmuxifier.git ~/.tmuxifier
|
||||||
git clone https://github.com/jimeh/tmuxifier.git ~/.tmuxifier
|
|
||||||
```
|
|
||||||
|
|
||||||
Then add `~/.tmuxifier/bin` to your PATH to make the `tmuxifier` executable
|
Then add `~/.tmuxifier/bin` to your PATH to make the `tmuxifier` executable
|
||||||
available to you:
|
available to you:
|
||||||
@@ -100,10 +96,8 @@ eval `tmuxifier init -`
|
|||||||
|
|
||||||
## Updating
|
## Updating
|
||||||
|
|
||||||
```bash
|
cd ~/.tmuxifier
|
||||||
cd ~/.tmuxifier
|
git pull
|
||||||
git pull
|
|
||||||
```
|
|
||||||
|
|
||||||
## Usage
|
## Usage
|
||||||
|
|
||||||
@@ -199,19 +193,10 @@ it does set itself apart in a number of ways:
|
|||||||
[tmuxinator]: https://github.com/aziz/tmuxinator
|
[tmuxinator]: https://github.com/aziz/tmuxinator
|
||||||
[rbenv]: https://github.com/sstephenson/rbenv
|
[rbenv]: https://github.com/sstephenson/rbenv
|
||||||
|
|
||||||
## Heed My Warning
|
|
||||||
|
|
||||||
Tmuxifier is pretty much an alpha product hacked together over a weekend at
|
|
||||||
this point. Documentation is sketchy at best, and things might drastically
|
|
||||||
change and/or break.
|
|
||||||
|
|
||||||
But if that doesn't put you off, please enjoy Tmuxifier :)
|
|
||||||
|
|
||||||
## Todos
|
## Todos
|
||||||
|
|
||||||
* Improve Readme, specially Usage section.
|
* Improve Readme, specially Usage section.
|
||||||
* Expand `help` command with details for most commands, rather than just the
|
* Write up a detailed reference for all available layout helper functions.
|
||||||
essential ones.
|
|
||||||
|
|
||||||
## License
|
## License
|
||||||
|
|
||||||
|
|||||||
@@ -45,6 +45,38 @@ split_h() {
|
|||||||
__go_to_window_or_session_path
|
__go_to_window_or_session_path
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# Split current window/pane vertically by line count.
|
||||||
|
#
|
||||||
|
# Arguments:
|
||||||
|
# - $1: (optional) Number of lines the new pane will use.
|
||||||
|
# - $2: (optional) Target pane ID to split in current window.
|
||||||
|
#
|
||||||
|
split_vl() {
|
||||||
|
if [ -n "$1" ]; then local count=(-l "$1"); fi
|
||||||
|
tmux split-window -t "$session:$window.$2" -v "${count[@]}"
|
||||||
|
__go_to_window_or_session_path
|
||||||
|
}
|
||||||
|
|
||||||
|
# Split current window/pane horizontally by column count.
|
||||||
|
#
|
||||||
|
# Arguments:
|
||||||
|
# - $1: (optional) Number of columns the new pane will use.
|
||||||
|
# - $2: (optional) Target pane ID to split in current window.
|
||||||
|
#
|
||||||
|
split_hl() {
|
||||||
|
if [ -n "$1" ]; then local count=(-l "$1"); fi
|
||||||
|
tmux split-window -t "$session:$window.$2" -h "${count[@]}"
|
||||||
|
__go_to_window_or_session_path
|
||||||
|
}
|
||||||
|
|
||||||
|
# Run clock mode.
|
||||||
|
#
|
||||||
|
# Arguments:
|
||||||
|
# - $1: (optional) Target pane ID in which to run
|
||||||
|
clock() {
|
||||||
|
tmux clock-mode -t "$session:$window.$1"
|
||||||
|
}
|
||||||
|
|
||||||
# Select a specific window.
|
# Select a specific window.
|
||||||
#
|
#
|
||||||
# Arguments:
|
# Arguments:
|
||||||
@@ -84,7 +116,7 @@ run_cmd() {
|
|||||||
send_keys "C-m" "$2"
|
send_keys "C-m" "$2"
|
||||||
}
|
}
|
||||||
|
|
||||||
# Cusomize session root path. Default is `$HOME`.
|
# Customize session root path. Default is `$HOME`.
|
||||||
#
|
#
|
||||||
# Arguments:
|
# Arguments:
|
||||||
# - $1: Directory path to use for session root.
|
# - $1: Directory path to use for session root.
|
||||||
@@ -112,11 +144,16 @@ window_root() {
|
|||||||
#
|
#
|
||||||
# Arguments:
|
# Arguments:
|
||||||
# - $1: Name of window layout to load.
|
# - $1: Name of window layout to load.
|
||||||
|
# - $2: Override default window name.
|
||||||
#
|
#
|
||||||
load_window() {
|
load_window() {
|
||||||
local file="$TMUXIFIER_LAYOUT_PATH/$1.window.sh"
|
local file="$TMUXIFIER_LAYOUT_PATH/$1.window.sh"
|
||||||
if [ -f "$file" ]; then
|
if [ -f "$file" ]; then
|
||||||
window="$1"
|
if [ $# -gt 1 ]; then
|
||||||
|
window="$2"
|
||||||
|
else
|
||||||
|
window="$1"
|
||||||
|
fi
|
||||||
source "$file"
|
source "$file"
|
||||||
window=
|
window=
|
||||||
|
|
||||||
@@ -138,6 +175,7 @@ load_session() {
|
|||||||
local file="$TMUXIFIER_LAYOUT_PATH/$1.session.sh"
|
local file="$TMUXIFIER_LAYOUT_PATH/$1.session.sh"
|
||||||
if [ -f "$file" ]; then
|
if [ -f "$file" ]; then
|
||||||
session="$1"
|
session="$1"
|
||||||
|
set_default_path=true
|
||||||
source "$file"
|
source "$file"
|
||||||
session=
|
session=
|
||||||
|
|
||||||
@@ -178,7 +216,8 @@ initialize_session() {
|
|||||||
# Set default-path for session
|
# Set default-path for session
|
||||||
if [ -n "$session_root" ] && [ -d "$session_root" ]; then
|
if [ -n "$session_root" ] && [ -d "$session_root" ]; then
|
||||||
cd "$session_root"
|
cd "$session_root"
|
||||||
tmux set-option -t "$session:" default-path "$session_root" 1>/dev/null
|
|
||||||
|
$set_default_path && tmux set-option -t "$session:" default-path "$session_root" 1>/dev/null
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# In order to ensure only specified windows are created, we move the
|
# In order to ensure only specified windows are created, we move the
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ set -e
|
|||||||
|
|
||||||
# Set shell to first argument that is not "-", "-h" or "--help".
|
# Set shell to first argument that is not "-", "-h" or "--help".
|
||||||
for arg in "$@"; do
|
for arg in "$@"; do
|
||||||
if [ "$arg" != "-" ] &&[ "$arg" != "-h" ] && [ "$arg" != "--help" ]; then
|
if [ "$arg" != "-" ] && [ "$arg" != "-h" ] && [ "$arg" != "--help" ]; then
|
||||||
shell="$arg"
|
shell="$arg"
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
|
|||||||
@@ -13,4 +13,4 @@ Outputs Tmuxifier version."
|
|||||||
exit
|
exit
|
||||||
fi
|
fi
|
||||||
|
|
||||||
echo "0.7.0"
|
echo "0.7.3"
|
||||||
|
|||||||
Reference in New Issue
Block a user