Skip to content

Commit

Permalink
Merge pull request #4 from jadenstudios/master
Browse files Browse the repository at this point in the history
Create Pane with Current File
  • Loading branch information
adzenith committed Sep 24, 2012
2 parents 4dd6580 + 2cd66fd commit b0f60aa
Show file tree
Hide file tree
Showing 6 changed files with 44 additions and 5 deletions.
7 changes: 6 additions & 1 deletion Default (Linux).sublime-keymap
Original file line number Diff line number Diff line change
Expand Up @@ -22,5 +22,10 @@
{ "keys": ["ctrl+k", "ctrl+shift+up"], "command": "destroy_pane", "args": {"direction": "up"} },
{ "keys": ["ctrl+k", "ctrl+shift+right"], "command": "destroy_pane", "args": {"direction": "right"} },
{ "keys": ["ctrl+k", "ctrl+shift+down"], "command": "destroy_pane", "args": {"direction": "down"} },
{ "keys": ["ctrl+k", "ctrl+shift+left"], "command": "destroy_pane", "args": {"direction": "left"} }
{ "keys": ["ctrl+k", "ctrl+shift+left"], "command": "destroy_pane", "args": {"direction": "left"} },

{ "keys": ["ctrl+k", "ctrl+alt+up"], "command": "create_pane_with_file", "args": {"direction": "up"} },
{ "keys": ["ctrl+k", "ctrl+alt+right"], "command": "create_pane_with_file", "args": {"direction": "right"} },
{ "keys": ["ctrl+k", "ctrl+alt+down"], "command": "create_pane_with_file", "args": {"direction": "down"} },
{ "keys": ["ctrl+k", "ctrl+alt+left"], "command": "create_pane_with_file", "args": {"direction": "left"} }
]
8 changes: 7 additions & 1 deletion Default (OSX).sublime-keymap
Original file line number Diff line number Diff line change
Expand Up @@ -22,5 +22,11 @@
{ "keys": ["super+k", "super+shift+up"], "command": "destroy_pane", "args": {"direction": "up"} },
{ "keys": ["super+k", "super+shift+right"], "command": "destroy_pane", "args": {"direction": "right"} },
{ "keys": ["super+k", "super+shift+down"], "command": "destroy_pane", "args": {"direction": "down"} },
{ "keys": ["super+k", "super+shift+left"], "command": "destroy_pane", "args": {"direction": "left"} }
{ "keys": ["super+k", "super+shift+left"], "command": "destroy_pane", "args": {"direction": "left"} },

{ "keys": ["super+k", "super+alt+up"], "command": "create_pane_with_file", "args": {"direction": "up"} },
{ "keys": ["super+k", "super+alt+right"], "command": "create_pane_with_file", "args": {"direction": "right"} },
{ "keys": ["super+k", "super+alt+down"], "command": "create_pane_with_file", "args": {"direction": "down"} },
{ "keys": ["super+k", "super+alt+left"], "command": "create_pane_with_file", "args": {"direction": "left"} }

]
7 changes: 6 additions & 1 deletion Default (Windows).sublime-keymap
Original file line number Diff line number Diff line change
Expand Up @@ -22,5 +22,10 @@
{ "keys": ["ctrl+k", "ctrl+shift+up"], "command": "destroy_pane", "args": {"direction": "up"} },
{ "keys": ["ctrl+k", "ctrl+shift+right"], "command": "destroy_pane", "args": {"direction": "right"} },
{ "keys": ["ctrl+k", "ctrl+shift+down"], "command": "destroy_pane", "args": {"direction": "down"} },
{ "keys": ["ctrl+k", "ctrl+shift+left"], "command": "destroy_pane", "args": {"direction": "left"} }
{ "keys": ["ctrl+k", "ctrl+shift+left"], "command": "destroy_pane", "args": {"direction": "left"} },

{ "keys": ["ctrl+k", "ctrl+alt+up"], "command": "create_pane_with_file", "args": {"direction": "up"} },
{ "keys": ["ctrl+k", "ctrl+alt+right"], "command": "create_pane_with_file", "args": {"direction": "right"} },
{ "keys": ["ctrl+k", "ctrl+alt+down"], "command": "create_pane_with_file", "args": {"direction": "down"} },
{ "keys": ["ctrl+k", "ctrl+alt+left"], "command": "create_pane_with_file", "args": {"direction": "left"} }
]
10 changes: 10 additions & 0 deletions Main.sublime-menu
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,16 @@
"caption": "File",
"children":
[
{
"caption": "Create to",
"children":
[
{ "command": "create_pane_with_file", "args": {"direction": "up"}, "caption": "Above" },
{ "command": "create_pane_with_file", "args": {"direction": "down"}, "caption": "Below" },
{ "command": "create_pane_with_file", "args": {"direction": "right"}, "caption": "Right" },
{ "command": "create_pane_with_file", "args": {"direction": "left"}, "caption": "Left" }
]
},
{
"caption": "Carry to",
"children":
Expand Down
8 changes: 6 additions & 2 deletions Origami.sublime-commands
Original file line number Diff line number Diff line change
Expand Up @@ -22,5 +22,9 @@
{ "command": "destroy_pane", "args": {"direction": "up"}, "caption": "Origami: Destroy Pane Above" },
{ "command": "destroy_pane", "args": {"direction": "right"}, "caption": "Origami: Destroy Pane on the Right" },
{ "command": "destroy_pane", "args": {"direction": "down"}, "caption": "Origami: Destroy Pane Below" },
{ "command": "destroy_pane", "args": {"direction": "left"}, "caption": "Origami: Destroy Pane on the Left" }
]
{ "command": "destroy_pane", "args": {"direction": "left"}, "caption": "Origami: Destroy Pane on the Left" },

{ "command": "create_pane_with_file", "args": {"direction": "up"}, "caption": "Origami: Create Pane with File Above" },
{ "command": "create_pane_with_file", "args": {"direction": "right"}, "caption": "Origami: Create Pane with File on the Right" },
{ "command": "create_pane_with_file", "args": {"direction": "down"}, "caption": "Origami: Create Pane with File Below" },
{ "command": "create_pane_with_file", "args": {"direction": "left"}, "caption": "Origami: Create Pane with File on the Left" }
9 changes: 9 additions & 0 deletions origami.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,10 @@ def clone_file_to_pane(self, direction):
self.window.run_command("clone_file")
self.carry_file_to_pane(direction)

def create_pane_with_file(self,direction):
self.create_pane(direction)
self.carry_file_to_pane(direction)

def create_pane(self, direction):
window = self.window
rows, cols, cells = self.get_layout()
Expand Down Expand Up @@ -165,6 +169,11 @@ def run(self, direction):
self.clone_file_to_pane(direction)


class CreatePaneWithFileCommand(PaneCommand):
def run(self, direction):
self.create_pane_with_file(direction)


class CreatePaneCommand(PaneCommand):
def run(self, direction):
print "creating"
Expand Down

0 comments on commit b0f60aa

Please sign in to comment.