vim-textobj-sentence
vim-textobj-sentence copied to clipboard
Allow users to specify additional sentence terminators
I use this to prevent LeTeX environments from interfering with sentence rewrapping (gqis). In my after/ftplugin/tex.vim:
let g:re_term_user =
\ '|\\begin\{[a-zA-Z]*\}' .
\ '|\\end\{[a-zA-Z]*\}'
call textobj#sentence#init()
Okay, I will do that. I am also thinking about the interface and might try to make it more flexible. Will probably update the pull request on the weekend. Thanks for considering to merge it!
I have been working on it and noticed a problem: there is interference with the l:re_negative_lookback. What I mean is, when I add a custom terminator and use gqis on a line preceeded by one of the custom terminators, it will read backwards to far and reformat too much.
I noticed that problem is gone when I remove l:re_negative_lookback from b:textobj_sentence_re_i, but that is of course not a satisfactory solution.
Any suggestions how this can be fixed properly, i.e., by adjusting l:re_negative_lookback based on g:re_extra_sentence_term?
I've been trying but can't quite get it to work due to lack of experience with lookahead and lookbehind regexp tricks. What I want to do is modify l:re_negative_lookback so that it does not read across anything that is specified in g:re_extra_sentence_term. Can you perhaps help me by explaining what exactly the current l:re_negative_lookback does and what is its interplay with l:leading and l:trailing?
Has there been any new progress on this PR (Pull Request)?