junegunn / goyo.vim

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

Terminal vim uses gvim colorscheme on exit #44

Closed Maxlufs closed 9 years ago

Maxlufs commented 9 years ago

Hi, thanks for this excellent plugin. Though I'm not sure if it's me, when i exit the Goyo mode in terminal vim, my colorscheme changed to what's set up for gvim. I guess it has something to do with my vimrc, since i overwrite the highlight of some groups, Would it be possible to reload vimrc rather than only the colorscheme? maybe i should add a keybiding to restore the original colors.

junegunn commented 9 years ago

Goyo obviously does not know (or care) which color scheme you use on terminal or on GVim. It just reloads the current color scheme whose name is stored in g:colors_name to restore some colors it changed (see here) So I assume that you're somehow misguided. Check the value of g:colors_name variable.

If you want to reload your vimrc on exit, add the following lines to your .vimrc

autocmd! User GoyoLeave
autocmd  User GoyoLeave nested source ~/.vimrc

https://github.com/junegunn/goyo.vim#callbacks

Maxlufs commented 9 years ago

That helps! thanks a lot! cuz i overwrote some of the color groups in my colorscheme, that's why it falls back to the default whatever saved in g:colors_name.

Maxlufs commented 9 years ago

autocmd! User GoyoLeave autocmd User GoyoLeave nested source $MYVIMRC | silent loadview

junegunn commented 9 years ago

So it looks like you found the solution! :) I'll close the issue.