So i tried to change the setting from cpoptions, so i did:

set cpoptions=aABceF

on the commandline, where s for the star is missing (on purpose) and it seems to work fine but only if i do it in the commandline. If i use it in my .vimrc, nothing happen, and doing:

set cpoptions?

In the commandline after opening vim show:

set cpoptions=aABceFs

Where s isn't missing as intended (which worked only in the commandline as shown above).

How can i make this work in my .vimrc too?



set cpoptions=aABceF

At the end of my .vimrc worked (instead of at the start).

  • 2
    Do you have set nocompatible in your vimrc? If you do, that command will reset 'cpoptions' to the default... So any setting of 'cpoptions' before that line will be overwritten.
    – filbranden
    Sep 18 '20 at 6:28
  • 2
    You can always try :verbose :set cpoptions? to see where it was reset Sep 18 '20 at 6:29
  • I don't :) using latest Vim from git, so i believe it's already using nocompatible by default, especially since i have a .vimrc. @filbranden Sep 18 '20 at 6:50
  • 1
    @NordineLotfi I don't understand? :verbose :set cpoptions? queries only where the option was last set/changed. It does not change anything Sep 18 '20 at 6:56
  • 2
    It's possible something in your vimrc is sourcing something that sets 'nocompatible' (or resets 'cpoptions'), see How do I debug my vimrc file? if you'd like to figure out where it's being clobbered.
    – filbranden
    Sep 18 '20 at 7:10

Your Answer

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

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