On 20/07/09 10:36, [email protected] wrote:
>
> Hi,
>
> I use a simple ftplugin for *.txt: set expandtab.
> I apply the settings via .vimrc's autocommand like this:
>
> [...]
> " default: disable expandtab
> set noet
>
> " file type specific settions:
> au BufNewFile,BufRead,BufWinEnter *.txt       set filetype=txt
> [...]
>
> The problem: When I do "vim test.txt" directly all my *.txt filetype
> settings are applied.
> However, loading it via a session file, the settings are NOT applied
> ("set expandtab" is not set).
>
> I checked the session file and found out that commenting out the
> following lines
> brings back the wanted behaviour:
>
> [...]
> if expand('%') == ''&&  !&modified&&  line('$')<= 1&&  getline(1) ==
> ''
>    let s:wipebuf = bufnr('%')
> endif
> [...]
>
> if exists('s:wipebuf')
>    silent exe 'bwipe ' . s:wipebuf
> endif
> unlet! s:wipebuf
> [...]
>
> I neither have an idea what these lines are good for nor can I change
> them
> since these lines are auto-generated upon each session file re-write
> -- what can I do?
>
> Thank You
>   Felix

IIUC, these lines are there so that when you start Vim as

        gvim -S
or
        gvim -S mysession.vim

the empty [No Name] buffer, which is there before Vim loads the session, 
finally gets wiped out so that you don't get an additional blank window 
in addition to your reloaded session.

A session file saves the options when you run ":mksession" and restores 
then when you start "vim -S". _What_ is saved is governed by your 
'sessionoptions' setting.

I is quite possible to run a startup script _not_ created by 
":mksession" as a result of "vim -S". Here's my current ~/Session.vim

e   ~/.mozilla/sunbird/8jrlswxe.default/user.js
new ~/.mozilla/seamonkey/nexrdon9.default/user.js
new ~/.mozilla/seamonkey/nexrdon9.default/chrome/userChrome.css
new ~/.mozilla/seamonkey/nexrdon9.default/chrome/userContent.css
new ~/.mozilla/seamonkey/nexrdon9.default/chrome/userChrome.js
new ~/.mozilla/firefox/x5sh35vw.testing/user.js
new ~/.mozilla/firefox/x5sh35vw.testing/chrome/userChrome.css
new ~/.mozilla/firefox/x5sh35vw.testing/chrome/userContent.css
new ~/.mozilla/firefox/15jqlowi.16may2006/user.js
new ~/.mozilla/firefox/15jqlowi.16may2006/chrome/userChrome.css
new ~/.mozilla/firefox/15jqlowi.16may2006/chrome/userContent.css
new ~/.mozilla/firefox/15jqlowi.16may2006/chrome/launchy.xml
new ~/.thunderbird/0g7ur1s6.default/chrome/userChrome.css
new ~/.thunderbird/0g7ur1s6.default/chrome/userContent.css
new ~/desktops.txt
new ~/deviantart.txt
new ~/942philo.txt
new $VIM/vimfiles/keymap/russian-phonetic_utf-8.vim
new
lcd ~/pub/slovarj
e   ru-fr.css
new ru-fr.abbrev.html
new ru-fr.03.html
setl keymap=russian-phonetic
let $VIMSRC = '/root/.build/vim/vim72'
sleep 3
intro

-- yes, I have a lot of split-windows. All the options (other than the 
keymap for one of the windows) are set by my vimrc, including the 
"Rolodex vim" setting (":set wh=99999 wmh=0") to allow the window in use 
to be big enough for practical use.


Best regards,
Tony.
-- 
hundred-and-one symptoms of being an internet addict:
84. Books in your bookcase bear the names Bongo, WinSock and Inside OLE

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

Reply via email to