# HG changeset patch # User ludovicchabant # Date 1318964704 25200 # Node ID f8792d28839797586c1db9f1cf149390bd0f02f6 # Parent bf7741b1293515cc6a5982b8d681d3c54d6e73c5 Big vimrc update. diff -r bf7741b12935 -r f8792d288397 vim/vimrc --- a/vim/vimrc Tue Oct 18 12:04:56 2011 -0700 +++ b/vim/vimrc Tue Oct 18 12:05:04 2011 -0700 @@ -1,60 +1,132 @@ +""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" +" " Ludovic Chabant's ~/.vimrc " +" http://ludovic.chabant.com +" +""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" " Use Vim settings, rather then Vi settings (much better!). " This must be first, because it changes other options as a side effect. set nocompatible +" Set some important system-dependent variables. +if has("win32") || has("win64") || has("dos32") + let $HOMEVIM = "vimfiles" + let $PLATFORM = "windows" +else + let $HOMEVIM = ".vim" + let $PLATFORM = "unix" +endif + " Load pathogen. call pathogen#infect() -" Hide the toolbar in MacVim +" Hide the toolbar in MacVim/gVIM if has("gui_running") set guioptions=-t endif -colorscheme macvim +" Don't unload abandoned buffers. +set hidden -" Various options -set hidden -set number +" Show line numbers. +set number + +" Smart auto-indenting. set autoindent set smartindent + +" Use confirmation dialog. set confirm + +" Remember lots of commands. set history=1000 + +" Use incremental search, with highlighting, +" case-insensitive unless we actually type some +" mixed-case stuff. set incsearch set hlsearch set ignorecase set smartcase + +" Always show window status lines. set laststatus=2 + +" Enable using the mouse like some everyday guy. set mouse=a + +" Show interesting stuff at the bottom of the window. set showcmd set ruler + +" Don't pollute the hard-drive with *~ files. Only +" create them in hidden backup/temp directories while +" we edit the file, and then get rid of it. set nobackup set writebackup -set backupdir=~/.vim/backup -set directory=~/.vim/temp +set backupdir=~/$HOMEVIM/backup +set directory=~/$HOMEVIM/temp + +" Better command-line completion, but don't show some +" stuff we don't care about. set wildmenu set wildignore+=.DS_Store,Thumbs.db + +" Always display the tab-page line. set showtabline=2 -set showmatch + +" Show matching braces. +set showmatch + +" Set the file-formats. set ffs=unix,mac,dos -set guifont=Monaco:h12 + +" Tabs and indenting are 4 characters, and tabs behave like +" spaces during editing. They're smart, too, and when you +" press it actually inserts a soft-tab so everything's +" indented the same. set tabstop=4 set shiftwidth=4 set softtabstop=4 set smarttab set expandtab + +" Clipboard buffer. set clipboard=unnamed + +" Smoot terminal experience. set ttyfast + +" Allow backspacing over anything. set backspace=indent,eol,start +" Going left and right let you go to other lines. +set whichwrap+=<,>,h,l + +" And now, for some system-dependent settings: +" - font to use +if $PLATFORM == "windows" + set guifont=Consolas:h12 +else + set guifont=Monaco:h12 +endif + + " Syntax highlighting syntax on -" File types +" Default color scheme +colorscheme peaksea +set background=dark + +" Enable file type detection. filetype indent plugin on +" Custom mappings. +let mapleader="," +map nt :tabnew " New tab = ,nt " Temporary stuff "let mapleader="," " Use , as Leader