

vimrc file in your dotfiles folder.ĭo this for all your config files and keep them version controlled! Why should I version control dotfiles?įor the same reason that you’d version control any of your source codes. But because of the created symlink, the command vim ~/.vimrc won’t throw an error and will open up the.


In actuality, ~/.vimrc file does not exist. Now on your terminal, do vim ~/.vimrc.To check the link: ls -l ~/.vimrc You’ll see an output like this: /Users/shivangisareen/.vimrc -> /Users/shivangisareen/dotfiles/.vimrc.To set up the link: ln -s ~/dotfiles/.vimrc ~/.vimrc We’re linking ~/dotfiles/.vimrc to point to ~/.vimrc.Check it out using man ln on your terminal. Next is to set up the symbolic link or symlink.Add, commit and push these changes to Github.vimrc and that is in your dotfiles directory. Make sure that there is only one copy of. The path will look like this: ~/dotfiles.
#BEST VIMRC FOR MAC UPDATE#
To have a repository that can be source controlled, create a dotfiles repository on Github and clone it in your home folder. Due to access limitation, i can only update the files under my home directory and cant modify the VIM.These should be version controlled like any other source code. set noerrorbells visualbell t_vb= : This disables audible sounds for errors.Ī dotfile is a file with a.If has(‘unnamedplus’) set clipboard+=unnamedplus else set clipboard=unnamed endif The setting makes default copy and paste to use the clipboard. Note that you will have to use the yank y command to copy lines in Vim. There’s a small if-else loop that enables copy-pasting to and from external places and Vim. The below looks slightly different than the above.Set autoindent set noexpandtab set smartindent exec 'set tabstop=3' exec 'set textwidth=0' exec 'set shiftwidth=3' exec 'set softtabstop=3' The below setting is for auto-indenting and getting the indentation lines.set mouse+=a : It’s convenient to enable mouse support but don’t get too used to it - use the keyboard more.Without this setting, using the :a (append) mode does the two-in-one trick of moving an extra space and entering insert mode. Being used to the :i for insert mode, not having this setting enabled drove me crazy. set ve+=onemore : This lets you move your cursor an extra space after the end of a line.This setting makes backspace work the expected way. Vim only lets us delete any text if it’s what we’ve only recently added in the current Vim session. In the insert mode, the backspace key is frozen. set backspace=indent,eol,start : By default the backspace doesn’t work like it’s supposed to.
