vim自动设置 textwidth 的问题

swofford posted @ 2014年1月13日 20:22 in 未分类 with tags vim , 18000 阅读

Vim 里有个选项是 textwidth,作用就是设置文本宽度,当用户输入一个很长的文本时,如果文本中有空格,那么这行文本就会被 Vim 按照 textwidth 设置的长度自动拆分,拆分成每行最多 textwidth 个字符。它和 Vim 本身的自动折行区别就是,自动折行之后,原来的文字还是一整行,不能用 j k 在折行间切换,只能用 gj gk;而用 textwidth 自动拆分之后,一行文字变成了多行,每行间自动插入了换行符。可以用 j k 在行之间切换。相信只要看过 Vim 帮助文件的人都会有直观感受。

这两天在 Windows 系统上刚装了 gVim 7.4,在输入的时候发现会自动折行,用 :echo &tw 发现 textwidth 设置成了 78,于是在 _vimrc 里加上 set textwidth=0,但设置后,发现 textwidth 仍然是 78,没有被改变。于是 Google 一番,发现了这个,按照上面的方法设置了 let g:leave_my_textwidth_alone,还是没用。启动的时候 Vim 根本不认这个选项。

继续搜索,终于在万能的 StackExchange 上找到了这个,原来 Vim 启动时加载 .vim 文件是有顺序的。按照这里提供的方法,执行

:redir >d:\output.txt
:scriptnames
:redir END

得到我的 Vim 启动时加载的 vim 文件

D:\Program Files (x86)\Vim\_vimrc
D:\Program Files (x86)\Vim\vim74\vimrc_example.vim
D:\Program Files (x86)\Vim\vim74\syntax\syntax.vim
D:\Program Files (x86)\Vim\vim74\syntax\synload.vim
D:\Program Files (x86)\Vim\vim74\syntax\syncolor.vim
D:\Program Files (x86)\Vim\vim74\filetype.vim
D:\Program Files (x86)\Vim\vim74\menu.vim
D:\Program Files (x86)\Vim\vim74\lang\menu_zh_cn.cp936.vim
D:\Program Files (x86)\Vim\vim74\lang\menu_chinese_gb.936.vim
D:\Program Files (x86)\Vim\vim74\autoload\paste.vim
D:\Program Files (x86)\Vim\vim74\ftplugin.vim
D:\Program Files (x86)\Vim\vim74\indent.vim
D:\Program Files (x86)\Vim\vim74\mswin.vim
D:\Program Files (x86)\Vim\vim74\colors\desert.vim
D:\Program Files (x86)\Vim\vim74\syntax\nosyntax.vim
D:\Program Files (x86)\Vim\vim74\delmenu.vim
D:\Program Files (x86)\Vim\vim74\plugin\delimitMate.vim
D:\Program Files (x86)\Vim\vim74\autoload\delimitMate.vim
D:\Program Files (x86)\Vim\vim74\plugin\emmet.vim
D:\Program Files (x86)\Vim\vim74\plugin\getscriptPlugin.vim
D:\Program Files (x86)\Vim\vim74\plugin\gzip.vim
D:\Program Files (x86)\Vim\vim74\plugin\matchparen.vim
D:\Program Files (x86)\Vim\vim74\plugin\netrwPlugin.vim
D:\Program Files (x86)\Vim\vim74\plugin\rrhelper.vim
D:\Program Files (x86)\Vim\vim74\plugin\spellfile.vim
D:\Program Files (x86)\Vim\vim74\plugin\tarPlugin.vim
D:\Program Files (x86)\Vim\vim74\plugin\tohtml.vim
D:\Program Files (x86)\Vim\vim74\plugin\vimballPlugin.vim
D:\Program Files (x86)\Vim\vim74\plugin\zipPlugin.vim
D:\Program Files (x86)\Vim\vim74\lang\menu_zh_cn.utf-8.vim

用 grep 'textwidth' <filename>,在 vimrc_example.vim 和 menu.vim 中找到了对 textwidth 的设置。最终注释掉 vimrc_example.vim 里的

