dvcrn / proton

space-atom. spacemacs and sublimious style editing in atom
GNU General Public License v3.0
565 stars 56 forks source link

Splitting windows might not behave as some expect #260

Open jackcasey opened 7 years ago

jackcasey commented 7 years ago

This is a discussion rather than a bug.

I find the default behaviour of splitting windows to be unexpected/inefficient. Currently splitting will open and focus an empty pane. This allows you to immediately open a new file from eg SPC P F so does make sense for some people. (behaviour #1)

In spacemacs (as far as I can see) the default is to open and focus a (live) copy of the current buffer. (behaviour #2) I find this the least useful personally, I rarely need the same file open twice.

I think what I'd prefer (personally) is to open and focus the new pane and move the current buffer into the new pane, removing it from the old pane. (behaviour #3) I think I tend to open files first and organise for side-by-side second.

Obviously this is a personal choice and we can override behaviour individually. Behaviours 2 and 3 above are available from pane:split-right-and-copy-active-item and pane:split-right-and-move-active-item. (You need to put them as keybinds in .proton and use the :target ".editor.is-focused" 'trick'. )

But I was wondering what people's opinions on this are and if the defaults might require changing? Seems like if anything we should match the spacemacs default?

There are also additional options that could be used more efficiently in my opinion with shift (currently creates and focuses empty pane on the other side) and other keys (/ vs v or '_' vs s - currently duplicate bindings)

Also perhaps 'moving a pane' (using SPC w L for example) should open a new pane if one doesn't exist to move it in to. This would be useful I think. Currently this raises an error. This would probably be a fix to the move-panes package rather than in proton.

Anyone have any thoughts? Feel free to say you think it's totally fine as is and I'll just use overrides locally :)

agustif commented 7 years ago

I remember using this package in the past: https://atom.io/packages/pain-split

I also remember the console started giving me some -deprecation- notices when using it...