vimflowy icon indicating copy to clipboard operation
vimflowy copied to clipboard

'dj' and 'dk' don't work

Open caetanosauer opened this issue 6 years ago • 3 comments

Deleting the current line and the lines above/below with dk/dj is not working. Is that a bug or because it's not supported? It would also be nice to add quantifiers like d3j, d5k.

caetanosauer avatar Mar 07 '18 08:03 caetanosauer

in general, things are a bit trickier due to nesting bullets and stuff. in particular, i haven't defined behavior for deleting a single line without deleting its descendants. I do think it would be good if dj/dk behaved as expected in cases where it's obvious though

to elaborate some, d+motion is implemented as: "move cursor with , delete selection between old cursor and new as if in visual mode". thus it fails for now since visual mode deletion can't span multiple lines, currently (another limitation). 2 problems with this:

  • this behavior is wrong for dj/dk (should be visual line mode instead)
  • in visual line mode, we only allow selections of entire trees. we need to define delete behavior for individual groups of lines

once addressed, i think dj/dk can work, which would be nice

WuTheFWasThat avatar Mar 07 '18 16:03 WuTheFWasThat

Thanks for your response and for developing this awesome tool!

I agree that nesting might make things trickier. You could emulate the vim behavior with folds: if you press dj on the line above a closed fold, that whole fold gets deleted. I think this would also be useful in vimflowy. If that's not the intended behavior, there's always undo.

As for deleting across an open fold, maybe the easiest semantics would be to not do anything and show some error status, since I don't think there's a common agreement on the expected behavior.

I was also wondering about inner-word movements like diw and ciw, which I use a lot in vim. Is that possible in vimflowy?

caetanosauer avatar Mar 08 '18 07:03 caetanosauer

yeah, i think the behavior you describe is how it should work, and consistent with the rest of vimflowy

inner word movements would be great. relatedly, there's a long-standing issue to implement vim-surround: https://github.com/WuTheFWasThat/vimflowy/issues/232

unfortunately, i don't have as much time to work on vimflowy as I used to, so nothing is likely to get implemented soon unless somebody else does it :(

WuTheFWasThat avatar Mar 09 '18 00:03 WuTheFWasThat