jagpreet sent on 7 Apr 2006 18:29:09 +0530:
> [after using :mkview to store the view of a file] Now
> when I open the same file for which I stored the view I
> get error message at command prompt "E490: No fold
> found" with line numbers. Followed by message press
> enter to continue.
Don't know what this is all about -- some things to
examine would be what method is used for creating the
folds in your file, and if the fold method which is
turned on when you open the file is the same as the fold
method used to create the folds; if you used an
expression, see if foldexpr has the right value; value
of foldenable; etc.
> But I'm unable to view the file the way I stored.
> However after giving the command :loadview I can view
> the same. I added the line loadview in my .vimrc but
> results the same.
Not in you .vimrc, but in an autocommand. See the third
or fourth para of help loadview.
> My queries are is it possible to view the file the way I
> stored. i.e. with the folds closed.
If you just want all the folds closed (rather than
various regions folded to various extents), then see
help foldlevelstart
> I checked the command zC to closed all the foleds
> recursively under the cursor. I guess it is for the
> multi-level folds.
>
> Is it possible to close all the folds(defaults) with
> just one command.
If none of the preceding suggestions helped, nmap
something to ggvGzC (no space at end of map); for
example:
nmap <F1> ggvGzC
--Suresh