Browse Source

added edit_current action

master
budRich 3 years ago
parent
commit
5842b67e45
  1. 18
      README.md
  2. 6
      project_manager.py
  3. 4
      support/Default (Linux).sublime-keymap
  4. 4
      support/Default (Windows).sublime-keymap
  5. 4
      support/Default.sublime-commands

18
README.md

@ -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

6
project_manager.py

@ -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':

4
support/Default (Linux).sublime-keymap

@ -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
support/Default (Windows).sublime-keymap

@ -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
support/Default.sublime-commands

@ -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