-
Notifications
You must be signed in to change notification settings - Fork 4.9k
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
Update/improve prefix functionality in window delete commands #16247
base: develop
Are you sure you want to change the base?
Update/improve prefix functionality in window delete commands #16247
Conversation
5900287
to
32d8bca
Compare
(Spac)Emacs comes with the `kill-buffer-and-window` by default. Also deleting other windows (and buffers) simply by prefixing the window delete commands with a numerical prefix is very convenient. Therefore, this commit updates (or adds) the functionality of the prefix in the window delete commands. Summary: to delete another window (and optionally its buffer), simply prefix `SPC w d` (or `SPC w x`) with the window number.
32d8bca
to
b22039c
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have found a small issue, please check and ping me when you are ready for another review.
@@ -2338,7 +2338,7 @@ Windows manipulation commands (start with ~w~): | |||
| ~SPC w c C~ | toggle visual distraction free mode | | |||
| ~SPC w c .~ | center buffer and enable centering transient state | | |||
| ~SPC w d~ | delete a window | | |||
| ~SPC u SPC w d~ | delete a window and its current buffer (does not delete the file) | |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would like to keep the old behaviour, users should have a choice between the spc u
way and the pure num
flavor.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There already exist two bindings for deleting a window and its buffer: SPC w x
and SPC b x
. Therefore, I argued the binding you are referring to, is somewhat redundant.
This PR suggests that we can make better use of the SPC w d
prefix, namely, to use it for quickly deleting other windows.
Currently, the only way to quickly delete another window is viaace-delete-window
for which there is no default binding. However, I would argue that using a numeric prefix with SPC w d
is a better alternative to ace-delete-window
, as ace shows labels only after invoking it, while a window number is known already before invoking SPC w d
. Furthermore, unlike ace-delete-window
, this alternative does not require creating some extra (custom) binding, while also, it does not depend on ace.
(Spac)Emacs comes with the
kill-buffer-and-window
by default (onSPC w x
). Also, deleting other windows (and buffers) simply by prefixing the window delete commands with a numerical prefix is very convenient. Therefore, this commit updates (or adds) the functionality of the prefix in the window delete commands.Summary: to delete another window (and optionally its buffer), simply prefix
SPC w d
(orSPC w x
) with the window number.This functionality exists in the
winum
package itself (onwinum-select-window-by-number
), but for deletion that command requires a negative prefix which is cumbersome.