autocmd FileType text setlocal textwidth=78

 就可以了~~

Avatar_small
万岁 说:
2018年10月07日 15:36

我试过了,怎么不其作用呢,好奇怪呀

Avatar_small
seo service UK 说:
2024年2月20日 22:12

Hey there! I’m at work browsing your blog from my new iphone! Just wanted to say I love reading your blog and look forward to all your posts! Carry on the outstanding work

Avatar_small
먹튀폴리스주소 说:
2024年2月24日 18:34

Whilst we obtained in your internet record nevertheless including attention just a little contact submits. Good way of possible, We're book-marking throughout a time period discover variations determine spgs method upward.

Avatar_small
먹튀신고 说:
2024年2月24日 19:01

I must show appreciation to you just for bailing me out of such a instance. Just after searching throughout the world wide web and getting tricks which are not beneficial, I was thinking my life was over. Existing minus the answers to the problems you have solved all through your main review is a serious case, and ones which might have adversely affected my career if I had not encountered your blog. Your actual knowledge and kindness in taking care of all the stuff was precious. I’m not sure what I would have done if I had not encountered such a thing like this. It’s possible to now relish my future. Thanks a lot so much for your specialized and amazing help. I will not hesitate to propose your site to any person who would need assistance on this matter.

Avatar_small
메이저토토사이트 说:
2024年2月24日 19:03

I’m writing to let you understand of the terrific experience my princess obtained visiting your web site. She came to understand several details, most notably what it’s like to possess a wonderful teaching mood to get a number of people very easily learn some complex issues. You really surpassed readers’ expected results. Many thanks for supplying those valuable, trustworthy, edifying and as well as cool guidance on that topic to Lizeth. Thank you for every one of your efforts on this web page. My aunt takes pleasure in making time for internet research and it is simple to grasp why. Most of us know all regarding the dynamic manner you present very important guides by means of this blog and in addition strongly encourage contribution from other individuals on that area then our daughter has been understanding a great deal. Enjoy the rest of the new year. Your conducting a good job.

Avatar_small
온라인카지노추천 说:
2024年2月24日 19:37

What would many of us do devoid of the brilliant suggestions you share on this web site? Who else has got the perseverance to cope with important topics in the interest of ordinary subscribers like me? My spouse and i and my guys are really lucky to have your website among the ones we typically visit. We hope you know how a great deal we take pleasure in your efforts! Much luck coming from us all.

Avatar_small
메이저토토사이트 说:
2024年2月24日 19:37

“I’m just writing to make you understand what a helpful experience my princess enjoyed reading through your web page. She learned a lot of pieces, including what it is like to have an ideal teaching heart to get other individuals with no trouble learn selected impossible subject areas. You truly surpassed readers’ desires. Many thanks for churning out such invaluable, healthy, informative and fun tips on the topic to Julie.”

Avatar_small
토토사이트 说:
2024年2月24日 20:10

Excellent article. I absolutely appreciate this website. Keep writing!  Keep up the good piece of work, I read few articles on this site and I believe that your web blog is real interesting and contains bands of good information. You have done a great job. I will definitely digg it and personally suggest to my friends. I’m sure they will be benefited from this site. I truly enjoy studying on this site, it has fantastic blog posts.

Avatar_small
007카지노 说:
2024年2月24日 20:12

Can I truly say what a discount to are seeking out out a person who really is aware of what theyre talking approximately at the net. You truly recognise how you can deliver an problem to mild and make it vital. Extra parents need to study this and perceive this factor of the story. I cant do not forget youre no longer greater in style since you clearly have the present.

Avatar_small
토토시대 说:
2024年2月24日 20:12

Good to become visiting your weblog again, it has been months for me. Nicely this article that i've been waited for so long. I will need this post to total my assignment in the college, and it has exact same topic together with your write-up. Thanks, good share.

Avatar_small
먹튀검증사이트 说:
2024年2月24日 20:57

