heynote icon indicating copy to clipboard operation
heynote copied to clipboard

FR - Delete block shortcut

Open paulochang opened this issue 1 year ago • 4 comments

Currently I use ⌘ + Down / Up to navigate to a block (although the cursor positioning is a bit weird) Then ⌘ + A to select it then Delete to delete it.

Is it difficult to add a shortcut say... ⌘ + D to remove a block?

This along with the block navigation mode would make it easier to use. If you can point me out to the shortcuts code I might even be able to do it myself.

Thanks for the app! Loving it!

Edit: I just found out the clues I needed on https://github.com/heyman/heynote/pull/85 so I might be able to do a PR shortly. Feel free to comment here if you have any thoughts.

paulochang avatar Dec 28 '23 16:12 paulochang

Personally, I delete the current block by pressing ⌘-A Backspace Backspace, though I don't do it very often since I mostly just keep adding new blocks at the bottom. However, I can see it being a useful key binding if you often delete blocks.

⌘/Ctrl + D is already bound to selectNextOccurence which creates an additional selection of the next occurrence of the current selection, so it would have to be some other default key binding.

The question is also where the cursor should go when a block is deleted. At the end of the previous block perhaps? Unless it was the first block that was deleted, in that case maybe at the start of the next block (the new start block)?

heyman avatar Dec 28 '23 16:12 heyman

I'd really love to have that as I like my scratchpad to only show currently relevant things - I'm a fan of inbox zero. 😅 The suggestions for text cursor placement after deletion absolutely make sense to me.

Looking forward to seeing this in heynote at some point!

ubuntudroid avatar Jan 25 '24 10:01 ubuntudroid

Heh, I gave up on inbox zero many years ago 😅 image

I think this feature makes sense, especially once we have custom key bindings in place.

heyman avatar Jan 25 '24 14:01 heyman

I'd love/need this as well:

Personally, I delete the current block by pressing ⌘-A Backspace Backspace, though I don't do it very often since I mostly just keep adding new blocks at the bottom. However, I can see it being a useful key binding if you often delete blocks.

I tried this, but it dosen't work if the block is the topmost. I generally add a new block in the top when I want to do a small temporary note, a quiclist or something, and then removing it is cumbersone. If I backspace from the previous block I lost the formatting on the second block (it becomes the formatting of the first).

CMD+Backspace is probably a good shortcut and you can undo it with CMD+Z as it is currently

hanoii avatar Apr 08 '24 13:04 hanoii