mirror of
https://github.com/junegunn/goyo.vim.git
synced 2025-11-16 23:33:42 -05:00
Add FAQ section
This commit is contained in:
50
README.md
50
README.md
@@ -107,6 +107,56 @@ autocmd! User GoyoLeave nested call <SID>goyo_leave()
|
||||
More examples can be found here:
|
||||
[Customization](https://github.com/junegunn/goyo.vim/wiki/Customization)
|
||||
|
||||
FAQ
|
||||
---
|
||||
|
||||
> _"My custom colors are lost when I exit Goyo!"_
|
||||
|
||||
That's because Goyo restores the base color scheme using `:colorscheme
|
||||
CURRENT_COLOR_SCHEME` command on exit, and it resets your tweaks. Goyo can try
|
||||
to remember all your customizations and restore them on exit, but it doesn't,
|
||||
because there is a better, more robust way to address the issue.
|
||||
|
||||
The real problem here is that you will lose all your changes when you switch
|
||||
between color schemes, even when you're not using Goyo.
|
||||
|
||||
```vim
|
||||
" In your Vim configuration file
|
||||
" - Base color scheme
|
||||
colorscheme molokai
|
||||
|
||||
" - Your color customizations
|
||||
hi LineNr ctermfg=red guifg=red
|
||||
```
|
||||
|
||||
It works, only when you stick to a single color scheme. When you switch
|
||||
between color schemes,
|
||||
|
||||
```vim
|
||||
" Switch to another color scheme
|
||||
colorscheme Tomorrow-Night
|
||||
|
||||
" Switch back to the original one
|
||||
colorscheme molokai
|
||||
```
|
||||
|
||||
And all the customizations you have made are lost.
|
||||
|
||||
What you should to do is to customize the colors on `autocmd ColorScheme`,
|
||||
which is automatically triggered whenever you change color schemes.
|
||||
|
||||
```vim
|
||||
function! s:tweak_molokai_colors()
|
||||
" Your molokai customizations
|
||||
hi LineNr ...
|
||||
hi FoldColumn ...
|
||||
endfunction
|
||||
|
||||
autocmd! ColorScheme molokai call s:tweak_molokai_colors()
|
||||
|
||||
colorscheme molokai
|
||||
```
|
||||
|
||||
Inspiration
|
||||
-----------
|
||||
|
||||
|
||||
Reference in New Issue
Block a user