sublime text : open containing folder

前端 未结 6 805

I\'m working on some file in my sublime text 2 editor, and I want to open a folder in which that file resides.

I know there is a 2 step procedure to do this already

相关标签:
6条回答
  • 2021-01-30 11:14

    This worked for me: assuming you have opened the file whose enclosing folder you want to open, use the Menu > Project > Add Folder To Project command.

    A new window should open with the enclosing folder. Just click 'Open' and you're done!

    0 讨论(0)
  • 2021-01-30 11:20

    I found this plugin: https://github.com/kallepersson/Sublime-Finder

    The instructions are pretty simple and straightforward. Now I just use CMD+SHIFT+P and type "finder" and press enter and it opens a finder window.

    I think this might only work on macs though.

    0 讨论(0)
  • 2021-01-30 11:25

    You can add the line below to your Default (Windows).sublime-keymap:

    { "keys": ["ctrl+alt+e"], "command": "open_dir", 
        "args": {"dir": "$file_path", "file": "$file_name"} }
    
    0 讨论(0)
  • 2021-01-30 11:27

    By default the editor has this item in context menu. If you need this feature on tabs you have to create a file with name "Tab Context.sublime-menu" in "\Data\Packages\User\" (if does not exist yet) and add this code:

    [
        {
            "caption": "-"
        },
        {
            "command": "open_dir",
            "args": {"dir": "$file_path", "file": "$file_name"},
            "caption": "Open Containing Folder…"
        }
    ]
    

    Do not forget formatting lines as a JSON file! If you do not need a separator before this menu item you need to delete first block with caption "-"! You can add any other menu in this file. For example:

    {
        "command": "copy_path",
        "caption": "Copy File Path"
    },
    
    0 讨论(0)
  • 2021-01-30 11:27

    Install Open project path by shortcut. Then setup keybindings in your User keymap file

    {
      "keys": ["f10"],
      "command": "open_project_folder"
    },
    
    {
      "keys": ["ctrl+f10"],
      "command": "open_file_folder"
    }
    

    Initiate the key bindings on a open file (f10 to open the directory you have set as the project folder, ctrl+f10 to open the folder of the current file.)

    0 讨论(0)
  • 2021-01-30 11:33

    In sublimetext3 there is a package to sync current open file with the sidebar explorer. SyncedSidebar

    0 讨论(0)
提交回复
热议问题