junegunn / limelight.vim

:flashlight: All the world's indeed a stage and we are merely players
MIT License
2.36k stars 53 forks source link

Limelight enabled by default #37

Closed vivien closed 7 years ago

vivien commented 7 years ago

Hi! How can I have Limelight on when starting Vim?

junegunn commented 7 years ago
autocmd VimEnter * Limelight

in your .vimrc.

vivien commented 7 years ago

Works perfectly, thanks :+1:

Just curious, when writing a plugin, what'd be the cons/pros to choose between letting the user do:

autocmd VimEnter * Limelight

or adding something like this in the plugin itself:

if g:plugin_enabled_on_startup
  if v:vim_did_enter
    Limelight
  else
    autocmd VimEnter * Limelight
  endif
endif

What's your approach?

junegunn commented 7 years ago

Always strive to keep it simple. I don't care for plugins with a plethora of options.

The former: Using native construct that users already know and it's infinitely more flexible. The latter: Doing the same thing with more code, users have to read and learn about the feature, typo in the variable name is not checked. What's the point?

vivien commented 7 years ago

I definitely agree. I had a good clue when writing down the question, but it's always interesting to get points of view from others.