VSCode 项目管理插件

Project Manager

Available commands

  • Project Manager: Edit Project Edit the project list (projects.json file) directly inside Code
  • Project Manager: List Projects to Open List all saved projects and pick one
  • Project Manager: List Projects to Open in New Window List all saved projects and pick one to be opened in New Window
  • Project Manager: Refresh Projects Refresh the cached projects (VSCode, Git, Mercurial and SVN)
  • Project Manager: Save Project Save the current project in the manager

Commands

Save Project

You can save the current project in the manager at any time. You just need to type a name. It even suggests a name to you automatically :)

Save

Edit Projects

For easier customization of your project list, you can edit the projects.json file directly inside Code. Just execute Project Manager: Edit Projects and the projects.json file is opened. Simple as this:

[
    {
        "name": "Pascal MI",
        "rootPath": "c:\\PascalProjects\\pascal-menu-insight",
        "paths": [],
        "group": ""
    },
    {
        "name": "Bookmarks",
        "rootPath": "$home\\Documents\\GitHub\\vscode-bookmarks",
        "paths": [],
        "group": ""
    },
    {
        "name": "Numbered Bookmarks",
        "rootPath": "$home\\Documents\\GitHub\\vscode-numbered-bookmarks",
        "paths": [],
        "group": ""
    }
]

For now, only name and rootPath are useful. The paths and group fields are there to be used in the future by two new features: Support multiple folders in the same project and Contextual Structure for Projects .

You can use a special variable called $home while defining any path. It's useful if you sync your projects between different machines, because it will be replaced by the HOME folder.

Be sure that the JSON file is well-formed. Otherwise, Project Manager will not be able to open it, and an error message like this should appear. In this case, you should use the Open File button to fix it.

Corrupted

List Projects to Open

Shows your projects and select one to open.

List Projects to Open in New Window

Just like List Projects but always opening in New Window.

Keyboard Focused Users

If you are a keyboard focused user and uses Vim like keyboard navigation, you can navigate thru the project list with your own keybindings.

Just use the when clause "inProjectManagerList", like:

    {
        "key": "ctrl+j",
        "command": "workbench.action.quickOpenSelectNext",
        "when": "inProjectManagerList"
    }

Available settings

Sort the Project List

Allows you to choose how the projects are sorted in List Projects commands. You can choose:

  • Saved: The order that you saved the projects
  • Name: The name that you typed for the project
  • Path: The full path of the project
  • Recent: The recently used projects
    "projectManager.sortList": "Name"

List

Group the Project List

List the projects, grouped by its kind (Favorites, VS Code, Git, Mercurial and SVN).

    "projectManager.groupList": true

Remove the Current Project from List

By default, the current project is removed from the list. If you don't want this for any reason, just turn it off.

    "projectManager.removeCurrentProjectFromList": true

Check Invalid Paths Before Listing

By default, it will check for invalid paths to display a message below the project name. If you don't want this check for any reason, just turn it off.

    "projectManager.checkInvalidPathsBeforeListing": false

Filter Projects Through Full Path

By default, it will filter projects by its name only. If you want to filter also based on its path, just turn it on.

    "projectManager.filterOnFullPath": true

Projects Location

If you intend to share projects between Stable and Insider installations, or if you store your settings in different locations (cloud services), you can indicate an alternative location for the projects.json file.

    "projectManager.projectsLocation": "C\\Users\\myUser\\AppData\\Roaming\\Code\\User"

Automatic Detection of Projects

You can have automatic detection of VSCode vscode, Git git, Mercurial git and SVN svn projects. For this, you just have to indicate a list of folders where each kind of project is located.

    "projectManager.git.baseFolders": [
        "c:\\Projects\\code",
        "d:\\MoreProjects\\code-testing",
        "$home\\personal-coding"
    ]

To customize how deep to look projects or folders to be ignored you have two additional settings:

    "projectManager.git.ignoredFolders": [
        "node_modules", 
        "out", 
        "typings", 
        "test"
    ],
    "projectManager.git.maxDepthRecursion": 4

All kinds of projects (VSCode, Git, Mercurial and SVN) have the same kind of settings

Cache Automatically Detected Projects

By default, the automatically detected projects (VSCode, Git, Mercurial and SVN) are cached. If you don't want this for any reason, just turn it off.

    "projectManager.cacheProjectsBetweenSessions": false

Display Project Name in Status Bar

You have the option to display the Project Name in the Status Bar, so you can easily detect in which project you are.

    "projectManager.showProjectNameInStatusBar": true

Save

Open Projects in New Window When Clicking in Status Bar

You can choose if it would open projects in New Window when clicking in status bar.

    "projectManager.openInNewWindowWhenClickingInStatusBar": true

Treeview

There is also a Projects Treeview, right in the Explorer panel. You will have all your projects there, organized by type. A few commands were added:

  • Open a project, simply clicking in the project item
  • Open a project in a New Window, right clicking in the project item

Treeview

Treeview is Optional

You can choose if you want to see the TreeView.

    "projectManager.treeview.visible": true

猜你喜欢

转载自my.oschina.net/u/3797187/blog/1817975