0

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?

Nordine Lotfi
  • 683
  • 4
  • 16

1 Answers1

0

Putting

set cpoptions=aABceF

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

Nordine Lotfi
  • 683
  • 4
  • 16
  • 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 06:28
  • 2
    You can always try :verbose :set cpoptions? to see where it was reset – Christian Brabandt Sep 18 '20 at 06: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 – Nordine Lotfi Sep 18 '20 at 06:50
  • How can i make it so it's set only in my .vimrc? or so the above line in my .vimrc take precedence over the result from :verbose :set cpoptions?? @ChristianBrabandt – Nordine Lotfi Sep 18 '20 at 06:52
  • 1
    @NordineLotfi I don't understand? :verbose :set cpoptions? queries only where the option was last set/changed. It does not change anything – Christian Brabandt Sep 18 '20 at 06: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 07:10