Hey. Neat publish. There’s a problem with the web site in chrome, and you would possibly want to check this… The browser is the market leader and an amazing phase of different parents will omit your extraordinary writing due to this problem.

Avatar_small
먹튀검증사이트 说:
2024年2月24日 20:58

I’m impressed, I have to admit. Actually hardly ever do you come across a blog that’s both educative and exciting, and virtually, you can have hit the nail round the pinnacle. Your concept is remarkable; the pain is a few aspect there are not sufficient humans are talking intelligently about. I’m very happy that I got here throughout this inside my are seeking out some thing with this.

Avatar_small
검증나라 说:
2024年2月24日 21:03

A formidable share, I just given this onto a colleague who was doing a little analysis on this. And he in truth bought me breakfast as a result of I discovered it for him.. smile. So let me reword that: Thnx for the deal with! But yeah Thnkx for spending the time to debate this, I feel strongly about it and love studying more on this topic. If possible, as you become expertise, would you thoughts updating your weblog with more details? It is extremely useful for me. Large thumb up for this blog post!

Avatar_small
ok토토먹튀검증 说:
2024年2月24日 21:05

This unique blog is without a doubt cool and informative. I have discovered many interesting advices out of this source. I ad love to return again soon. Thanks a lot ! You ave made some good points there. I checked on the web for additional information about the issue and found most people will go along with your views on this website. This particular blog is no doubt entertaining and besides informative. I have picked a bunch of useful things out of this blog. I ad love to visit it again and again. Thanks a bunch! Merely wanna say that this is very helpful , Thanks for taking your time to write this.

Avatar_small
먹휴고 说:
2024年2月24日 21:06

I’ve read some good stuff here. Definitely worth bookmarking for revisiting. I surprise how much effort you put to create such a great informative website.

Avatar_small
사설토토사이트 说:
2024年2月24日 21:07

Excellent article. I absolutely appreciate this website. Keep writing!  Keep up the good piece of work, I read few articles on this site and I believe that your web blog is real interesting and contains bands of good information. You have done a great job. I will definitely digg it and personally suggest to my friends. I’m sure they will be benefited from this site. I truly enjoy studying on this site, it has fantastic blog posts.

Avatar_small
메이저토토사이트 说:
2024年2月24日 21:18

I wish to show my gratitude for your kindness giving support to folks who have the need for help with in this subject matter. Your personal commitment to passing the solution across was extraordinarily informative and has regularly encouraged guys and women like me to attain their objectives. Your new helpful publication means a whole lot to me and especially to my fellow workers. Many thanks; from everyone of us. Thanks for every one of your labor on this blog. My mother delights in engaging in investigation and it’s simple to grasp why. My spouse and i notice all relating to the dynamic ways you offer functional strategies on your website and invigorate contribution from others on the area of interest while our favorite daughter is learning a whole lot. Enjoy the rest of the year. You are conducting a terrific job. I actually wanted to develop a small word to appreciate you for some of the lovely advice you are placing at this website. My time-consuming internet look up has now been paid with awesome tips to go over with my colleagues. I would declare that we visitors are really fortunate to live in a fine network with many lovely individuals with great guidelines. I feel very much blessed to have discovered your web page and look forward to really more cool minutes reading here. Thanks a lot once again for all the details.

Avatar_small
먹튀제보 说:
2024年2月24日 21:27

I in reality had to generate a brief comment with the intention to explicit gratitude lower lower back for all the ones terrific hints that you are posting at this website. Time ingesting internet studies has right at the surrender in the course of the day been rewarded with top first-rate strategies to percentage with my visitors. I may nation that maximum of us traffic are truly endowed to seem in a remarkable community with masses of marvellous human beings with beneficial pointers. I’m quite privileged to get used your webpages and appear beforehand to honestly extra suitable mins analyzing here. Thanks all over again for many things.

Avatar_small
먹튀검증업체 说:
2024年2月24日 21:28

