How do you set up a .vimrc file on Ubuntu?
This is not helping: http://vim.wikia.com/wiki/Open_vimrc_file
- Where do you create it?
- Whats the format inside?
I know the stuff I want to put in it, just don’t know how.
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Where:
On UN*X systems your .vimrc belongs in your home directory. At a terminal, type:
This will change to your home directory and open .vimrc using vim. In vim, add the commands that you know you want to put in, then type
:wqto save the file.Now open vim again. Once in vim you can just type:
:scriptnamesto print a list of scripts that have been sourced. The full path to your .vimrc should be in that list. As an additional check that your commands have been executed, you can:echo "MY VIMRC LOADED"command to the .vimrc, and when you run vim again, you should see MY VIMRC LOADED printed in the terminal. Remove theechocommand once you’ve verified that your.vimrc is loading.echoonce vim is loaded. In the .vimrc add a line likelet myvar="MY VIMRC LOADED". Then once you’ve opened vim typeecho myvarin the command line. You should see your message.The Format:
The format of your .vimrc is that it contains Ex commands: anything that you might type in the vim command-line following
:, but in your .vimrc, leave off the:.You’ve mentioned
:set ruler: a .vimrc with only this command looks like:Search for example vimrc and look over the results. This link is a good starting point.