Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

how to debug vim config (.vimrc)

Tags:

vim

I have a line

set cpoptions+=$  "add the '$' sign as change command indicator

in my .vimrc file, however after vim is started

set cpoptions? 

shows the '$' option isn't set. if I type :set cpoptions+=$ manually in vim everything works fine.

I suspect during the vim initialization, after the line in my .vimrc file gets executed, the option somehow gets reset(could be a plugin).

my question is, does vim provide command/tool to debug issues like this?

I am using vim on Mac OS X (NOT MacVim).

Thanks!

-Xiaotian

like image 291
Xiaotian Guo Avatar asked Dec 28 '11 06:12

Xiaotian Guo


People also ask

How do I access .vimrc files?

The global or system-wide vim configuration file is generally located under the /etc/vim/vimrc . This configuration file is applied to all users and when Vim is started this configuration file is read and Vim is configured according to this file contents.

How do I find my Vim configuration?

Vim's user-specific configuration file is located in the home directory: ~/. vimrc , and Vim files of current user are located inside ~/. vim/ . The global configuration file is located at /etc/vimrc .

How do I edit vimrc?

Opening vimrc Using file name completion, you could type :e $M then press Tab until you see the desired variable. If you only want to see the path, type :echo $M then press Tab to see the variable, and press Enter. In gvim, the Edit menu includes "Startup Settings" which will use $MYVIMRC to edit your vimrc file.


1 Answers

:verbose set cpoptions?

will tell you where it was last set.

like image 192
Laurence Gonsalves Avatar answered Sep 20 '22 18:09

Laurence Gonsalves