roam-unofficial / roam-toolkit

Roam force multiplier
MIT License
475 stars 43 forks source link

Vim Mode: Move Block up and down should enter insert mode AND move the block, instead of only entering insert mode #177

Open the-nurk opened 4 years ago

the-nurk commented 4 years ago

hotkeys for moving a block up or down do not work at all. They just start editing the current block. If the block is selected with v, nothing happens. I have the commands currently bound to alt+shift+j/k for down/up respectively. I've tried with hotkeys that are confirmed to work (alt+n/u) and still get the same behavior. I am using RoamThemes as well. However, I tried in chrome without RoamThemes and still get the same issue.

Browser Info: Vivaldi 3.4.2066.106 (Stable channel) (64-bit)
Revision 9faa7da6e287d30fe3948ac5d9d62aefe7977da5
OS Windows 10 OS Version 1909 (Build 18363.1198)
JavaScript V8 8.6.395.25
Flash (Disabled)
User Agent Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/86.0.4240.198 Safari/537.36
tntmarket commented 4 years ago

Hmm, do they work when you're already in insert mode? The command just calls the native command+shift+arrow, which also doesn't move highlighted blocks.

We should probably make it so if you're in normal mode, it both enters and moves the block though

the-nurk commented 4 years ago

Hmm, do they work when you're already in insert mode? The command just calls the native command+shift+arrow, which also doesn't move highlighted blocks.

We should probably make it so if you're in normal mode, it both enters and moves the block though

Ok. When already in insert mode the commands do nothing. Also I don't think entering insert mode after moving the block is a good idea. Having the hotkey do one thing and one thing only is important I think. I would never use the insert mode after I move a block personally. In fact it would make me very annoyed. Ideally, I would like to be able to move blocks like I do in vscode. I've got alt+h/j/k/l for moving left, down, up, and right respectively.

tntmarket commented 4 years ago

Does the native command+shift+arrow shortcut work for you when you turn off roam toolkit?

I agree that the shortcut should just move the block, not go into insert mode, and stay in normal mode.

It's just that the command+shift+arrow shortcut is the simplest way to shift blocks right now, and it can only be accessed while focused on a block. (Maybe we could simulate drag+drop with the mouse, but that'd be trickier to implement)

I previously tried to make the shortcut go

In succession, but this makes it laggy, especially when you want to shift blocks multiple times quickly.

the-nurk commented 4 years ago

yes! ctrl+shift+up does work. However, it has a weird quirk where when moving up, it moves the view port up, but when moving down it doesn't. It's really annoying especially to someone who likes the viewport to only change when I tell it to. That's a default roam thing right? So I don't expect you to be able to change it.

I find dragging and dropping with the mouse to be finicky, cause you've gotta drop it in the exact right spot to keep it at the same indent level, not move it one indent to the right under the block above.

any chance on getting hotkeys for indenting and outdenting tho? I'd love to have those on alt+h/l