自定义布局,Sublime text 2 [英] Custom layouts, Sublime text 2

查看:31
本文介绍了自定义布局,Sublime text 2的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

到目前为止,我一直在使用 2 列系统,但我觉得我需要第三列系统,如果不每次都调整宽度,那么在屏幕上分布的 3 列不会提供太多视图.

I've been working with a 2 column system so far but feel I'm needing a third and that 3 spread across the screen doesn't give much of a view without adjusting the width every time.

有一种方法可以获得网格布局,但屏幕的下半部分是一个文件.我知道这是一个很长的镜头,但想知道是否有人知道任何事情

It's there a way to get the grid layout but have the bottom half of the screen one file. I know it's a long shot but wondering if anyone knows of anything

发现可以在 Packages/default/Main.sublime-menu 中编辑自定义布局尽管 尝试解析文件时出错,但在保存时遇到问题: ~/library/application support/sublime text 2/packages/default/Main.sublime-menu:407:21 中的预期值

Found that you can edit for custom layouts in Packages/default/Main.sublime-menu Having problems saving though error in trying to parse file: expected value in ~/library/application support/sublime text 2/packages/default/Main.sublime-menu:407:21

为了更好的布局

发现类似的东西,一直在尝试修改它,但不明白细胞是如何工作的

Found something that is similar, been trying to mod it but don't understand how the cells work

这个很像

"args":
{
    "cols": [0.0, 0.5, 1.0],
    "rows": [0.0, 0.5, 1.0],
    "cells": [
        [0, 0, 1, 2], // (0.0, 0.0) -> (0.5, 1.0)
        [1, 0, 2, 1], // (0.5, 0.0) -> (1.0, 0.5)
        [1, 1, 2, 2]  // (0.5, 0.5) -> (1.0, 1.0)
    ]
}

这给了

推荐答案

假设这些只是左上角带有 0,0 的坐标,这样的事情应该可以工作:

Assuming these are just coordinates with 0,0 at the upper left, something like this should work:

[0, 0, 1, 1],
[1, 0, 2, 1],
[0, 1, 2, 2]


编辑:刚刚测试过,确实如此.


Edit: Just tested, and it does.

在您的 Packages > User 文件夹中创建文件 Main.sublime-menu(最好单独保留默认菜单)并将以下代码放入其中:

Create the file Main.sublime-menu in your Packages > User folder (best to leave the default menu alone) and put the following code in it:

[{
    "id": "view",
    "children": [{
        "id": "layout",
        "children": [{
             "command": "set_layout",
             "caption" : "Custom: 3 Pane",
             "mnemonic": "C",
             "args": {
                "cols": [0.0, 0.5, 1.0],
                "rows": [0.0, 0.5, 1.0],
                "cells": [
                    [0, 0, 1, 1],
                    [1, 0, 2, 1],
                    [0, 1, 2, 2]
                ]
            }
        }]
    }]
}]

您将在布局选项中看到 Custom: 3 Pane.无需重启 Sublime Text.

You will see Custom: 3 Pane in your layout options. No need to restart Sublime Text.

对于任何感兴趣的人,这里是一个要点,其中包含此布局以及翻转版本.

For anyone interested, here is a gist containing this layout as well as a flipped version.

这篇关于自定义布局,Sublime text 2的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