How to increase number of recent files in Sublime Text 3?

后端 未结 7 1923
刺人心
刺人心 2020-12-22 23:49

Is it possible to increase the number of recent files that appear in the File -> Open recent menu in Sublime Text 3 (Ubuntu)?

I have already read Increase number of

7条回答
  •  既然无缘
    2020-12-23 00:10

    I have come recently to need these edition open files/folders.
    However, the catch is that I did not want to over-fill the main menu. I have created a submenu item which shows the other files/folders.

    In addtion to above excelent answers from @ptim and @MoonLite, I have created a submenus which prevents overcrowding it with numerous entries. On windows the path is (when using custom scoop directory: C:\app_scoop\apps\sublime-text\current\Data\Packages\Default).

    I have found out that you can acutally overload the menu. Just copy out the Main.sublime-menu; modify it with below code and place it into C:\app_scoop\apps\sublime-text\current\Data\Packages\Default and you will have custom menu with submenus.

    I'm sharing a submenu way to view the files/folders (using Directories instead of Folders to have easier shortcut F... Files, D ... directories):

     {
            "caption": "File",
            "mnemonic": "F",
            "id": "file",
            "children":
            [
                { "command": "new_file", "caption": "New File", "mnemonic": "N" },
    
                { "command": "prompt_open_file", "caption": "Open File…", "mnemonic": "O", "platform": "!OSX" },
                { "command": "prompt_open_folder", "caption": "Open Folder…", "platform": "!OSX" },
                { "command": "prompt_open", "caption": "Open…", "platform": "OSX" },
                {
                    "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": "-" },
                        { "caption": "More Recent Files",
                          "mnemonic": "F",
                          "children":
                          [
                            { "command": "open_recent_file", "args": {"index": 8 } },
                            { "command": "open_recent_file", "args": {"index": 9 } },
                            { "command": "open_recent_file", "args": {"index": 10 } },
                            { "command": "open_recent_file", "args": {"index": 11 } },
                            { "command": "open_recent_file", "args": {"index": 12 } },
                            { "command": "open_recent_file", "args": {"index": 13 } },
                            { "command": "open_recent_file", "args": {"index": 14 } },
                            { "command": "open_recent_file", "args": {"index": 15 } },
                            { "command": "open_recent_file", "args": {"index": 16 } },
                            { "command": "open_recent_file", "args": {"index": 17 } },
                            { "command": "open_recent_file", "args": {"index": 18 } },
                            { "command": "open_recent_file", "args": {"index": 19 } },
                            { "command": "open_recent_file", "args": {"index": 20 } },
                          ]
                        },
                        { "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": "-" },
                        { "caption": "More Recent Directories",
                          "mnemonic": "D",
                          "children":
                          [
                            { "command": "open_recent_folder", "args": {"index": 8 } },
                            { "command": "open_recent_folder", "args": {"index": 9 } },
                            { "command": "open_recent_folder", "args": {"index": 10 } },
                            { "command": "open_recent_folder", "args": {"index": 11 } },
                            { "command": "open_recent_folder", "args": {"index": 12 } },
                            { "command": "open_recent_folder", "args": {"index": 13 } },
                            { "command": "open_recent_folder", "args": {"index": 14 } },
                            { "command": "open_recent_folder", "args": {"index": 15 } },
                            { "command": "open_recent_folder", "args": {"index": 16 } },
                            { "command": "open_recent_folder", "args": {"index": 17 } },
                            { "command": "open_recent_folder", "args": {"index": 18 } },
                            { "command": "open_recent_folder", "args": {"index": 19 } },
                            { "command": "open_recent_folder", "args": {"index": 20 } },
                          ]
                        },
                        { "caption": "-" },
                        { "command": "clear_recent_files", "caption": "Clear Items" }
                    ]
                },
    
    ... (continued)
    

提交回复
热议问题