![](https://secure.gravatar.com/avatar/d39338246f50cca667c8256c313d7cfd.jpg?s=120&d=mm&r=g)
On 2013–02–15 Marco Patzer wrote:
In vim pressing “vis” (visualise inner sentence) marks the current sentence, then pressing “g<Ctrl-g>” yields:
Selected 2 of 4 lines; 14 of 50 words; 82 of 296 bytes
That means current sentence is 82 bytes long. The rest is up to you. Pick a language you like, vim uses its own scripting language but also has bindings for python, perl, lua, etc. Pseudo-code:
go to begin of file start: get byte length of sentence if length > max_length % do something fi move on to the next sentence goto start
Here's a quick and naïve vim function which moves the cursor to the last sentence containing more than 250 bytes when you hit F9. function! GoToLastTooLongSentence() let maxSentenceLength = 250 while line('.') != 1 normal ( | yis let num = strlen(@") if num >= maxSentenceLength normal vis " just for demonstration, remove this break endif endwhile endfunction noremap <F9> :call GoToLastTooLongSentence()<cr> Marco