" " General Setup " " $Id$ set nocompatible " Use Vim defaults (much better!) set backspace=indent,eol,start " allow backspacing over everything set textwidth=0 set backup set viminfo='20,\"50,f10 set history=50 set nohlsearch set nostartofline " set paste set ruler set cmdheight=1 set laststatus=2 " Following are good for python set tabstop=4 set shiftwidth=4 set smarttab set expandtab set softtabstop=4 set autoindent set smartindent " For highlighted numbers: let python_highlight_numbers = 1 " " For highlighted builtin functions: let python_highlight_builtins = 1 " " For highlighted standard exceptions: let python_highlight_exceptions = 1 " " Highlight erroneous whitespace: let python_highlight_space_errors = 1 " End Python settings set nofoldenable set background=dark set title set browsedir=buffer set cpoptions=aAcF$ set modeline set modelines=1 set encoding=utf-8 set listchars=tab:->,trail:.,eol:$ set smartcase set errorbells " set visualbell set showcmd " Show (partial) command in status line. set showmatch " Show matching brackets. set ignorecase " Do case insensitive matching set incsearch " Incremental search set autowrite " Automatically save before commands like :next and :make " set statusline=%<%f\ %H%m%r%=%-14.(%l,%c%)\ %P\ Buf.%n set showtabline=0 set backupcopy=yes set fileformats=unix,mac,dos set fileformat=unix set mouse=a set printfont=Monaco:h14 colorscheme wombat256 " """"""""" " User Info " """"""""" let g:shortname = 'andre' let g:fullname = 'Andrea Mistrali' let g:email = 'am@am.cx' " """"""""""""""""""""""""" " COMPLETION & INDENTATION " """"""""""""""""""""""""" " Function that returns tab if called on an "empty" line " C-N elsewhere function! CleverTab() if strpart( getline('.'), 0, col('.')-1 ) =~ '^\s*$' return "\" else return "\" endfunction " map the function to Tab " inoremap =CleverTab() set completeopt=longest " Emacs like indenting. Pressing Tab indents line " Not in python, there it is managed by GetPythonIndent set indentkeys=0{,0},0),:,0#,!^F,o,O,e,!,!^F set cinkeys=0{,0},0),:,0#,!^F,o,O,e,!,!^F " Suffixes that get lower priority when doing tab completion for filenames. " These are files we are not likely to want to edit or read. set suffixes=.bak,~,.swp,.o,.info,.aux,.log,.dvi,.bbl,.blg,.brf,.cb,.ind,.idx,.ilg,.inx,.out,.toc " """"""""""""""" " TagLIST support " """"""""""""""" "let Tlist_Ctags_Cmd="/opt/local/bin/ctags" let Tlist_Exit_OnlyWindow = 1 let Tlist_File_Fold_Auto_Close = 1 "let Tlist_Use_SingleClick = 0 "Do not use yet let Tlist_Use_Right_Window = 1 let Tlist_Display_Prototype = 0 let Tlist_Compact_Format = 1 " """""""" " NERDTree " """""""" let NERDTreeIgnore=['\.vim$', '\~$', '\.pyc'] let NERDTreeShowBookmarks=1 " """"""""""" " BufExplorer " """"""""""" let g:bufExplorerSplitBelow=1 let g:bufExplorerResize=1 " """""""""""""" " NERD Commenter " """""""""""""" let NERDSpaceDelims=1 let NERDCreateDefaultMappings=1 " """"""""""" " Keymappings " """"""""""" let mapleader = "\\" "let mapleader = "," nnoremap l :set list! nnoremap f :set fullscreen! nnoremap n :NERDTreeToggle nnoremap t :Tlist nnoremap N :set number! nnoremap b :HSBufExplorer map c NERDCommenterToggle inoremap inoremap " Visual mode selection nnoremap V nnoremap V vnoremap j vnoremap k " Terminal/Filemanager integration nnoremap :OpenTerminal nnoremap :OpenFilemanager " Tab selection by number nnoremap 1gt nnoremap 2gt nnoremap 3gt nnoremap 4gt nnoremap 5gt nnoremap 6gt nnoremap 7gt nnoremap 8gt nnoremap 9gt nnoremap 10gt " Vim5 comes with syntaxhighlighting. If you want to enable syntaxhightlighting " by default uncomment the next three lines. if has("syntax") syntax on " Default to no syntax highlightning endif " has("syntax") if has("autocmd") filetype indent on filetype plugin on " When editing a file, always jump to the last cursor position autocmd BufReadPost * \ if line("'\"") > 0 && line ("'\"") <= line("$") | \ exe "normal g'\"" | \ endif " Mako au BufNewFile,BufRead *.mako setf mako endif " User customizations are held in file ~/.vim/vimrc.local if filereadable($HOME."/.vim/vimrc.local") source $HOME/.vim/vimrc.local endif " vim: set ts=4 sw=4 tw=0 ft=vim :