junegunn / goyo.vim

:tulip: Distraction-free writing in Vim
MIT License
4.5k stars 115 forks source link

Disable minibufexpl while in Goyo mode #9

Closed adelarsq closed 10 years ago

adelarsq commented 10 years ago

Disable by default minibufexpl plugin (https://github.com/techlivezheng/vim-plugin-minibufexpl.git) while in Goyo mode.

junegunn commented 10 years ago

Hi, as far as I know, MiniBufExpl is local to each tab and thus not visible in Goyo tab which has only one buffer. This is how it looks on my machine: http://imgur.com/ohnqEuS

adelarsq commented 10 years ago

The problem is the configuration:

let g:miniBufExplBuffersNeeded  = 1

Without this configuration works fine.

junegunn commented 10 years ago

Have you tried setting up g:goyo_callbacks? (See https://github.com/junegunn/goyo.vim#callbacks)

Try adding the following code to your .vimrc:

function! s:goyo_before()
  MBEClose
  wincmd w
endfunction

let g:goyo_callbacks = [function('s:goyo_before')]

Before g:goyo_callbacks was introduced, I'd tried to include code for toggling other plugins, such as vim-airline or powerline. However, I quickly realized that it is not possible or appropriate for this plugin to handle every other plugin out there. So I added g:goyo_callbacks, which gives the user greater flexibility to customize the window.

adelarsq commented 10 years ago

I was doing, but was wrong. You are right, the appropriate way to do this is outside from plugin. To help beginers like me may be that this information can be avaiable in the documentation, updated for each plugin. What you think? By the way, my problem is solved. Thanks @junegunn

junegunn commented 10 years ago

No problem. I've just created a wiki page. I'll add the link to in on the README page. Thanks.