Any default settings possible for VIM editor?

vim

Solution

Just paste those lines on the file `~/.vimrc` and they'll be executed everytime VIM is openned. If it does not exist, create one.

Two recommendations:

Use a plugin that will auto-load `.vimrc` when you save it. Being confortable with editting `.vimrc` is very important. Building it up with your preferences and key-mappings as you learn VIM is one of the reasons it is so powerful.

Google now for some ready `.vimrc` setups as they override some not-so-optimal VIM configurations. For example, you probably won't want that annoying bell beep, among many other things.

Problem

I use ":set ai sw=4" and ":set number" (and some other cmd) commands each time when I open any file in VIM. For every new instance of VIM I have to enter set of commands. Is there any way where I can put these commands and VIM will execute it every time while opening any file like default settings.

Original source

Related problems