vim-obsession icon indicating copy to clipboard operation
vim-obsession copied to clipboard

Suggestion: Capture at least some options

Open tssm opened this issue 11 years ago • 8 comments

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?

tssm avatar Mar 21 '13 19:03 tssm

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.

tpope avatar Mar 21 '13 19:03 tpope

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?

tssm avatar Mar 21 '13 21:03 tssm

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.

tpope avatar Apr 05 '13 20:04 tpope

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?

tssm avatar Apr 07 '13 01:04 tssm

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.

tpope avatar Apr 11 '13 15:04 tpope

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).

blueyed avatar Mar 15 '14 16:03 blueyed

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.

benknoble avatar Jan 28 '19 00:01 benknoble

I also have the need to persist makeprg.

bart9h avatar Mar 03 '22 17:03 bart9h