Skip to content

Instantly share code, notes, and snippets.

@Rplus
Last active August 29, 2015 14:28
Show Gist options
  • Save Rplus/e382b9b38038828dcb92 to your computer and use it in GitHub Desktop.
Save Rplus/e382b9b38038828dcb92 to your computer and use it in GitHub Desktop.
custom sublime text layout

og-image

1-
如果你已經會怎麼自訂 layout 了
那這篇怎麼定義工作區塊編號的文章你應該看得懂
https://www.sublimetext.com/forum/viewtopic.php?f=6&t=7284
可以自己寫個快速鍵處理,例如:

  {
    "keys": ["alt+end"],
    "command": "set_layout",
    "args":
    {
      "cols": [0.0, 1.0],
      "rows": [0.0, 0.95, 1.0],
      "cells": [[0, 0, 1, 1], [0, 1, 1, 2]]
    }
  }

2-
無腦一點可以裝裝 package 來簡易處理這些 layout
https://packagecontrol.io/search/Origami
( Origami​ 跟 Origami​Emacs 都還蠻好用的
( 不過要小心它可能會改到常用的快速鍵便是

3-
自定義選單
創建 Main.sublime-menu/Data/Packages/User/
複製一份原本 Sublime Text 的選單設定檔(json-like)
照著改一份自己的 layout 即可

[
{
"caption": "View",
"mnemonic": "V",
"id": "view",
"children":
[
{ "caption": "-", "id": "groups" },
{
"caption": "Layout",
"mnemonic": "L",
"id": "layout",
"children":
[
{
"caption": "Codepen-like",
"command": "set_layout",
"args":
{
"cols": [0.0, 0.3, 1.0],
"rows": [0.0, 0.33, 0.66, 1.0],
"cells": [[0, 0, 1, 1], [0,1,1,2], [0,2,1,3], [1,0,2,3]]
}
}
]
}
]
}
]
@Rplus
Copy link
Author

Rplus commented Aug 25, 2015

image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment