2017-07-19 70 views
0

当前,Sublime 2显示File> Open Recent下的8个项目。我希望将其翻倍至16倍。除了增加“打开项目”列表之外,我已搜索并未发现任何内容,但由于不使用项目,因此这不是正确的解决方案。任何人都可以提供帮助吗?提前致谢!如何增加Sublime Text 2中最近文件的数量?

回答

0

据我所知,没有设置控制这一点。但是,通过修改菜单内容,您可以扩展显示的项目数量。

要做到这一点,你可以按照下列步骤操作:

  • 安装PackageResourceViewer如果尚未安装
  • 从命令面板,选择PackageResourceViewer: Open Resource
  • 选择Default
  • 选择Main.sublime-menu资源

Thi s打开控制菜单包含的文件。在靠近山顶,你会看到类似这样的东西:

{ 
    "caption": "Open Recent", 
    "mnemonic": "R", 
    "children": 
    [ 
     { "command": "reopen_last_file", "caption": "Reopen Closed File" }, 
     { "caption": "-" }, 
     { "command": "open_recent_file", "args": {"index": 0 } }, 
     { "command": "open_recent_file", "args": {"index": 1 } }, 
     { "command": "open_recent_file", "args": {"index": 2 } }, 
     { "command": "open_recent_file", "args": {"index": 3 } }, 
     { "command": "open_recent_file", "args": {"index": 4 } }, 
     { "command": "open_recent_file", "args": {"index": 5 } }, 
     { "command": "open_recent_file", "args": {"index": 6 } }, 
     { "command": "open_recent_file", "args": {"index": 7 } }, 
     { "caption": "-" }, 
     { "command": "open_recent_folder", "args": {"index": 0 } }, 
     { "command": "open_recent_folder", "args": {"index": 1 } }, 
     { "command": "open_recent_folder", "args": {"index": 2 } }, 
     { "command": "open_recent_folder", "args": {"index": 3 } }, 
     { "command": "open_recent_folder", "args": {"index": 4 } }, 
     { "command": "open_recent_folder", "args": {"index": 5 } }, 
     { "command": "open_recent_folder", "args": {"index": 6 } }, 
     { "command": "open_recent_folder", "args": {"index": 7 } }, 
     { "caption": "-" }, 
     { "command": "clear_recent_files", "caption": "Clear Items" } 
    ] 
}, 

在这里,您可以通过添加额外的线open_recent_file与指标从8延续近期的文件数出16〜15(因为索引均为0基于),然后保存该文件。

作为一个侧面说明,这两个崇高文字2和崇高的文本3

在崇高的文本3本作品的Default/Main.sublime-menu创建一个包覆盖,这将崇高改为使用的菜单的出厂版本。如果未来版本的ST3以任何方式更新主菜单,您将不会被告知,并且可能会错过其他菜单更改和功能。你可以安装OverrideAudit,如果发生这种情况,它会发出警告。

这可能也是崇高的文本2担心(尽管OverrideAudit是ST3仅供参考,不能帮你在这里),但它是不可能的ST2将进行更新的进一步所以这可能是没有真正的后果。

+0

谢谢奥达,这对我有用!非常感谢。 –

0

我发现你实际上并不需要覆盖主菜单;
只需添加您自己的菜单,最终会出现。

(Linux版的路径对我来说,在崇高的文本3)创建这个新的文件
~/.config/sublime-text-3/Packages/User/Main.sublime-menu

在该文件中提出类似OdatNurd前面的回答的东西;

(我复制粘贴相同的内容到文件:
Context.sublime-menu
Side Bar.sublime-menu
具有相同的子菜单显示在那里)


我只是从我自己的首字母做了我自己的子菜单“榆树”,把我亲自使用的所有东西放在各种“子”子树中。

作为奖励,它会自动显示键盘快捷键相同的命令背后
所以我也把它作为我不经常使用,忘掉了键盘快捷键操作的提醒。


警告:张贴这之后,我意识到我这个工程的崇高文本3,而问题是对崇高的文本2.也许有人可以测试,如果这也适用于崇高文字2?


我的文件看起来是这样的:
(还增加了一些更多的想法(大量最近的文件旁边)为灵感)

[ 
    { 
     "caption" : "elm", 
     "mnemonic": "M", 
     "children": [ 
      { 
       "caption": "Open Recent", 
       "mnemonic": "R", 
       "children": [ 
        { "command": "reopen_last_file", "caption": "Reopen Closed File" }, 
        { "caption": "-" }, 
        { "command": "open_recent_file", "args": {"index": 0 } }, 
        { "command": "open_recent_file", "args": {"index": 1 } }, 
        // ... etc. 
        { "command": "open_recent_file", "args": {"index": 29 } }, 
       ], 
      }, 
      { 
       "caption": "Multi Line/Caret editing", 
       "children": [ 
        { 
         "caption": "split_selection_into_lines", 
         "command": "split_selection_into_lines", 
        }, 
        { 
         "caption": "Add caret above (select_lines)", 
         "command": "select_lines", 
         "args": {"forward": false}, 
        }, 
        { 
         "caption": "Add caret below (select_lines)", 
         "command": "select_lines", 
         "args": {"forward": true}, 
        }, 
       ] 
      }, 
      { 
       "caption": "Bookmarks", 
       "children": [ 
        { 
         "caption": "toggle_bookmark", 
         "command": "toggle_bookmark", 
        }, 
        { 
         "caption": "prev_bookmark", 
         "command": "prev_bookmark", 
        }, 
        { 
         "caption": "next_bookmark", 
         "command": "next_bookmark", 
        }, 
       ] 
      }, 
      { 
       "caption": "paste_from_history", 
       "command": "paste_from_history", 
      }, 
      { 
       "caption": "Jump to matching bracket", 
       "command": "move_to", "args": {"to": "brackets"}, 
      }, 
      // ... etc. etc. 
     ], 
    }, 
] 

咬下只是较新的文件的主题,但我认为这种方法可能也会同时改善其他可用性和可维护性方面:)