Discussion:
format indent for/while
bill lam
2008-12-18 03:15:33 UTC
Permalink
I found that some programming keywords such as for/while, indent the
block when gq

for this block,

for sdfjkls klsjf klj sdfj
ksfjkl skljf sklfj kl s fsdf
sfjksldfjkl sdf skljf
sdkfjklsjdfskljfj sdf
sdfsl;kfl;ksf sf sdfsdf sdf

after gq} became

for sdfjkls klsjf klj sdfj
ksfjkl skljf sklfj kl s fsdf
sfjksldfjkl sdf skljf
sdkfjklsjdfskljfj sdf
sdfsl;kfl;ksf sf sdfsdf sdf

it shows the same behavior for ft= empty or other types. What should
be done to stop this indent?
--
regards,
====================================================
GPG key 1024D/4434BAB3 2008-08-24
gpg --keyserver subkeys.pgp.net --recv-keys 4434BAB3
唐詩017 王維 西施詠
艷色天下重 西施寧久微 朝為越溪女 暮作吳宮妃 賤日豈殊眾 貴來方悟稀
邀人傅脂粉 不自著羅衣 君寵益嬌態 君憐無是非 當時浣紗伴 莫得同車歸
持謝鄰家子 效顰安可希

--~--~---------~--~----~------------~-------~--~----~
You received this message from the "vim_use" maillist.
For more information, visit http://www.vim.org/maillist.php
Tony Mechelynck
2008-12-18 07:18:02 UTC
Permalink
Post by bill lam
I found that some programming keywords such as for/while, indent the
block when gq
for this block,
for sdfjkls klsjf klj sdfj
ksfjkl skljf sklfj kl s fsdf
sfjksldfjkl sdf skljf
sdkfjklsjdfskljfj sdf
sdfsl;kfl;ksf sf sdfsdf sdf
after gq} became
for sdfjkls klsjf klj sdfj
ksfjkl skljf sklfj kl s fsdf
sfjksldfjkl sdf skljf
sdkfjklsjdfskljfj sdf
sdfsl;kfl;ksf sf sdfsdf sdf
it shows the same behavior for ft= empty or other types. What should
be done to stop this indent?
:help 'formatoptions'
:help 'cindent'
:help 'indentexpr'
:help :filetype-indent-off
:help :filetype-overview

And to know the value of an option and where it was set, e.g.
'formatoptions':

:verbose set fo?

To see how filetype detection is currently set:

:filetype

with no arguments.


Best regards,
Tony.
--
"The sooner you fall behind, the more time you'll have to catch up!"

--~--~---------~--~----~------------~-------~--~----~
You received this message from the "vim_use" maillist.
For more information, visit http://www.vim.org/maillist.php
-~----------~----~----~----~------~----~------~--~---
bill lam
2008-12-18 07:53:54 UTC
Permalink
Post by Tony Mechelynck
:help 'formatoptions'
:help 'cindent'
:help 'indentexpr'
:help :filetype-indent-off
:help :filetype-overview
Thanks for pointers, I just found it is caused by smartindent which
uses cinw which contains for/while and other common c keywords. I
disabled smartindent and the problem gone.
--
regards,
====================================================
GPG key 1024D/4434BAB3 2008-08-24
gpg --keyserver subkeys.pgp.net --recv-keys 4434BAB3
唐詩090 唐玄宗 經鄒魯祭孔子而歎之
夫子何為者 栖栖一代中 地猶鄹氏邑 宅即魯王宮
歎鳳嗟身否 傷麟怨道窮 今看兩楹奠 當與夢時同

--~--~---------~--~----~------------~-------~--~----~
You received this message from the "vim_use" maillist.
For more information, visit http://www.vim.org/maillist.php
-~----------~----~----~----~------~----~------~--
Loading...