" Allow Vim-only settings even if they break vi keybindings. set nocompatible " Enable filetype detection. filetype off filetype plugin indent on " Enable syntax highlighting if &t_Co > 1 syntax enable endif syntax on " Persistent Undo (vim 7.3 and later) if exists('&undofile') && !&undofile set undodir=~/.vim_runtime/undodir set undofile endif " Indentation set autoindent set smartindent set tabstop=2 set shiftwidth=2 set expandtab " General settings set incsearch "Find as you type set scrolloff=2 "Number of lines to keep above/below cursor set number "Show line numbers set wildmode=longest,list "Complete longest string, then list alternatives set pastetoggle= "Toggle paste mode set fileformats=unix "Use Unix line endings set history=300 "Number of commands to remember set showmode "Show whether in Visual, Replace, or Insert Mode set showmatch "Show matching brackets/parentheses set backspace=2 "Use standard backspace behavior set hlsearch "Highlight matches in search set ruler "Show line and column number set formatoptions=1 "Don't wrap text after a one-letter word set linebreak "Break lines when appropriate set backupcopy=yes "Fixes problems with webpack watch " Always edit in utf-8. set encoding=utf-8 set cursorline set numberwidth=5 set clipboard=unnamed " PHP Highlight let php_baselib = 1 let php_htmlInStrings = 1 let php_parent_error_close = 1 " Highlight trailing whitespaces. highlight ExtraWhitespace ctermbg=red guibg=red match ExtraWhitespace /\s\+$/ autocmd BufWinEnter * match ExtraWhitespace /\s\+$/ autocmd InsertEnter * match ExtraWhitespace /\s\+\%#\@ 1 && line("'\"") <= line("$") | exe "normal! g`\"" | endif " Set Drupal files as php augroup module autocmd BufRead,BufNewFile *.module set filetype=php autocmd BufRead,BufNewFile *.php set filetype=php autocmd BufRead,BufNewFile *.install set filetype=php autocmd BufRead,BufNewFile *.test set filetype=php autocmd BufRead,BufNewFile *.inc set filetype=php autocmd BufRead,BufNewFile *.profile set filetype=php autocmd BufRead,BufNewFile *.theme set filetype=php augroup END " Source vimrc file after saving it " autocmd bufwritepost .vimrc source $MYVIMRC endif au BufRead,BufNewFile jquery.*.js set ft=javascript syntax=jquery autocmd FileType php set omnifunc=phpcomplete#CompletePHP autocmd FileType python set omnifunc=pythoncomplete#Complete autocmd FileType javascript set omnifunc=javascriptcomplete#CompleteJS autocmd FileType jade set omnifunc=javascriptcomplete#CompleteJS autocmd FileType html set omnifunc=htmlcomplete#CompleteTags autocmd FileType css set omnifunc=csscomplete#CompleteCSS autocmd FileType xml set omnifunc=xmlcomplete#CompleteTags autocmd FileType c set omnifunc=ccomplete#Complet