Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Suggestion: Capture at least some options #8

Open
tssm opened this issue Mar 21, 2013 · 8 comments
Open

Suggestion: Capture at least some options #8

tssm opened this issue Mar 21, 2013 · 8 comments

Comments

@tssm
Copy link

tssm commented Mar 21, 2013

Hi Tim:

Don't capture options and maps. Options are sometimes mutilated and maps just interfere with updating plugins.

I agree about mappings, but I think It would be pretty useful to save path and tags, and even allow to pass them as options to :Obsession, that way every session could be more like an IDE project, but ala Vim. What do you think?

@tpope
Copy link
Owner

tpope commented Mar 21, 2013

The initial reason for disabling options was because path and tags were getting truncated to 4096 characters. That's what I mean by "mangling."

Beyond that, I don't understand your use case. Are you setting 'path' and 'tags' interactively? Mine are just set from autocommands so they're always correct.

@tssm
Copy link
Author

tssm commented Mar 21, 2013

Usually I create a session by project, so I set path to its root, and tags to tag files only related to that project, and save the session. That way, I can open a "project" and :find will look recursively only among its files, same thing for Ctrl+]...

Do you use autocommands by file type or something similar?

@tpope
Copy link
Owner

tpope commented Apr 5, 2013

I do, with a lot of help from plugins. In JVM projects I use classpath.vim, for example, while Ruby projects get handled by some combination of vim-ruby, rails.vim, and bundler.vim.

I do think using the project root is a good fallback for miscellaneous projects. And I have some ideas for how to achieve that automatically. But it'll probably be a few months before I have anything to show.

@tssm
Copy link
Author

tssm commented Apr 7, 2013

CtrlP (which is over kill for me) uses directories like .git or .svn to determine the project's root. I think that is a nice solution for options like path or tags. What do you think?

@tpope
Copy link
Owner

tpope commented Apr 11, 2013

I think that's a pretty good heuristic, and probably not too hard to automate. One place this doesn't work so well is libraries installed by a package manager. CtrlP has burned me on Ruby Gems a lot.

@blueyed
Copy link

blueyed commented Mar 15, 2014

The vim-session plugin has an option g:session_persist_globals to define a list of globals that should get persisted (FWIW, it also executes sessionoptions-=options unconditionally).

@benknoble
Copy link

One other "set" of options to consider are those relevant to :compiler (makeprg and errorformat). I recently noticed this was not being unsaved and it slows me down to have to remember to invoked compiler when I restore the session.

I don't want to run compiler in ftplugins/autocommands for various reasons, as I think it should be determined per-project, not per filetype, so I'd love to see Obsession support this use-case.

@bart9h
Copy link

bart9h commented Mar 3, 2022

I also have the need to persist makeprg.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants