Browse Source

added edit_current action

master
budRich 2 years ago
parent
commit
5842b67e45
5 changed files with 35 additions and 1 deletions
  1. +18
    -0
      README.md
  2. +5
    -1
      project_manager.py
  3. +4
    -0
      inux).sublime-keymap
  4. +4
    -0
      indows).sublime-keymap
  5. +4
    -0
      support/Default.sublime-commands

+ 18
- 0
README.md View File

@@ -55,6 +55,24 @@ There are two ways to add existing projects to Project Manager.
Manager will know where to look when the project is opened. In other words, you can put the
`*.sublime-project` file in any places.

### Edit a project
By default when ProjectManager is executed with the action, `edit`:

``` JSON
{
"keys": ["alt+p"],
"command": "project_manager", "args": {"action": "edit"}
}
```

A list of all projects are displayed in the command palette so the user can chose which project to edit. If the action is `edit_current`, instead, the currently active project will be automatically chosen:

``` JSON
{
"keys": ["alt+p"],
"command": "project_manager", "args": {"action": "edit_current"}
}
```


### FAQ


+ 5
- 1
project_manager.py View File

@@ -522,9 +522,13 @@ class ProjectManager(sublime_plugin.WindowCommand):

def run(self, action=None, caller=None):
self.manager = Manager(self.window)

if action is None:
self.show_options()
elif action == 'edit_current':
for p in self.manager.projects_info.items():
project_name, info = p
if "star" in info:
self.manager.edit_project(project_name)
elif action == 'add_project':
self.manager.add_project()
elif action == 'import_sublime_project':


support/Default → inux).sublime-keymap View File

@@ -3,6 +3,10 @@
"keys": ["ctrl+alt+p"],
"command": "project_manager", "args": {"action": "switch"}
},
{
"keys": ["alt+p"],
"command": "project_manager", "args": {"action": "edit_current"}
},
// {
// "keys": ["ctrl+alt+o"],
// "command": "project_manager", "args": {"action": "new"}

support/Default → indows).sublime-keymap View File

@@ -3,6 +3,10 @@
"keys": ["ctrl+alt+p"],
"command": "project_manager", "args": {"action": "switch"}
},
{
"keys": ["alt+p"],
"command": "project_manager", "args": {"action": "edit_current"}
},
// {
// "keys": ["ctrl+alt+o"],
// "command": "project_manager", "args": {"action": "new"}

+ 4
- 0
support/Default.sublime-commands View File

@@ -31,6 +31,10 @@
"caption": "Project Manager: Edit Project",
"command": "project_manager", "args": {"action": "edit"}
},
{
"caption": "Project Manager: Edit Current Project",
"command": "project_manager", "args": {"action": "edit_current"}
},
{
"caption": "Project Manager: Rename Project",
"command": "project_manager", "args": {"action": "rename"}


Loading…
Cancel
Save