add split, vsplit, sp, and vsp commands

This commit is contained in:
Ian Germann 2015-02-22 14:53:20 -05:00
parent 4a547e64fd
commit 7f667d90e0
2 changed files with 28 additions and 2 deletions

View file

@ -4,6 +4,31 @@ class Ex
atom.workspace.getActiveEditor().save()
else
atom.workspace.getActivePane().saveActiveItemAs()
w: => @write()
split: (filePaths) ->
pane = atom.workspace.getActivePane()
if filePaths? and filePaths.length > 0
newPane = pane.splitUp()
for file in filePaths
do ->
atom.workspace.openURIInPane file, newPane
else
pane.splitUp(copyActiveItem: true)
sp: (filePaths) => @split(filePaths)
vsplit: (filePaths) ->
pane = atom.workspace.getActivePane()
if filePaths? and filePaths.length > 0
newPane = pane.splitLeft()
for file in filePaths
do ->
atom.workspace.openURIInPane file, newPane
else
pane.splitLeft(copyActiveItem: true)
vsp: (filePaths) => @vsplit(filePaths)
module.exports = Ex