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

Allow deleting at the end of the buffer. #11750

Open
wmstack opened this issue Sep 23, 2024 · 2 comments
Open

Allow deleting at the end of the buffer. #11750

wmstack opened this issue Sep 23, 2024 · 2 comments
Labels
C-enhancement Category: Improvements

Comments

@wmstack
Copy link
Contributor

wmstack commented Sep 23, 2024

Often through the process of coding I end up with multiple new-lines at the end of the document:

image

However, in this situation, often one would just want to use "d" to delete the excess new lines (or characters) from the end. However, as no character is actually selected, nothing happens.

Just thought it was a good feature to add. Another reason is that in VIM you could just press "dd" multiple times from the end and it works, whereas the equivalent "xd" also doesn't really work from the end of the buffer.

It also doesn't help to go left once and then press "d" as it would just delete a single line and you are back in the same situation. Ideally you should be able to start from the end, delete as many lines as needed from the end of the buffer.


There is another quirk worth considering too. If you press a while selecting the last character of the document, a new line is created. However, if you press a while on the emptiness at the end, nothing happens.

@wmstack wmstack added the C-enhancement Category: Improvements label Sep 23, 2024
@JeftavanderHorst
Copy link
Contributor

I added the following to my config:

'backspace' = 'delete_char_backward'

This allows you to remove those characters using backspace.

@wmstack
Copy link
Contributor Author

wmstack commented Sep 23, 2024

That works well now that I've added it. I would still be interested to see what the authors think about having some way of using a single keybinding to achieve the kind of double functionality of delete and backspace on the end of the buffer.

It might just be me, but I see some value in that.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-enhancement Category: Improvements
Projects
None yet
Development

No branches or pull requests

2 participants