Learn faster and stay on-track by joining this free class with other self-learners.
Learning Vim from the inside
Class length: 8 weeks. Start anytime.
|Join this class!|
Lesson 3: Assignment 4
Vim reads startup files... ~/.vimrc for example.
How does that work?
How did you find the answer?
What are the various startup files Vim can/will read if they exist?
Pop quiz: What happens unexpectedly when you run:
...and... why? :-)
will it print the current system date time in the terminal before the user type 'enter', then it goes in the editor window because on start up, VIMINIT variable is the first thing vim looks at (same quote with the previous answers). It runs the script in VIMINIT before it actually start?
Good description of secure mode and why it gets turned on. Well done.
So why not use 'lid .vimrc' instead of grep?
Awesome work identifying the order Vim looks for the files, and that it only loads and processes the first one it finds.
Rockin! Awesome work.
Question for you: Did you have any idea there were that many startup files Vim will read if they exist? (I found that a bit disconcerting)
Also: For me, -Sn works just as well as providing 'newline' as a standalone followup arg to -S - and it's a lot less typing. I found it by accident; your mileage may vary.
I had no idea there was potentially this manny. I have been using vim for a while and I knew about .vimrc. I just knew there existed a system wide vimrc but I never cared about it. I was surprised there could be 3 global ones!
Yeah. Actually this is an achilles heel for Vim. A local user might be able to create one or another of these files with some scripting to do something neat the next time root run Vim. Not good.