comparison vim/vimrc @ 6:f8792d288397

Big vimrc update.
author ludovicchabant
date Tue, 18 Oct 2011 12:05:04 -0700
parents 9dbf340c7956
children 00cac5ebf546
comparison
equal deleted inserted replaced
5:bf7741b12935 6:f8792d288397
1 """""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
2 "
1 " Ludovic Chabant's ~/.vimrc 3 " Ludovic Chabant's ~/.vimrc
2 " 4 "
5 " http://ludovic.chabant.com
6 "
7 """""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
3 8
4 " Use Vim settings, rather then Vi settings (much better!). 9 " Use Vim settings, rather then Vi settings (much better!).
5 " This must be first, because it changes other options as a side effect. 10 " This must be first, because it changes other options as a side effect.
6 set nocompatible 11 set nocompatible
7 12
13 " Set some important system-dependent variables.
14 if has("win32") || has("win64") || has("dos32")
15 let $HOMEVIM = "vimfiles"
16 let $PLATFORM = "windows"
17 else
18 let $HOMEVIM = ".vim"
19 let $PLATFORM = "unix"
20 endif
21
8 " Load pathogen. 22 " Load pathogen.
9 call pathogen#infect() 23 call pathogen#infect()
10 24
11 " Hide the toolbar in MacVim 25 " Hide the toolbar in MacVim/gVIM
12 if has("gui_running") 26 if has("gui_running")
13 set guioptions=-t 27 set guioptions=-t
14 endif 28 endif
15 29
16 colorscheme macvim 30 " Don't unload abandoned buffers.
17 31 set hidden
18 " Various options 32
19 set hidden 33 " Show line numbers.
20 set number 34 set number
35
36 " Smart auto-indenting.
21 set autoindent 37 set autoindent
22 set smartindent 38 set smartindent
39
40 " Use confirmation dialog.
23 set confirm 41 set confirm
42
43 " Remember lots of commands.
24 set history=1000 44 set history=1000
45
46 " Use incremental search, with highlighting,
47 " case-insensitive unless we actually type some
48 " mixed-case stuff.
25 set incsearch 49 set incsearch
26 set hlsearch 50 set hlsearch
27 set ignorecase 51 set ignorecase
28 set smartcase 52 set smartcase
53
54 " Always show window status lines.
29 set laststatus=2 55 set laststatus=2
56
57 " Enable using the mouse like some everyday guy.
30 set mouse=a 58 set mouse=a
59
60 " Show interesting stuff at the bottom of the window.
31 set showcmd 61 set showcmd
32 set ruler 62 set ruler
63
64 " Don't pollute the hard-drive with *~ files. Only
65 " create them in hidden backup/temp directories while
66 " we edit the file, and then get rid of it.
33 set nobackup 67 set nobackup
34 set writebackup 68 set writebackup
35 set backupdir=~/.vim/backup 69 set backupdir=~/$HOMEVIM/backup
36 set directory=~/.vim/temp 70 set directory=~/$HOMEVIM/temp
71
72 " Better command-line completion, but don't show some
73 " stuff we don't care about.
37 set wildmenu 74 set wildmenu
38 set wildignore+=.DS_Store,Thumbs.db 75 set wildignore+=.DS_Store,Thumbs.db
76
77 " Always display the tab-page line.
39 set showtabline=2 78 set showtabline=2
40 set showmatch 79
80 " Show matching braces.
81 set showmatch
82
83 " Set the file-formats.
41 set ffs=unix,mac,dos 84 set ffs=unix,mac,dos
42 set guifont=Monaco:h12 85
86 " Tabs and indenting are 4 characters, and tabs behave like
87 " spaces during editing. They're smart, too, and when you
88 " press <TAB> it actually inserts a soft-tab so everything's
89 " indented the same.
43 set tabstop=4 90 set tabstop=4
44 set shiftwidth=4 91 set shiftwidth=4
45 set softtabstop=4 92 set softtabstop=4
46 set smarttab 93 set smarttab
47 set expandtab 94 set expandtab
95
96 " Clipboard buffer.
48 set clipboard=unnamed 97 set clipboard=unnamed
98
99 " Smoot terminal experience.
49 set ttyfast 100 set ttyfast
101
102 " Allow backspacing over anything.
50 set backspace=indent,eol,start 103 set backspace=indent,eol,start
104
105 " Going left and right let you go to other lines.
106 set whichwrap+=<,>,h,l
107
108 " And now, for some system-dependent settings:
109 " - font to use
110 if $PLATFORM == "windows"
111 set guifont=Consolas:h12
112 else
113 set guifont=Monaco:h12
114 endif
115
51 116
52 " Syntax highlighting 117 " Syntax highlighting
53 syntax on 118 syntax on
54 119
55 " File types 120 " Default color scheme
121 colorscheme peaksea
122 set background=dark
123
124 " Enable file type detection.
56 filetype indent plugin on 125 filetype indent plugin on
57 126
127 " Custom mappings.
128 let mapleader=","
129 map <leader>nt :tabnew<CR> " New tab = ,nt
58 130
59 " Temporary stuff 131 " Temporary stuff
60 "let mapleader="," " Use , as Leader 132 "let mapleader="," " Use , as Leader
61 "let gmapleader="," 133 "let gmapleader=","
62 "map Y y$ " Yank to the end of the line w/ Y 134 "map Y y$ " Yank to the end of the line w/ Y