" ############################################################################## " vim/vimrc - Vim configuration " ############################################################################## " Pathogen needs to run first execute pathogen#infect() " General Settings {{{ set nocompatible " Disable vi-compatible mode set hidden " Switch buffers without saving set nobackup " Disable backup files set noerrorbells " Don't make noise on errors set shortmess+=I " Do not show welcome screen set title " Update window title let mapleader="," " Map the key so plugins work properly set clipboard=unnamedplus " Use X11 clipboard for + register " }}} " Color Settings {{{ set t_Co=256 " Use 256 colors if $TERM =~ "256color" || $TERM == "xterm-termite" || $TERM == "alacritty" || has('gui_running') || has('nvim') colorscheme zenburn endif " }}} " GUI Settings {{{ set guifont=DejaVu\ Sans\ Mono:h24 if has("gui_running") set guioptions-=t " Disable tear-off menus set guioptions-=m " Disable menubar set guioptions-=T " Disable toolbar set guioptions+=LlRrb set guioptions-=LlRrb " Disable scrollbars set mousemodel=popup " Enable right click menu " Window size set columns=100 set lines=40 endif " }}} " Editing {{{ set backspace=indent,eol,start " Make backspace key behave normally set noinsertmode " Don't stay in insert mode set spell " Enable spell checking set spellfile=~/.dotfiles/vim/spell/spell.add set cursorline " Highlight current line set number " Show line numbers set showmatch " Highlight matching pairs set matchpairs+=<:> " Make < and > match set pastetoggle= " Toggle paste mode (no automatic indents) set colorcolumn=80 " Show a line to indicate the line width " Automatic formatting; auto-wrap text, comments; automatically insert current " comment leader when hitting enter in insert mode allow formatting of " comments with gq; recognize lists set formatoptions+=tcrqn " }}} " Indentation {{{ set autoindent " Automatic indentation on new lines set copyindent " Copy existing indentation structure on autoindent set preserveindent " Preserve indentation structure for existing lines set smartindent " Smart indentation based on typed code set smarttab " Tabs based on shiftwidth, not tabstop set cindent " Automatically indent code set expandtab " Use spaces instead of tabs " Tab width set softtabstop=0 set tabstop=4 set shiftwidth=4 " }}} " Folding {{{ if has('folding') set foldenable " Enable folding set foldmethod=marker " Fold on marker set foldopen-=search " Do not open folds when searching set foldopen-=undo " Do not open folds when using undo "set foldlevel=999 " Show folds at start set foldmarker={{{,}}} " Use default fold marker set foldcolumn=0 " Do not use a fold column endif " }}} " File formats and syntax highlighting {{{ " Unicode support set encoding=utf-8 " Support UNIX, DOS, and Mac line endings set fileformats=unix,dos,mac " Enable filetype auto-detection filetype plugin on " Enable filetype-specific indentation filetype plugin indent on " Syntax highlighting syntax enable " Highlight HTML code inside of PHP let php_htmlInStrings=1 " Highlight MySQL queries inside of PHP let php_sql_query=1 " }}} " Searching {{{ " Highlight results set hlsearch " Ignore case unless token contains uppercase set ignorecase set smartcase " }}} " Plugins {{{ " NERDTree {{{ " Have NERDTree change directory when we do let g:NERDTreeChDirMode = 2 " Highlight selected entry in tree let g:NERDTreeHighlightCursorline = 1 " Show hidden files let NERDTreeShowFiles=1 let NERDTreeShowHidden=1 " Don't display files we don't need to see let NERDTreeIgnore=[ '\.pyc$', '\.pyo$', '\.py\$class$', '\.obj$', '\.o$', '\.so$', '\.egg$', '^\.git$' , '\.swp$' ] nmap n :NERDTreeClose:NERDTreeToggle nmap N :NERDTreeClose " }}} " SnipMate {{{ let g:snips_author ='mutantmonkey' let g:snips_email = 'mutantmonkey@mutantmonkey.in' " }}} " }}} autocmd BufRead,BufNewFile PKGBUILD setlocal ts=2 sw=2 et