Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I would like to have insert mode completion for sentences rather than lines in vim.

C-x C-l completes lines, but cannot complete sentences that do not start with a new line.

For example:

I have a dog. My dog's name is Spot.

I want to be able to type:

My dog

then hit a key to complete the sentence.

What is the best way to do this? A thread with the same title did not have a solution.

share|improve this question

Try C-x C-u. You will need to define the completion as described in the complete-functions section of the vim help. Type:

:help complete-functions

To see this section. Similarly,

:help i_^X

(where ^X is the C-x character) will show you the section that describes this mode. Keep in mind that sentences typically end with the pattern /. /. Good luck.

share|improve this answer
Thanks. This is currently a bit beyond my level of knowledge, but I'll post if I find a specific solution. – stackoverflowed Jun 11 '12 at 2:06

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.