Re: Adding Session Awareness to a Plugin
Hi Marc, Could you get into a little more detail? I don't really have any experience in writing a plugin. All I'm trying to do is patch one so that it is session aware. Thanks a lot. On Mon, 18 Apr 2011 23:28 +0200, Marc Weber marco-owe...@gmx.de wrote: There are alternatives: Use a local .vimrc file and source that. Then put your configuration in there manually. Use a plugin such as reload to speed up applying changes. If we could settle on such a local .vimrc we could make plugins add default configuration lines to that file. That would be reasonable fast and scale much better than your plugin only solution because you can add sw tabstop, .. settings as well. And its declarative which means you can read the file again. However its much harder to read a session file. Loading local .vim files can be dangerous. That's why I made Vim keep a hash. If that changes you must confirm sourcing the file. If you're interested in it I'll turn it into a plugin. (its still contained in the deprecated tovl library). Even more nifty: You can share your setup then. Sharing session files works - but .. *shrug* - I don't want your runtimepath settings :) So I'd settle on local configuration files.. Marc Weber -- You received this message from the vim_use 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 -- Mathew Brown mathewbr...@fastmail.fm -- http://www.fastmail.fm - A no graphics, no pop-ups email service -- You received this message from the vim_use 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
Adding Session Awareness to a Plugin
Hi, I was wondering if anyone can tell me how to make a plugin session aware. For example, I starting using the Highlight plugin over at http://www.vim.org/scripts/script.php?script_id=1599 but was disappointed to find out that as soon as I saved my session, exited and then reloaded my session, all the highlights made in my previous session were lost. Other plugins such as the TabName plugin could really use this as well. Any ideas? Thanks for your help. -- Mathew Brown mathewbr...@fastmail.fm -- http://www.fastmail.fm - A no graphics, no pop-ups email service -- You received this message from the vim_use 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
Re: Adding Session Awareness to a Plugin
Reply to message «Adding Session Awareness to a Plugin», sent 23:28:41 19 April 2011, Tuesday by Mathew Brown: I can see only two different approaches here: 1. Create custom `MkSession {name}' command which will save session file {name}.vim and near {name}x.vim which will do plugin-related setup (it is what I do in vimpluginloader. It is going to be replaced with frawor, so don't use it). See 10'th item in `:h :mksession'. 2. Save custom data in a global variable which starts with an uppercase letter and contains at least one lowercase letter, then use SessionLoadPost event to actually restore the session. See 2'nd item in `:h :mksession' and search for `globals' in `:h 'sessionoptions''. Original message: Hi, I was wondering if anyone can tell me how to make a plugin session aware. For example, I starting using the Highlight plugin over at http://www.vim.org/scripts/script.php?script_id=1599 but was disappointed to find out that as soon as I saved my session, exited and then reloaded my session, all the highlights made in my previous session were lost. Other plugins such as the TabName plugin could really use this as well. Any ideas? Thanks for your help. signature.asc Description: This is a digitally signed message part.
Re: Adding Session Awareness to a Plugin
There are alternatives: Use a local .vimrc file and source that. Then put your configuration in there manually. Use a plugin such as reload to speed up applying changes. If we could settle on such a local .vimrc we could make plugins add default configuration lines to that file. That would be reasonable fast and scale much better than your plugin only solution because you can add sw tabstop, .. settings as well. And its declarative which means you can read the file again. However its much harder to read a session file. Loading local .vim files can be dangerous. That's why I made Vim keep a hash. If that changes you must confirm sourcing the file. If you're interested in it I'll turn it into a plugin. (its still contained in the deprecated tovl library). Even more nifty: You can share your setup then. Sharing session files works - but .. *shrug* - I don't want your runtimepath settings :) So I'd settle on local configuration files.. Marc Weber -- You received this message from the vim_use 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