Browse Source

improve close window command

tags/0.6.0
Randy Lai 5 years ago
parent
commit
e2ab864da9
5 changed files with 39 additions and 12 deletions
  1. +8
    -4
      inux).sublime-keymap
  2. +4
    -4
      SX).sublime-keymap
  3. +8
    -4
      indows).sublime-keymap
  4. +2
    -0
      README.md
  5. +17
    -0
      closewindow.py

Default → inux).sublime-keymap View File

@@ -1,6 +1,10 @@
[
{
"keys": ["ctrl+alt+p"],
"command": "project_manager"
}
{
"keys": ["ctrl+alt+p"],
"command": "project_manager"
},
{
"keys": ["ctrl+shift+w"],
"command": "project_manager_close_window"
}
]

Default → SX).sublime-keymap View File

@@ -1,6 +1,6 @@
[
{
"keys": ["super+ctrl+p"],
"command": "project_manager"
}
{
"keys": ["super+ctrl+p"],
"command": "project_manager"
}
]

Default → indows).sublime-keymap View File

@@ -1,6 +1,10 @@
[
{
"keys": ["ctrl+alt+p"],
"command": "project_manager"
}
{
"keys": ["ctrl+alt+p"],
"command": "project_manager"
},
{
"keys": ["ctrl+shift+w"],
"command": "project_manager_close_window"
}
]

+ 2
- 0
README.md View File

@@ -3,6 +3,8 @@ Project Manager for Sublime Text 3

Dont't have any idea what `*.sublime-project` and `*.sublime-workspace` are doing? Forget where the project files are? Project Manager will help organizing the project files for you. It is inspired by Atom's [Project Manager](https://atom.io/packages/project-manager).

Project Manager also improves the shortcut `ctrl+shift+w` on Windows and Linux so that it will behave similar to that on OSX.

![](https://raw.githubusercontent.com/randy3k/Project-Manager/master/pm.png)

If you like it, you could send me some tips via [![](http://img.shields.io/gittip/randy3k.svg)](https://www.gittip.com/randy3k).


+ 17
- 0
closewindow.py View File

@@ -0,0 +1,17 @@
import sublime_plugin


class ProjectManagerCloseWindow(sublime_plugin.WindowCommand):
def run(self):
if self.window.project_file_name():
# if it is a project, close the project
self.window.run_command('close_workspace')
else:
self.window.run_command('close_all')
# exit if there are dirty views
if any([v.is_dirty() for v in self.window.views()]):
return
# close the sidebar
self.window.run_command('close_project')
# close the window
self.window.run_command('close_window')

Loading…
Cancel
Save