This is in reality my preliminary prevent with the resource of and I surely like what I’m seeing. Your weblog is so much amusing to appearance over, quite compelling in addition to informative. I’ll absolutely endorse it to my buddies. Nevertheless, I did have a few problem with the commenting. It kept giving me an trouble every time I clicked on positioned up remark. I want, that can be constant. Many thanks

Avatar_small
먹튀검증사이트 说:
2024年2月24日 21:58

Nice read, I surely handed this onto a pal who come to be performing some studies on that. And he just bought me lunch because of the reality I determined it for him smile Thus permit me rephrase that: Thanks for lunch!

Avatar_small
먹튀대피소 说:
2024年2月24日 21:59

Nice read, I surely handed this onto a pal who come to be performing some studies on that. And he just bought me lunch because of the reality I determined it for him smile Thus permit me rephrase that: Thanks for lunch!

Avatar_small
메이저사이트추천 说:
2024年2月24日 22:20

Hey. Neat publish. There’s a problem with the web site in chrome, and you would possibly want to check this… The browser is the market leader and an amazing phase of different parents will omit your extraordinary writing due to this problem.

Avatar_small
사설먹튀검증 说:
2024年2月24日 22:21

Can I truly say what a discount to are seeking out out a person who really is aware of what theyre talking approximately at the net. You truly recognise how you can deliver an problem to mild and make it vital. Extra parents need to study this and perceive this factor of the story. I cant do not forget youre no longer greater in style since you clearly have the present.

Avatar_small
먹튀검증사이트 说:
2024年2月24日 22:22

The subsequent time I study a blog, I wish that it doesnt disappoint me as plenty as this one. I imply, I know it become my choice to study, but I surely thought youd have some thing attention-grabbing to mention. All I listen is a group of whining about some thing which you likely can restore while you werent too busy in search of interest.

Avatar_small
토토사이트 说:
2024年2月24日 22:23

Hi there, i study your weblog once in a while and i personal a comparable one and i used to be just curious if you get numerous spam feedback? If so how do you guard against it, any plugin or something you may propose? I get so much these days it’s using me mad so any assistance is very an awful lot appreciated.

Avatar_small
코인카지노 说:
2024年2月24日 22:24

I must show some thanks to you just for bailing me out of this type of problem. Because of researching through the search engines and coming across advice which are not productive, I was thinking my entire life was well over. Living without the presence of solutions to the problems you’ve solved through your entire site is a crucial case, as well as the kind which could have in a wrong way damaged my career if I had not encountered your web site. The knowledge and kindness in dealing with all the things was very useful. I don’t know what I would have done if I had not discovered such a solution like this. I am able to at this moment relish my future. Thanks for your time so much for this reliable and effective guide. I won’t hesitate to suggest your web blog to any individual who ought to have tips on this area.

Avatar_small
토토검증커뮤니티 说:
2024年2月24日 22:26

This is truely critical, You’re an exceptionally seasoned creator. I actually have signed up along with your feed plus assume taking part in your personal terrific write-ups. On top of that, I’ve were given shared your internet weblog in our social networking websites.

Avatar_small
메이저토토사이트 说:
2024年2月24日 22:27

I wish to show my gratitude for your kindness giving support to folks who have the need for help with in this subject matter. Your personal commitment to passing the solution across was extraordinarily informative and has regularly encouraged guys and women like me to attain their objectives. Your new helpful publication means a whole lot to me and especially to my fellow workers. Many thanks; from everyone of us. Thanks for every one of your labor on this blog. My mother delights in engaging in investigation and it’s simple to grasp why. My spouse and i notice all relating to the dynamic ways you offer functional strategies on your website and invigorate contribution from others on the area of interest while our favorite daughter is learning a whole lot. Enjoy the rest of the year. You are conducting a terrific job. I actually wanted to develop a small word to appreciate you for some of the lovely advice you are placing at this website. My time-consuming internet look up has now been paid with awesome tips to go over with my colleagues. I would declare that we visitors are really fortunate to live in a fine network with many lovely individuals with great guidelines. I feel very much blessed to have discovered your web page and look forward to really more cool minutes reading here. Thanks a lot once again for all the details.

