-
Notifications
You must be signed in to change notification settings - Fork 627
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
8 changed files
with
143 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
#!<%= ENV["SHELL"] || "/bin/bash" %> | ||
wemux ls 2>/dev/null | ||
|
||
if [ "$?" -eq 127 ]; then | ||
cd <%= root || "." %> | ||
|
||
# Run pre command. | ||
<%= pre %> | ||
|
||
# Create the session and the first window. | ||
TMUX= <%= tmux %> new-session -d -s <%= name %> -n <%= windows.first.name %> | ||
|
||
# Set the default path. | ||
<%= tmux %> set-option -t <%= name %> default-path <%= root.shellescape -%> 1>/dev/null | ||
|
||
# Create other windows. | ||
<%- windows.drop(1).each do |window| -%> | ||
<%= window.tmux_new_window_command %> | ||
<%- end -%> | ||
<%- windows.each do |window| -%> | ||
|
||
# Window "<%= window.name %>" | ||
<%- unless window.panes? -%> | ||
<%= window.tmux_pre_window_command %> | ||
<%- window.commands.each do |command| -%> | ||
<%= command %> | ||
<%- end -%> | ||
<%- else -%> | ||
<%- window.panes.each do |pane| -%> | ||
<%= pane.tmux_pre_window_command %> | ||
<%= pane.tmux_pre_command %> | ||
<%- if pane.multiple_commands? %> | ||
<%- pane.commands.each do |command| -%> | ||
<%= pane.tmux_main_command(command) %> | ||
<%- end -%> | ||
<%- else -%> | ||
<%= pane.tmux_main_command(commands.first) %> | ||
<%- end -%> | ||
<%- unless pane.last? -%> | ||
<%= pane.tmux_split_command %> | ||
<%- end -%> | ||
<%= window.tmux_layout_command %> | ||
<%- end -%> | ||
<%= window.tmux_select_first_pane %> | ||
<%- end -%> | ||
<%- end -%> | ||
<%= tmux %> select-window -t <%= base_index %> | ||
fi | ||
|
||
wemux attach |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
module Tmuxinator | ||
module WemuxSupport | ||
def wemux? | ||
yaml["tmux_command"] == "wemux" | ||
end | ||
|
||
def load_wemux_overrides | ||
self.instance_eval do | ||
def render | ||
template = File.read(Tmuxinator::Config.wemux_template) | ||
Erubis::Eruby.new(template).result(binding) | ||
end | ||
|
||
def name | ||
"wemux" | ||
end | ||
|
||
def tmux | ||
"wemux" | ||
end | ||
end | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
# ~/.tmuxinator/sample_wemux.yml | ||
# you can make as many tabs as you wish... | ||
|
||
name: sample | ||
root: ~/test | ||
pre: sudo /etc/rc.d/mysqld start # Runs before everything | ||
pre_window: rbenv shell 2.0.0-p247 # Runs in each tab and pane | ||
tmux_options: -f ~/.tmux.mac.conf # Pass arguments to tmux | ||
tmux_command: wemux | ||
windows: | ||
- editor: | ||
pre: | ||
- echo "I get run in each pane, before each pane command!" | ||
- | ||
layout: main-vertical | ||
panes: | ||
- vim | ||
- #empty, will just run plain bash | ||
- top | ||
- shell: | ||
- git pull | ||
- git merge | ||
- guard: | ||
layout: tiled | ||
pre: | ||
- echo "I get run in each pane." | ||
- echo "Before each pane command!" | ||
panes: | ||
- | ||
- #empty, will just run plain bash | ||
- | ||
- database: bundle exec rails db | ||
- server: bundle exec rails s | ||
- logs: tail -f log/development.log | ||
- console: bundle exec rails c | ||
- capistrano: | ||
- server: ssh user@example.com |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters