12391Svar: Re: Svar: Folding
- Jun 4, 2011fredag 3. juni 2011 kl. 15:37:57 UTC+2 skrev Eric Weir følgende:On Jun 2, 2011, at 10:55 AM, Eric Weir wrote:This is because vim naively tries to load the view for an empty buffer, but of course no saved view exists for the empty buffer. The same happens when you open a help page. There is no saved view for the help pages, so you will get an error. One simple solution is to use "silent!" instead of "silent". This will silence any error message. My preferred solution is to instead to save views only for files of certain extensions (since mkview saves a lot of things, not just folds, and sometimes you just don't want it all saved). So, for instance,autocmd BufWinLeave *.txt mkviewautocmd BufWinEnter *.txt silent loadviewAnd you could also useautocmd BufWinLeave *.* mkviewautocmd BufWinEnter *.* silent loadviewfor it to work with all files with a file extension.Try disabling all plugins and clean your .vimrc file, and see if it still happens. You may also have to clean your ~/.vim/views folder, which is where the views are saved (but then you will loose the folds).Then please see :h viewoptions . As you see, a lot of things about the state of the file are saved with mkview, not only folds. It may be a very good idea to only save the things you need, like e.g. :set viewoptions=folds,cursorGood luck further! But please try to avoid quadruple-posting next time.– Dan Michael--
You received this message from the "vim_mac" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php
- << Previous post in topic Next post in topic >>