junegunn / goyo.vim

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

How to open file directly in Goyo? #194

Closed ipsod closed 5 years ago

ipsod commented 5 years ago

Is it possible to open a file directly in Goyo?

I'd like to

xiwire commented 5 years ago

From the command line, it's possible to tell vim which commands to run when it opens with the syntax +<command>. To open a file directly in Goyo, you can run vim file +Goyo.

ipsod commented 5 years ago

@jxpp I think that answers the title of my question, but not the body of it. I want to open a Goyo tab from inside of vim (not from the command line), without the intermediate step of first opening that file, which always makes it so that the file is open in two places - the original window, and the Goyo window.

junegunn commented 5 years ago

Goyo was designed to be a "mode" that you turn on and off on the current editing buffer. You can think of it as a :tab split with (or should we say without?) bells and whistles.

So the behavior you described is not supported. Consider writing a custom Vim function/command that automates the workflow. Also using :bd to close the Goyo tab will have a similar, albeit not identical, effect.