user can define hotkeys per session

This commit is contained in:
Vincent Wang 2011-12-22 11:21:38 +08:00
parent cea7045feb
commit 0884fbd431
2 changed files with 6 additions and 1 deletions

View File

@ -11,6 +11,10 @@ tmux <%= socket %> set-option -t <%=s @project_name %> default-path <%= @project
tmux <%= socket %> set-option -t <%=s @project_name%> <%= setting %>
<% end %>
<% hotkeys.each do |hotkey| %>
tmux <%= socket %> bind-key <%= hotkey %>
<% end %>
<% @tabs[1..-1].each_with_index do |tab, i| %>
tmux <%= socket %> new-window -t <%= window(i+2) %> -n <%=s tab.name %>
<% end %>

View File

@ -1,7 +1,7 @@
module Tmuxinator
class ConfigWriter
attr_accessor :file_name, :file_path, :project_name, :project_root, :rvm, :tabs, :pre, :settings
attr_accessor :file_name, :file_path, :project_name, :project_root, :rvm, :tabs, :pre, :settings, :hotkeys
include Tmuxinator::Helper
@ -56,6 +56,7 @@ module Tmuxinator
@tabs = []
@socket_name = yaml['socket_name']
@settings = ensure_list(yaml['settings'])
@hotkeys = ensure_list(yaml['hotkeys'])
yaml["tabs"].each do |tab|
t = OpenStruct.new