Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Any default settings possible for VIM editor?

Tags:

vim

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.

like image 383
Pranav Avatar asked Nov 16 '12 06:11

Pranav


1 Answers

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:

  1. 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.

  2. 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.

like image 60
MaiaVictor Avatar answered Oct 11 '22 14:10

MaiaVictor