1

Could somebody explain, why some people add

set ruler
syntax on

to their vimrcs? Aren't these settings are already enabled by default? Is there an objective reason for it?

0

1 Answer 1

2

There is defaults.vim that is being sourced when you don't have your own vimrc.

It sets syntax on and set ruler.

So if you have your own vimrc and you would not set those, then you would not have syntax highlighting and a ruler.

Check :h 'ruler' for example:

'ruler' 'ru'        boolean (default off, set in |defaults.vim|)

And there you can follow defaults.vim link and read about it.

Also you can :e $VIMRUNTIME/defaults.vim to see what exactly is set up when you don't have any vimrc.

3
  • Thanks. Yes, I know about defaults.vim, I simply don't see a reason to not use it.
    – user90726
    Commented Sep 4, 2021 at 12:20
  • why not to use defaults.vim or ruler + syntax on?
    – Maxim Kim
    Commented Sep 4, 2021 at 12:23
  • 1
    @jsv When you make a vimrc, defaults no longer applies (unless you explicitly request it). PS prefer syntax enable, it cooperates better.
    – D. Ben Knoble
    Commented Sep 4, 2021 at 15:18

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.