'fdls' takes no effect

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

'fdls' takes no effect

Woody Wu

Hi,

I set my 'fdm' to 'syntax'.  And, I also wish that when my files are
opened, they are default not with any fold closed.   I tried to use
'set fdls=99' but the result is not changed: folders are always closed
for some levels.

Can you help?  Thanks.


--
Life is the only flaw in an otherwise perfect nonexistence
    -- Schopenhauer

narke
public key at http://subkeys.pgp.net:11371 ([hidden email])

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

Reply | Threaded
Open this post in threaded view
|

Re: 'fdls' takes no effect

Tim Chase

> I set my 'fdm' to 'syntax'.  And, I also wish that when my files are
> opened, they are default not with any fold closed.   I tried to use
> 'set fdls=99' but the result is not changed: folders are always closed
> for some levels.

It might take a bit more information to track down what's
happening.  The first places I'd check:

1) does your file have a modeline that overrides 'foldlevel'?

2) do you have an autocmd that overrides 'foldlevel'?

You might try looking at the results of

   :verbose set foldlevel? fdls?

to see if either was set someplace unexpected.

-tim



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

Reply | Threaded
Open this post in threaded view
|

Re: 'fdls' takes no effect

Woody Wu

On Sun, Oct 25, 2009 at 3:39 AM, Tim Chase <[hidden email]> wrote:

>
>> I set my 'fdm' to 'syntax'.  And, I also wish that when my files are
>> opened, they are default not with any fold closed.   I tried to use
>> 'set fdls=99' but the result is not changed: folders are always closed
>> for some levels.
>
> It might take a bit more information to track down what's
> happening.  The first places I'd check:
>
> 1) does your file have a modeline that overrides 'foldlevel'?

nope

>
> 2) do you have an autocmd that overrides 'foldlevel'?

my 'set fdls' command are put in ~/.vim/filetype.vim,  it is a autocmd itself:

au BufNewFile,BufRead *.c           call s:cfold()
au BufNewFile,BufRead *.cpp         call s:cfold()
au BufNewFile,BufRead *.h           call s:cfold()

func! s:cfold()
    set fdm=syntax
    set fdls=99
endfun

>
> You might try looking at the results of
>
>   :verbose set foldlevel? fdls?

it say, last value was set from filetype.vim and foldlevel=0, fdls=99


so, I add 'set fdl=99' to my autocmd list above and problem disappeared!

Is there an explain?

>
> to see if either was set someplace unexpected.
>
> -tim
>
>
>
> >
>



--
Life is the only flaw in an otherwise perfect nonexistence
    -- Schopenhauer

narke
public key at http://subkeys.pgp.net:11371 ([hidden email])

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

Reply | Threaded
Open this post in threaded view
|

Re: 'fdls' takes no effect

Benjamin Fritz



On Oct 24, 9:58 pm, Steven Woody <[hidden email]> wrote:
> > 2) do you have an autocmd that overrides 'foldlevel'?
>
> my 'set fdls' command are put in ~/.vim/filetype.vim,  it is a autocmd itself:
>

'foldlevelstart' is not SUPPOSED to be an autocmd, it defines the
starting fold level for ALL files, and setting 'foldlevel' will change
it. Just put it in your .vimrc. If you want to change the fold level
file-by-file, or filetype-by-filetype, use the 'foldlevel' option.
--~--~---------~--~----~------------~-------~--~----~
You received this message from the "vim_use" maillist.
For more information, visit http://www.vim.org/maillist.php
-~----------~----~----~----~------~----~------~--~---

Reply | Threaded
Open this post in threaded view
|

Re: 'fdls' takes no effect

Woody Wu

On Mon, Oct 26, 2009 at 9:55 PM, Ben Fritz <[hidden email]> wrote:

>
>
>
> On Oct 24, 9:58 pm, Steven Woody <[hidden email]> wrote:
>> > 2) do you have an autocmd that overrides 'foldlevel'?
>>
>> my 'set fdls' command are put in ~/.vim/filetype.vim,  it is a autocmd itself:
>>
>
> 'foldlevelstart' is not SUPPOSED to be an autocmd, it defines the
> starting fold level for ALL files, and setting 'foldlevel' will change
> it. Just put it in your .vimrc. If you want to change the fold level
> file-by-file, or filetype-by-filetype, use the 'foldlevel' option.
> >
>

understand, thanks!

--
Life is the only flaw in an otherwise perfect nonexistence
    -- Schopenhauer

narke
public key at http://subkeys.pgp.net:11371 ([hidden email])

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