" (I copied the example .vimrc and added some stuff) " Use Vim settings, rather then Vi settings (much better!). " This must be first, because it changes other options as a side effect. set nocompatible " allow backspacing over everything in insert mode set backspace=indent,eol,start " Don't use Ex mode, use Q for formatting map Q gq " Map Y to do the same (well, almost) as the D command map Y y$ " This is an alternative that also works in block mode, but the deleted " text is lost and it only works for putting the current register. " Switch syntax highlighting on, when the terminal has colors " Also switch on highlighting the last used search pattern. if &t_Co > 2 || has("gui_running") syntax on set hlsearch endif " Only do this part when compiled with support for autocommands. if has("autocmd") " Enable file type detection. " Use the default filetype settings, so that mail gets 'tw' set to 72, " 'cindent' is on in C files, etc. " Also load indent files, to automatically do language-dependent indenting. filetype plugin indent on " Put these in an autocmd group, so that we can delete them easily. augroup vimrcEx au! " For all text files set 'textwidth' to 78 characters. autocmd FileType text setlocal textwidth=78 " When editing a file, always jump to the last known cursor position. " Don't do it when the position is invalid or when inside an event handler " (happens when dropping a file on gvim). autocmd BufReadPost * \ if line("'\"") > 0 && line("'\"") <= line("$") | \ exe "normal g`\"" | \ endif augroup END " Python files should not have empty lines autocmd FileType python autocmd BufWritePre :%s/\s\+$//e else set autoindent " always set autoindenting on endif " has("autocmd") set tabstop=4 set shiftwidth=4 set foldmethod=marker set scrolloff=1 " always show one line around the cursor set laststatus=2 " always show the status bar ('cause I like to see the line and column, always) set showtabline=2 " always show the tabline set showmatch " show matching bracket set noeb " no error bells set autowrite " write the file when switching between files or something set nowrap " do not wrap long lines set nobackup " do not keep a backup file, use versions instead set history=50 " keep 50 lines of command line history set ruler " show the cursor position all the time set showcmd " display incomplete commands set incsearch " do incremental searching set fo=tcroq " wrap with textwidth, wrap comments, insert commend leader (twice), format comments set autoindent " auto indent set smartindent " smart identation set number set wim=longest,list " file auto-completion let mapleader="," " use comma to start user-defined (in plugins) functions " default python style " (use spaces instead of tabs (expandtab), uses 4 spaces for tabs (tabstop), " when auto-indenting, also use 4 spaces (shiftwidth), when deleting text, 4 " spaces are a tab (softtabstop) and break the line at column 78 (textwidth)) au FileType python set expandtab tabstop=4 shiftwidth=4 softtabstop=4 textwidth=78 " reStructured files follow python closely, but use 3 tab stops instead of 4 au FileType rst set expandtab tabstop=3 sw=3 sts=3 textwidth=78 " templates (Jinja2 in this case) will also have spaces instead of tabs and " follow most of the python standards (with the exception of the textwidth) au FileType htmldjango set expandtab tabstop=4 shiftwidth=4 softtabstop=4 " the smarty filetypes doesn't have any sort of indentation, so we set it to " auto au FileType smarty set ai " PHP break lines at column 79, like Python au FileType php set textwidth=79 " svn (when editing svn commit messages, break lines at " column 70) au FileType svn set tw=70 " email (mostly mutt stuff) au FileType mail setlocal spell spelllang=en " HTML templates do not need breaks au FileType htmldjango set textwidth=0 " 256 color terminals set t_Co=256 " Because we are using 256 color terminals, we can use the very colorful theme color busybee " mapings " Easy switching between tabs (just use Alt+) if has('mac') map :tabn 1 map :tabn 2 map :tabn 3 map :tabn 4 map :tabn 5 map :tabn 6 map :tabn 7 map :tabn 8 map :tabn 9 map :tabn 10 imap :tabn 1a imap :tabn 2a imap :tabn 3a imap :tabn 4a imap :tabn 5a imap :tabn 6a imap :tabn 7a imap :tabn 8a imap :tabn 9a imap :tabn 10a else map :tabn 1 map :tabn 2 map :tabn 3 map :tabn 4 map :tabn 5 map :tabn 6 map :tabn 7 map :tabn 8 map :tabn 9 map :tabn 10 imap :tabn 1a imap :tabn 2a imap :tabn 3a imap :tabn 4a imap :tabn 5a imap :tabn 6a imap :tabn 7a imap :tabn 8a imap :tabn 9a imap :tabn 10a endif " custom PHP syntax file configuration let php_smart_members=1 " Vundle stuff starts here set rtp+=~/.vim/bundle/vundle/ call vundle#rc() Bundle 'Lokaltog/vim-powerline' Bundle 'tpope/vim-fugitive' Bundle 'tpope/vim-commentary' Bundle 'godlygeek/tabular' Bundle 'jiangmiao/auto-pairs' Bundle 'nvie/vim-flake8' " Bundle 'scrooloose/nerdtree' " Bundle 'terryma/vim-multiple-cursors' Bundle 'msanders/snipmate.vim' Bundle 'kien/ctrlp.vim' " Bundle 'Glench/Vim-Jinja2-Syntax' " powerline settings ""let g:Powerline_symbols = 'fancy' " auto-pair settings let g:AutoPairsMapCR = 1 " fancy tabline (to follow Powerline and BusyBee) function PowerTabLine() let line = '' let currenttab = tabpagenr() for i in range(tabpagenr('$')) let i += 1 " highlight if i == currenttab let line .= '%#TabLineSel#' else let line .= '%#TabLine#' endif " special separator if i > 1 if i == currenttab " one before the selected buffer let selBg = synIDattr(synIDtrans(hlID("TabLineSel")), "ctermbg") let normBg = synIDattr(synIDtrans(hlID("TabLine")), "ctermbg") " new color: selBg as fg, normBg as bg " let line .= nr2char(0x2b82) " filled < endif endif " buffer name let buflist = tabpagebuflist(i) let winnr = tabpagewinnr(i) let name = bufname(buflist[winnr - 1]) if name == '' if &buftype == 'quickfix' let line .= ' [Quickfix List] ' else let line .= ' [No name] ' endif else let line .= ' ' . fnamemodify(name, ':t') . ' ' endif endfor " after the last tab fill with TabLineFill and reset tab page nr let line .= '%#TabLineFill#%T' return line endfunction set tabline=%!PowerTabLine()