2011-11-18 05:45:33 +08:00
|
|
|
"Use Vim settings, rather then Vi settings (much better!).
|
|
|
|
"This must be first, because it changes other options as a side effect.
|
|
|
|
set nocompatible
|
|
|
|
|
2011-12-13 12:42:54 +08:00
|
|
|
" Use tpope's pathogen plugin to manage all other plugins
|
|
|
|
runtime bundle/tpope-vim-pathogen/autoload/pathogen.vim
|
|
|
|
call pathogen#infect()
|
|
|
|
call pathogen#helptags()
|
2011-11-18 05:45:33 +08:00
|
|
|
|
2011-12-13 12:42:54 +08:00
|
|
|
set number " Line numbers are good
|
2011-11-18 05:45:33 +08:00
|
|
|
|
|
|
|
"allow backspacing over everything in insert mode
|
|
|
|
set backspace=indent,eol,start
|
|
|
|
|
|
|
|
"store lots of :cmdline history
|
|
|
|
set history=1000
|
|
|
|
|
|
|
|
set showcmd "show incomplete cmds down the bottom
|
|
|
|
set showmode "show current mode down the bottom
|
|
|
|
|
|
|
|
set incsearch "find the next match as we type the search
|
|
|
|
set hlsearch "hilight searches by default
|
|
|
|
|
|
|
|
set nowrap "dont wrap lines
|
|
|
|
set linebreak "wrap lines at convenient points
|
|
|
|
|
|
|
|
" swapfiles are lame. we have git
|
|
|
|
set noswapfile
|
|
|
|
set nobackup
|
|
|
|
set nowb
|
|
|
|
|
2011-12-11 17:52:46 +08:00
|
|
|
" Disable cursor blink
|
|
|
|
set gcr=a:blinkon0
|
|
|
|
|
2011-11-18 05:45:33 +08:00
|
|
|
" persistent undos - undo after you re-open the file
|
|
|
|
" but this gives warnings under command line vim
|
|
|
|
" use only in macvim
|
|
|
|
if has('gui_running')
|
|
|
|
set undodir=~/.vim/backups
|
|
|
|
set undofile
|
|
|
|
endif
|
|
|
|
|
|
|
|
" indent
|
|
|
|
set ai " autoindent
|
|
|
|
set si " smart indent
|
|
|
|
set smarttab
|
|
|
|
|
|
|
|
"indent settings
|
|
|
|
set shiftwidth=2
|
|
|
|
set softtabstop=2
|
|
|
|
set tabstop=2
|
|
|
|
set expandtab
|
|
|
|
set autoindent
|
2011-12-13 10:21:42 +08:00
|
|
|
|
|
|
|
" Prevent 'Press ENTER..' on error messages
|
|
|
|
set shortmess=atI
|
2011-11-18 05:45:33 +08:00
|
|
|
|
|
|
|
"folding settings
|
|
|
|
set foldmethod=indent "fold based on indent
|
|
|
|
set foldnestmax=3 "deepest fold is 3 levels
|
|
|
|
set nofoldenable "dont fold by default
|
|
|
|
|
|
|
|
"make cmdline tab completion similar to bash
|
2011-12-13 10:21:42 +08:00
|
|
|
set wildmode=list:longest
|
2011-11-18 05:45:33 +08:00
|
|
|
set wildmenu "enable ctrl-n and ctrl-p to scroll thru matches
|
|
|
|
set wildignore=*.o,*.obj,*~ "stuff to ignore when tab completing
|
|
|
|
|
2011-12-16 12:01:18 +08:00
|
|
|
"display tabs and trailing spaces
|
|
|
|
set list listchars=tab:\ \ ,trail:·
|
2011-11-18 05:45:33 +08:00
|
|
|
|
|
|
|
set formatoptions-=o "dont continue comments when pushing o/O
|
|
|
|
|
|
|
|
"vertical/horizontal scroll off settings
|
2011-12-13 10:21:42 +08:00
|
|
|
set scrolloff=8
|
2011-11-18 05:45:33 +08:00
|
|
|
set sidescrolloff=7
|
|
|
|
set sidescroll=1
|
|
|
|
|
|
|
|
"load ftplugins and indent files
|
|
|
|
filetype plugin on
|
|
|
|
filetype indent on
|
|
|
|
|
|
|
|
"turn on syntax highlighting
|
|
|
|
syntax on
|
|
|
|
|
|
|
|
"some stuff to get the mouse going in term
|
|
|
|
set mouse=a
|
|
|
|
set ttymouse=xterm2
|
|
|
|
|
2011-12-13 10:21:42 +08:00
|
|
|
" The current buffer can be put to the background without writing to disk;
|
|
|
|
" When a background buffer becomes current again, marks and undo-history are remembered.
|
|
|
|
" Turn this on.
|
|
|
|
" http://items.sjbach.com/319/configuring-vim-right
|
2011-11-18 05:45:33 +08:00
|
|
|
set hidden
|
|
|
|
|
|
|
|
" Make it beautiful - colors and fonts
|
|
|
|
if has("gui_running")
|
2011-12-13 12:42:54 +08:00
|
|
|
"tell the term has 256 colors
|
|
|
|
set t_Co=256
|
2011-11-18 05:45:33 +08:00
|
|
|
|
2011-12-13 12:42:54 +08:00
|
|
|
" http://ethanschoonover.com/solarized/vim-colors-solarized
|
|
|
|
colorscheme solarized
|
|
|
|
set background=dark
|
2011-12-06 16:32:51 +08:00
|
|
|
|
2011-12-16 15:24:22 +08:00
|
|
|
" Show tab number (useful for Cmd-1, Cmd-2.. mapping)
|
2011-12-16 15:46:11 +08:00
|
|
|
" For some reason this doesn't work as a regular set command,
|
|
|
|
" (the numbers don't show up) so I made it a VimEnter event
|
|
|
|
autocmd VimEnter * set guitablabel=%N:\ %t\ %M
|
|
|
|
|
2011-12-13 12:42:54 +08:00
|
|
|
set lines=60
|
|
|
|
set columns=190
|
2011-11-23 00:36:09 +08:00
|
|
|
|
2011-12-13 12:42:54 +08:00
|
|
|
set guifont=Inconsolata:h20,Monaco:h17
|
2011-11-18 05:45:33 +08:00
|
|
|
else
|
2011-12-13 12:42:54 +08:00
|
|
|
"dont load csapprox if we no gui support - silences an annoying warning
|
|
|
|
let g:CSApprox_loaded = 1
|
2011-11-18 05:45:33 +08:00
|
|
|
endif
|
|
|
|
|
|
|
|
|
|
|
|
" automaticaly reload files changed outside of vim
|
|
|
|
set autoread
|
|
|
|
|
|
|
|
" save up to 100 marks and f1 means global marks (capital letters) are enabled
|
|
|
|
set viminfo='100,f1
|
|
|
|
|
|
|
|
" prevent auto insert mode, which is helpful when using conque
|
|
|
|
" term for running tests
|
2011-12-16 12:01:18 +08:00
|
|
|
"
|
2011-11-18 05:45:33 +08:00
|
|
|
autocmd WinEnter * stopinsert
|
2011-12-16 14:56:48 +08:00
|
|
|
|
|
|
|
" Auto save when we go elsewhere
|
|
|
|
au FocusLost * :wa
|