This is series of articles explaining our development Environment. This time we will be discussing
about vimrc
which is a configuration file that we can use to manage our Vim settings.
You can find the file here.
Basic Vim Settings
set number
It enables line number in vimset relativenumber
Enables relative numbers in vim. Means Vim will adjust line numbers based on your current cursor position.set linebreak
Break lines at word if you have enabled wraplines.set showbreak=+++
Identify breaked lines with +++set textwidth=100
Line wrap (number of cols)set showmatch
Highlight matching braceset hlsearch
Highlight all search resultsset smartcase
Enable smart-case searchset ignorecase
Always case-insensitiveset incsearch
Searches for strings incrementallyset autoindent
Auto-indent new linesset smartindent
Enable smart-indentset smarttab
Enable smart-tabsset softtabstop=4
Number of spaces per Tabautocmd BufRead,BufNewFile *.md setlocal spell
Enables spell check for markdown files, ending with extension mdset complete+=kspell
Enables spelling auto complete.
Advanced Settings
set ruler
” Show row and column ruler informationset showtabline=0
” Show tab barset undolevels=200
” Number of undo levelsset backspace=indent,eol,start
” Backspace behavioursfiletype plugin on
Enables filetype detection along with plugins.set tabstop=2
Set tabstop to tell vim 2 columns a tab counts forset shiftwidth=2
Set number of space characters inserted for indentationset shiftround
Round indent to multiple of ‘shiftwidth’.set expandtab
spaces to insert aTab
set clipboard=unnamed
Use the system clipboardset regexpengine=1
Enables regular expression engineset autoread
Watch for file changes outside vimset acd
Changes the working directory on each loadautochdir
let mapleader = "\<Space>"
Map leader to Space barnnoremap <leader><leader> <C-^>
Switch buffers
Remember
You can view the help text for any commands by running :help COMMAND
eg; :help regexpengine
This article originally appeared on lightrains.com
Leave a comment
To make a comment, please send an e-mail using the button below. Your e-mail address won't be shared and will be deleted from our records after the comment is published. If you don't want your real name to be credited alongside your comment, please specify the name you would like to use. If you would like your name to link to a specific URL, please share that as well. Thank you.
Comment via email