I edit R-markdown files a lot, and this entails writing inline code blocks, such as

`r sum(mylongvectorname)`

I usually have my text hard-wrapped at 80 chars, and this causes problems for the inline blocks, since they aren't allowed to split. I found the answer for this question helpful in preventing the split from happening when writing in insert mode.

However, if I want to wrap a paragraph in normal mode with gq, the r inline code is split. Is there any solution that would allow me to wrap the paragraph by gq and

a) leave the lines with `r .* ` untouched

or (better)

b) treat `r .* ` as a single word so that if it is moved, the whole block is moved together

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.