Avatar_small
토토사이트검증 说:
2024年2月24日 22:28

I’m impressed, I have to admit. Actually hardly ever do you come across a blog that’s both educative and exciting, and virtually, you can have hit the nail round the pinnacle. Your concept is remarkable; the pain is a few aspect there are not sufficient humans are talking intelligently about. I’m very happy that I got here throughout this inside my are seeking out some thing with this.

Avatar_small
온라인카지노추천 说:
2024年2月24日 23:13

Hi there, simply became alert on your blog via Google, and located that it's far without a doubt informative. I¡¦m gonna be careful for brussels. I could be thankful in case you preserve this in destiny. Lots of human beings may be benefited from your writing. Cheers!

Avatar_small
안전카지노사이트 说:
2024年2月24日 23:21

Nice read, I surely handed this onto a pal who come to be performing some studies on that. And he just bought me lunch because of the reality I determined it for him smile Thus permit me rephrase that: Thanks for lunch!

Avatar_small
안전토토사이트 说:
2024年2月24日 23:27

Thanks for the recommendations you have shared right here. Something else I would love to explicit is that computer device memory specs generally upward thrust together with different breakthroughs in the technological data. For example, whilst new generations of cpus are brought to the market, there may be in reality normally an equal increase inside the scale calls for of all computer reminiscence and tough pressure room. This is because of the fact the software software software operated by way of means of these processors will inevitably surge in power to enjoy the brand new understanding.

Avatar_small
먹튀제보 说:
2024年2月24日 23:58

I have not checked in proper right here for some time thinking about that I idea it turn out to be getting dull, however the last severa posts are honestly properly satisfactory so I wager I will add you back to my normal bloglist. You deserve it my buddy.

Avatar_small
스포츠토토 说:
2024年2月25日 00:04

Whilst we obtained in your internet record nevertheless including attention just a little contact submits. Good way of possible, We're book-marking throughout a time period discover variations determine spgs method upward.

Avatar_small
토토사이트추천 说:
2024年2月25日 00:43

I’ve read some good stuff here. Definitely worth bookmarking for revisiting. I surprise how much effort you put to create such a great informative website.

Avatar_small
안전토토사이트 说:
2024年2月25日 00:50

“I’m just writing to make you understand what a helpful experience my princess enjoyed reading through your web page. She learned a lot of pieces, including what it is like to have an ideal teaching heart to get other individuals with no trouble learn selected impossible subject areas. You truly surpassed readers’ desires. Many thanks for churning out such invaluable, healthy, informative and fun tips on the topic to Julie.”

Avatar_small
토토사이트추천 说:
2024年2月25日 00:55

What would many of us do devoid of the brilliant suggestions you share on this web site? Who else has got the perseverance to cope with important topics in the interest of ordinary subscribers like me? My spouse and i and my guys are really lucky to have your website among the ones we typically visit. We hope you know how a great deal we take pleasure in your efforts! Much luck coming from us all.

Avatar_small
แนะนำเว็บไซต์แทงบอล 说:
2024年2月25日 00:58

Thanks for your submission. Another factor is that just being a photographer requires not only issues in capturing award-winning photographs but in addition hardships in getting the best photographic camera suited to your needs and most especially challenges in maintaining the standard of your camera. This is very correct and obvious for those photography lovers that are into capturing the particular nature’s eye-catching scenes : the mountains, the particular forests, the particular wild or maybe the seas. Going to these daring places undoubtedly requires a photographic camera that can surpass the wild’s nasty areas.

Avatar_small
먹튀검증 说:
2024年2月25日 01:43

Excellent article. I absolutely appreciate this website. Keep writing!  Keep up the good piece of work, I read few articles on this site and I believe that your web blog is real interesting and contains bands of good information. You have done a great job. I will definitely digg it and personally suggest to my friends. I’m sure they will be benefited from this site. I truly enjoy studying on this site, it has fantastic blog posts.


登录 *


loading captcha image...
(输入验证码)
or Ctrl+Enter