tpope / vim-obsession

obsession.vim: continuously updated session files
http://www.vim.org/scripts/script.php?script_id=4472
1.74k stars 68 forks source link

Persist `winfixwidth` #63

Closed cvincent closed 3 years ago

cvincent commented 4 years ago

Is there a way to configure this plugin, or the Vim session functionality it builds upon, to persist winfixwidth on my windows? This is the only aspect of my layouts that don't get restored. From my searching, there doesn't seem to be a way to tell Vim what settings to save.

tpope commented 3 years ago

Haven't tested but you can probably achieve this with :set sessionoptions+=localoptions.

cvincent commented 2 years ago

Coming back to this a couple years later while reconfiguring my Vim from scratch, I realize that this worked for winfixwidth but also created a number of issues which had been vexxing me. localoptions also causes all <buffer> mappings to be saved to the session, which can wreak all kinds of havoc when, for example, switching plugins in and out or changing your own mappings.

Not looking for a "fix" or solution, I will just live without persisting winfixwidth for now and wanted to post this here for the benefit of intrepid internet searchers. However, a dirty fix might be to remove all mapping lines from the session file after it's written, just not sure what a relatively clean way to trigger that would be.

tpope commented 2 years ago

On the autocmd User Obsession event, you could probably readfile(g:this_obsession), filter out the lines you don't want, and write it back out.

cvincent commented 2 years ago

Thanks, I'll give that a shot!