Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Deleting windows based on its numbers #1222

Closed
tuhdo opened this issue Apr 17, 2015 · 7 comments
Closed

Deleting windows based on its numbers #1222

tuhdo opened this issue Apr 17, 2015 · 7 comments

Comments

@tuhdo
Copy link
Contributor

tuhdo commented Apr 17, 2015

Since we can switch between window with SPC 1 and such, it would be nice if we can delete them with number i.e. "SPC d 1" deletes wondow 1. Similarly, "SPC b 1" switches buffer in window 1 when we are in window 2 without switching to it. With this feature, we won't have to move to a window, switch buffer than go back. And it would be much easier to control when we have 3 or more windows.

@syl20bnr
Copy link
Owner

Maybe with the prefix argument ? Ideally we could contribute to window-numbering.

@tuhdo
Copy link
Contributor Author

tuhdo commented Apr 18, 2015

I think we should separate the commands instead of reusing the existing SPC-<number> keys. Imagine that if I want to open a buffer in a window with C-u SPC 2 but for mistaken added another prefix argument to become C-u C-u SPC 2 and delete my window number 2, it's pretty annoying. Probably we can use C-u SPC to delete windows, but SPC b <number> to switch buffer on that window. That way, it would be easier to avoid mistake and has more logical grouping. And of course, we have to reuse window-numbering.

@syl20bnr
Copy link
Owner

What I propose is SPC # to switch to a window as it is now, it is a high frequency key binding, adding a keystroke would be bad for productivity.
To delete a window SPC u SPC #. So there is no ambiguity. But in holy-mode it is the less smooth C-u M-m #, OTOH deleting windows is not has frequent and to delete several windows there is SPC w . micro-state.

SPC b # could used for something else, like buffer swapping for instance.

@tuhdo
Copy link
Contributor Author

tuhdo commented Apr 22, 2015

Yes, SPC b <number> can be used for something else, if we could make use of window-purpose since buffer can be automatically assigned to correct window that has the same purpose. But for deleting windows, that's my frequent operation i.e. when you have 3 or more windows, you have to switch window and delete it then move back to original window. It would be nice if we simply use the same way to switch to a window, but this time instead of switching, just delete it without moving cursor elsewhere.

So, we can use prefix argument to delete a window. I think Emacs users won't find it less comfortable since they don't have to do all the manual window switching above. Just think of a window number to delete, than delete it.

@syl20bnr
Copy link
Owner

What about shifting the number then ? SPC ! to delete window 1.

@tuhdo
Copy link
Contributor Author

tuhdo commented Apr 22, 2015

Ok, look good to me.

@StreakyCobra
Copy link
Contributor

SPC u SPC # is already available in current release. Old issue, not relevant anymore.

For the record:

What about shifting the number then ? SPC ! to delete window 1.

This would have break a loooot of keyboard layouts, even the QWERTY based ones (like french AZERTY, Swiss-french QWERTZ, etc.)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants