vibreoffice icon indicating copy to clipboard operation
vibreoffice copied to clipboard

Keybinding: J for join lines

Open gbgar opened this issue 9 years ago • 3 comments

Thank you for your time and effort, just wanted to document a missing normal mode binding for J, which joins the current and next line in vim.

gbgar avatar Apr 30 '15 00:04 gbgar

Holy crap I've been using vim for over a year and I didn't know that... That is super useful.

perrycate avatar Apr 30 '15 00:04 perrycate

Sorry for the late reply. This would be a useful feature, but also a bit tricky to implement. How can you tell between lines that are separated by a return (newline) and those that are separated by just a space and word wrapping? Just some thoughts, as I don't have a solution yet.

seanyeh avatar Jun 02 '15 20:06 seanyeh

Same here on the punctuality. I just assumed the Vim keybinding deleted the next newline character detected after the cursor, effectively joining the lines, but it's probably a bit more complex than that with cursor positioning and whatnot.

For the purposes of emulating J -- if it were my project or if I had the capacity to contribute some code -- I would treat LO's line-wrapped "paragraphs" (a block of text separated from other elements by at least one newline on top and one on bottom) as a single line in Vim is treated when the 'wrap' option enabled.

At any rate, my particular use case is doing transcriptions is in LO. Often, I need to make paragraphs five lines long, and it would be great to have J to join lines (or, in my case, paragraphs) as quickly as I can add them with i<CR>. Again, no rush or anything, I just wanted to help you fill in the to-do list, since I probably won't be able to do much else. Maybe others will chime in on the discussion in the meantime.

gbgar avatar Jun 08 '15 21:06 gbgar