vimrc file won't apply textwidth settings

人盡茶涼 提交于 2019-12-11 06:25:49

问题


While in a terminal session I can do

:set textwidth=9999

And I receive what I want (which is lines of text which can go to the end of my computer screen)

I created a file called ~/.vimrc which contains the line

set textwidth=9999

And I get no results from from this


回答1:


Your ~/.vimrc is loaded as the very first configuration (cp :help initialization); after that, other configuration and plugins are read, and any of those may change the option again. You can check with

:verbose set textwidth?

and get the list of configuration scripts via

:scriptnames

Ideally, you're able to disable the overriding of the option value. As a workaround, you can also re-initialize the option at the end of configuration, by putting the following into your ~/.vimrc:

autocmd VimEnter * set textwidth=9999

The 'textwidth' option is a buffer-local option. Filetype plugins may adapt this setting. There are ways to override filetype-specific settings (:help after-directory), too.



来源:https://stackoverflow.com/questions/40873502/vimrc-file-wont-apply-textwidth-settings

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!