junegunn / goyo.vim

:tulip: Distraction-free writing in Vim
MIT License
4.52k stars 116 forks source link

How to add the width / margin configs in .vimrc? #49

Closed samuell closed 9 years ago

samuell commented 9 years ago

In the readme, it is just stated that configuration is done with

g:goyo_width (default: 80) g:goyo_margin_top (default: 4) g:goyo_margin_bottom (default: 4) g:goyo_linenr (default: 0)

... but for me as a non-vim-expert, I'm unsure about how to set this?

I've tried with

let g:goyo_width = 96
let g:goyo_margin_top = 0
let g:goyo_margin_bottom = 0
let g:goyo_linenr = 0

... which does not give errors, but does not seem to take effect either ...

Any help appreciated!

junegunn commented 9 years ago

That's the right way to do it. Try this and you'll notice that it works as expected.

let g:goyo_width = 50
let g:goyo_margin_top = 10
let g:goyo_margin_bottom = 10

However, top and bottom margins can't be completely removed. They'll take up 2 or 3 lines each even when you set them to zero. It's the current limitation of Goyo.

And you can dynamically resize the window with :Goyo [WIDTH] command or CTRL-W > / CTRL-W < / CTRL-W + / CTRL-W - keys.

samuell commented 9 years ago

@junegunn Ok, thanks for the quick reply! Ok, I guess it was because of those few remaining lines, that I thought it didn't work! Guess it's quite OK like this anyway ... thanks for a very useful module! :)

bora89 commented 6 months ago

So the key was let, without it it gave error Pattern not found: goyo_liner=1