comparison vim/vimrc @ 0:9dbf340c7956

Initial commit
author Ludovic Chabant <ludovic@chabant.com>
date Mon, 17 Oct 2011 21:35:00 -0700
parents
children f8792d288397
comparison
equal deleted inserted replaced
-1:000000000000 0:9dbf340c7956
1 " Ludovic Chabant's ~/.vimrc
2 "
3
4 " Use Vim settings, rather then Vi settings (much better!).
5 " This must be first, because it changes other options as a side effect.
6 set nocompatible
7
8 " Load pathogen.
9 call pathogen#infect()
10
11 " Hide the toolbar in MacVim
12 if has("gui_running")
13 set guioptions=-t
14 endif
15
16 colorscheme macvim
17
18 " Various options
19 set hidden
20 set number
21 set autoindent
22 set smartindent
23 set confirm
24 set history=1000
25 set incsearch
26 set hlsearch
27 set ignorecase
28 set smartcase
29 set laststatus=2
30 set mouse=a
31 set showcmd
32 set ruler
33 set nobackup
34 set writebackup
35 set backupdir=~/.vim/backup
36 set directory=~/.vim/temp
37 set wildmenu
38 set wildignore+=.DS_Store,Thumbs.db
39 set showtabline=2
40 set showmatch
41 set ffs=unix,mac,dos
42 set guifont=Monaco:h12
43 set tabstop=4
44 set shiftwidth=4
45 set softtabstop=4
46 set smarttab
47 set expandtab
48 set clipboard=unnamed
49 set ttyfast
50 set backspace=indent,eol,start
51
52 " Syntax highlighting
53 syntax on
54
55 " File types
56 filetype indent plugin on
57
58
59 " Temporary stuff
60 "let mapleader="," " Use , as Leader
61 "let gmapleader=","
62 "map Y y$ " Yank to the end of the line w/ Y
63 "map <leader>nt :tabnew<CR> " New tab w/ ,nt
64 "map <leader>f :FufFile<CR> " Find files with ,f
65 "nmap <leader>w :w!<cr>
66 "map <F3> :r !pbpaste<CR>
67 "map <F4> :setlocal spell spelllang=en_gb<CR> " Turn on spellcheck with <F4>
68 "map <F5> :set nospell<CR>
69 "set pastetoggle=<F6>
70 "map <F7> :set complete+=k<CR>
71 "map <S-F7> :set complete=-k<CR>
72 "map <F8> :YRShow<CR> " Show the YankRing w/ <F8>
73 "nnoremap <F3> :GundoToggle<CR> " Show the undo tree w/ <F3>
74 "nnoremap ; :
75 "autocmd BufRead,BufNewfile ~/notes/* set filetype=markdown " All files in ~/notes are Markdown
76 "au BufWinLeave *.html,*.css mkview
77 "au BufWinEnter *.html,*.css silent loadview
78 "au FileType mail set tw=65 " Thin width when writing mail in mutt
79 "au FocusLost * :wa " Saves file when vim loses focus
80 "if has('statusline') " Status line with git repo info
81 " set statusline=%<%f\
82 " set statusline+=%w%h%m%r
83 " set statusline+=%{fugitive#statusline()}
84 " set statusline+=\ [%{&ff}/%Y]
85 " set statusline+=\ [%{getcwd()}]
86 " set statusline+=%=%-14.(Line:\ %l\ of\ %L\ [%p%%]\ -\ Col:\ %c%V%)
87 "endif
88
89 " When started as "evim", evim.vim will already have done these settings.
90 "if v:progname =~? "evim"
91 " finish
92 "endif
93
94 " For Win32 GUI: remove 't' flag from 'guioptions': no tearoff menu entries
95 " let &guioptions = substitute(&guioptions, "t", "", "g")
96
97 " Don't use Ex mode, use Q for formatting
98 "map Q gq
99
100 " This is an alternative that also works in block mode, but the deleted
101 " text is lost and it only works for putting the current register.
102 "vnoremap p "_dp
103
104 " Switch syntax highlighting on, when the terminal has colors
105 " Also switch on highlighting the last used search pattern.
106 "if &t_Co > 2 || has("gui_running")
107 " syntax on
108 " set hlsearch
109 "endif
110
111 " Only do this part when compiled with support for autocommands.
112 "if has("autocmd")
113
114 " Enable file type detection.
115 " Use the default filetype settings, so that mail gets 'tw' set to 72,
116 " 'cindent' is on in C files, etc.
117 " Also load indent files, to automatically do language-dependent indenting.
118 " filetype plugin indent on
119
120 " Put these in an autocmd group, so that we can delete them easily.
121 " augroup vimrcEx
122 " au!
123
124 " For all text files set 'textwidth' to 78 characters.
125 " autocmd FileType text setlocal textwidth=78
126
127 " When editing a file, always jump to the last known cursor position.
128 " Don't do it when the position is invalid or when inside an event handler
129 " (happens when dropping a file on gvim).
130 " autocmd BufReadPost *
131 " \ if line("'\"") > 0 && line("'\"") <= line("$") |
132 " \ exe "normal g`\"" |
133 " \ endif
134
135 " augroup END
136
137 "else
138
139 " set autoindent " always set autoindenting on
140
141 "endif " has("autocmd")
142
143 "set fileformats=dos,unix " set fileformat to DOS by default
144