junegunn / goyo.vim

:tulip: Distraction-free writing in Vim
MIT License
4.53k stars 118 forks source link

Auto-resizing after creating and destroying new windows #95

Closed sencer closed 8 years ago

sencer commented 8 years ago

Hi,

I am using goyo when working with markdown files. A problem I am facing is when I am using it with a dictionary plugin (https://github.com/sencer/wordnet.vim) to lookup some words. This plugin creates a window to look up the definitions, and destroys it after looking up. But this messes with the height of goyo windows. Is there a way around this?

junegunn commented 8 years ago

CTRL-W= will reset the size of the Goyo window. So maybe you can set up a buffer local mapping in the wordnet window to close it and trigger the mapping (normal <c-w>=) afterwards. However, note that CTRL-W= will resize the window to its initial size, which may not be what you want if you have manually resized it. But after all, Goyo was not designed to work well with plugins that creates splits.