在tmuxinator项目中指定窗格百分比

时间:2012-03-21 20:04:13

标签: tmux tmuxinator

如何在tmuxinator中指定窗格百分比?

例如:

 project_name: ad_dev
 project_root: ~/Programming/WWW/Rails/projects/ApparelDreamDev
 rvm: ruby-1.9.2-p290@apparel_dev
 pre: SQL
 tabs:
   - editor:
       layout: main-vertical
       panes:
         - vim 75%  
         - #empty, will just run plain bash
         - top

例如:vim窗格占据屏幕的75%...有没有办法指定这个?或者我应该在文档中的哪个位置?似乎无法在任何地方找到它。

1 个答案:

答案 0 :(得分:181)

应在layout:行中指定布局。但您不限于五种预设布局(例如主垂直)。来自man page

In addition, select-layout may be used to apply a previously used layout - 
the list-windows command displays the layout of each window in a form 
suitable for use with select-layout.  For example:

       $ tmux list-windows
       0: ksh [159x48]
           layout: bb62,159x48,0,0{79x48,0,0,79x48,80,0}
       $ tmux select-layout bb62,159x48,0,0{79x48,0,0,79x48,80,0}

 tmux automatically adjusts the size of the layout for the current window
 size.  Note that a layout cannot be applied to a window with more panes
 than that from which the layout was originally defined.

首先根据您的喜好设置您的布局 - 您可以使用resize-pane调整宽度,直到它适合您。然后运行tmux list-windows。然后你应该可以在tmuxinator.conf中使用输出中的layout:

所以基于你的要点的输出:

0: tmux [208x73] [layout b147,208x73,0,0[208x62,0,0,208x10,0,63{104x10,0,63,103x10,105,63}]] (active)

tmuxinator conf文件的相关部分应为:

  - editor:
       layout: b147,208x73,0,0[208x62,0,0,208x10,0,63{104x10,0,63,103x10,105,63}]
       panes:
         - vim
         - #empty, will just run plain bash
         - top