我想在我的工作中使用tmuxinator。我有一个文件夹,里面有几个文件,不超过6-7个文件。我想要配置tmuxinator,以便tmux有一个带有拆分窗格的窗口,所有这些窗格都分配给文件夹中的特定文件。
tmuxinator项目的流程如下:
name: case
root: <%= ENV["PWD"] %>
windows:
setup:
panes:
- < this list should change dynamically>
有什么想法吗?
发布于 2018-11-28 19:21:21
我发现它提供了如下循环块:
<%- `find . -maxdepth 1 -type f`.split("\n").each do |item| %>
- <%= item.chomp %>: vim <%= item %>
<%- end >
因此,我之前的问题是
name: case
root: <%= ENV["PWD"] %>
windows:
setup:
panes:
<%- `find . -maxdepth 1 -type f`.split("\n").each do |item| %>
- <%= item.chomp %>: vim <%= item %>
<%- end >
发布于 2018-11-30 12:30:59
另一个更灵活的选择是使用CLI args将文件列表传递给tmuxinator。
例如,您可以将项目配置文件更改为以下内容:
name: case
windows:
- setup:
panes:
<%- args.each do |file| %>
- vim <%= file %>
<%- end %>
..。然后使用tmuxinator start case $(find . -maxdepth 1 -type f)
启动tmuxinator
https://stackoverflow.com/questions/53505256
复制相似问题