Skip to content
This repository
Newer
Older
100644 283 lines (241 sloc) 9.554 kb
bbd971df »
2010-04-20 Adding .vimrc file
1 " Modeline and Notes {
71a549a4 »
2010-04-27 Organize it a bit, change supertab default to context
2 " vim: set foldmarker={,} foldlevel=0 foldmethod=marker spell:
bbd971df »
2010-04-20 Adding .vimrc file
3 "
4 " This is the personal .vimrc file of Steve Francia.
5 " While much of it is beneficial for general use, I would
6 " recommend picking out the parts you want and understand.
7 "
8 " You can find me at http://spf13.com
9 " }
10
695cf751 »
2010-08-10 reording the vimrc so windows loads .vim properly
11 " Windows Compatible {
12 " On Windows, also use '.vim' instead of 'vimfiles'; this makes synchronization
13 " across (heterogeneous) systems easier.
14 if has('win32') || has('win64')
15 set runtimepath=$HOME/.vim,$VIM/vimfiles,$VIMRUNTIME,$VIM/vimfiles/after,$HOME/.vim/after
16 endif
17 " }
18
71a549a4 »
2010-04-27 Organize it a bit, change supertab default to context
19 " Setup Bundle Support {
5f7b2a45 »
2010-04-23 Organized the .vimrc a bit
20 " The next two lines ensure that the ~/.vim/bundle/ system works
71a549a4 »
2010-04-27 Organize it a bit, change supertab default to context
21 runtime! autoload/pathogen.vim
22 silent! call pathogen#runtime_append_all_bundles()
23 " }
5f7b2a45 »
2010-04-23 Organized the .vimrc a bit
24
bbd971df »
2010-04-20 Adding .vimrc file
25 " Basics {
26 set nocompatible " must be first line
27 set background=dark " Assume a dark background
28 " }
45f2d077 »
2010-04-22 adding mouse support
29
bbd971df »
2010-04-20 Adding .vimrc file
30 " General {
31 filetype plugin indent on " Automatically detect file types.
1b72282c »
2010-04-21 loading pathogen at top of .vimrc file... small changes to .vimrc
32 syntax on " syntax highlighting
45f2d077 »
2010-04-22 adding mouse support
33 set mouse=a " automatically enable mouse usage
1b72282c »
2010-04-21 loading pathogen at top of .vimrc file... small changes to .vimrc
34 "set autochdir " always switch to the current file directory..
bbd971df »
2010-04-20 Adding .vimrc file
35 " not every vim is compiled with this, use the following line instead
d903b613 »
2010-04-30 adding in command-t plugin
36 "autocmd BufEnter * if bufname("") !~ "^\[A-Za-z0-9\]*://" | lcd %:p:h | endif
1b72282c »
2010-04-21 loading pathogen at top of .vimrc file... small changes to .vimrc
37 scriptencoding utf-8
bbd971df »
2010-04-20 Adding .vimrc file
38 set autowrite
39 set shortmess+=filmnrxoOtT " abbrev. of messages (avoids 'hit enter')
84773019 »
2010-08-12 fixed issues with .vimrc InitializeDirectories function
40 set viewoptions=folds,options,cursor,unix,slash " better unix / windows compatibility
41 set virtualedit=onemore " allow for cursor beyond last character
42 set history=1000 " Store a ton of history (default is 20)
bbd971df »
2010-04-20 Adding .vimrc file
43 " set spell " spell checking on
5f7b2a45 »
2010-04-23 Organized the .vimrc a bit
44
45 " Setting up the directories {
46 set backup " backups are nice ...
e2db1fc8 »
2010-08-11 improve vim compatibility with Windows 7, update readme
47 " Moved to function at bottom of the file
6036fa3c »
2010-08-30 made .vimrc work right again with swap, view and backup directories
48 set backupdir=$HOME/.vimbackup// " but not when they clog .
49 set directory=$HOME/.vimswap// " Same for swap files
50 set viewdir=$HOME/.vimviews// " same but for view files
5f7b2a45 »
2010-04-23 Organized the .vimrc a bit
51
e2db1fc8 »
2010-08-11 improve vim compatibility with Windows 7, update readme
52 "" Creating directories if they don't exist
6036fa3c »
2010-08-30 made .vimrc work right again with swap, view and backup directories
53 silent execute '!mkdir -p $HOME/.vimbackup'
54 silent execute '!mkdir -p $HOME/.vimswap'
55 silent execute '!mkdir -p $HOME/.vimviews'
71a549a4 »
2010-04-27 Organize it a bit, change supertab default to context
56 au BufWinLeave * silent! mkview "make vim save view (state) (folds, cursor, etc)
57 au BufWinEnter * silent! loadview "make vim load view (state) (folds, cursor, etc)
5f7b2a45 »
2010-04-23 Organized the .vimrc a bit
58 " }
bbd971df »
2010-04-20 Adding .vimrc file
59 " }
60
61 " Vim UI {
5f7b2a45 »
2010-04-23 Organized the .vimrc a bit
62 color ir_black " load a colorscheme
bbd971df »
2010-04-20 Adding .vimrc file
63 set tabpagemax=15 " only show 15 tabs
64 set showmode " display the current mode
65
1b72282c »
2010-04-21 loading pathogen at top of .vimrc file... small changes to .vimrc
66 set cursorline " highlight current line
bbd971df »
2010-04-20 Adding .vimrc file
67 hi cursorline guibg=#333333 " highlight bg color of current line
68 hi CursorColumn guibg=#333333 " highlight cursor
69
70 if has('cmdline_info')
71 set ruler " show the ruler
72 set rulerformat=%30(%=\:b%n%y%m%r%w\ %l,%c%V\ %P%) " a ruler on steroids
73 set showcmd " show partial commands in status line and
74 " selected characters/lines in visual mode
75 endif
76
77 if has('statusline')
78 set laststatus=1 " show statusline only if there are > 1 windows
c305fee6 »
2010-04-24 Fix issue with views, configure supertab, adding fugitive to status
79 " Use the commented line if fugitive isn't installed
80 "set statusline=%<%f\ %=\:\b%n%y%m%r%w\ %l,%c%V\ %P " a statusline, also on steroids
81 set statusline=%<%f\ %h%m%r%{fugitive#statusline()}%=%-14.(%l,%c%V%)\ %P
bbd971df »
2010-04-20 Adding .vimrc file
82 endif
83
84 set backspace=indent,eol,start " backspace for dummys
85 set linespace=0 " No extra spaces between rows
86 set nu " Line numbers on
87 set showmatch " show matching brackets/parenthesis
88 set incsearch " find as you type search
89 set hlsearch " highlight search terms
90 set winminheight=0 " windows can be 0 line high
91 set ignorecase " case insensitive search
92 set smartcase " case sensitive when uc present
93 set wildmenu " show list instead of just completing
94 set wildmode=list:longest,full " comand <Tab> completion, list matches, then longest common part, then all.
95 set whichwrap=b,s,h,l,<,>,[,] " backspace and cursor keys wrap to
96 set scrolljump=5 " lines to scroll when cursor leaves screen
97 set scrolloff=3 " minimum lines to keep above and below cursor
98 set foldenable " auto fold code
1b72282c »
2010-04-21 loading pathogen at top of .vimrc file... small changes to .vimrc
99 set gdefault " the /g flag on :s substitutions by default
bbd971df »
2010-04-20 Adding .vimrc file
100
101 " }
102
103 " Formatting {
104 set nowrap " wrap long lines
105 set autoindent " indent at the same level of the previous line
106 set shiftwidth=4 " use indents of 4 spaces
107 set noexpandtab " tabs are tabs, not spaces
108 set tabstop=4 " an indentation every four columns
109 "set matchpairs+=<:> " match, to be used with %
110 set pastetoggle=<F12> " pastetoggle (sane indentation on pastes)
111 "set comments=sl:/*,mb:*,elx:*/ " auto format comment blocks
112 " }
113
114 " Key Mappings {
115
116 " Easier moving in tabs and windows
117 map <C-J> <C-W>j<C-W>_
118 map <C-K> <C-W>k<C-W>_
119 map <C-L> <C-W>l<C-W>_
120 map <C-H> <C-W>h<C-W>_
121 map <C-K> <C-W>k<C-W>_
122 map <S-H> gT
123 map <S-L> gt
124
125 " Stupid shift key fixes
83b27da9 »
2010-05-15 updated mappings, fixed broken links in readme, updated children
126 cmap W w
127 cmap WQ wq
128 cmap wQ wq
129 cmap Q q
130 cmap Tabe tabe
1b72282c »
2010-04-21 loading pathogen at top of .vimrc file... small changes to .vimrc
131
132 " Yank from the cursor to the end of the line, to be consistent with C and D.
133 nnoremap Y y$
83b27da9 »
2010-05-15 updated mappings, fixed broken links in readme, updated children
134
135 " Shortcuts
136 " Change Working Directory to that of the current file
137 cmap cwd lcd %:p:h
84bb805d »
2010-09-29 adding a shortcut to write with sudo (:wgit st)
138
139 " For when you forget to sudo.. Really Write the file.
140 cmap w!! w !sudo tee % >/dev/null
bbd971df »
2010-04-20 Adding .vimrc file
141 " }
142
143 " Plugins {
144
145 " VCSCommand {
146 let b:VCSCommandMapPrefix=',v'
147 let b:VCSCommandVCSType='git'
148 ""let mapleader = "-"
149 " }
c305fee6 »
2010-04-24 Fix issue with views, configure supertab, adding fugitive to status
150
845190f1 »
2010-04-28 Updated vimrc with PIV config section
151 " PIV {
152 let g:DisableAutoPHPFolding = 0
153 " }
154
c305fee6 »
2010-04-24 Fix issue with views, configure supertab, adding fugitive to status
155 " Supertab {
614e5715 »
2010-04-27 adding support for autoclosetag and making it play nice with delimitmate
156 "let g:SuperTabDefaultCompletionType = "context"
c305fee6 »
2010-04-24 Fix issue with views, configure supertab, adding fugitive to status
157 let g:SuperTabContextDefaultCompletionType = "<c-x><c-o>"
158 " }
bbd971df »
2010-04-20 Adding .vimrc file
159
160 " Misc {
161 :map <C-F10> <Esc>:vsp<CR>:VTree<CR>
162 " map Control + F10 to Vtree
163
164 let g:checksyntax_auto = 0
165
166 "comment out line(s) in visual mode
167 vmap o :call NERDComment(1, 'toggle')<CR>
168 let g:NERDShutUp=1
169
170 let b:match_ignorecase = 1
171 " }
172
173 " ShowMarks {
174 let showmarks_include = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"
175 " Don't leave on by default, use :ShowMarksOn to enable
176 let g:showmarks_enable = 0
177 " For marks a-z
178 highlight ShowMarksHLl gui=bold guibg=LightBlue guifg=Blue
179 " For marks A-Z
180 highlight ShowMarksHLu gui=bold guibg=LightRed guifg=DarkRed
181 " For all other marks
182 highlight ShowMarksHLo gui=bold guibg=LightYellow guifg=DarkYellow
183 " For multiple marks on the same line.
184 highlight ShowMarksHLm gui=bold guibg=LightGreen guifg=DarkGreen
185 " }
186
187 " OmniComplete {
c305fee6 »
2010-04-24 Fix issue with views, configure supertab, adding fugitive to status
188 "if has("autocmd") && exists("+omnifunc")
189 "autocmd Filetype *
190 "\if &omnifunc == "" |
191 "\setlocal omnifunc=syntaxcomplete#Complete |
192 "\endif
193 "endif
bbd971df »
2010-04-20 Adding .vimrc file
194
195 " Popup menu hightLight Group
196 "highlight Pmenu ctermbg=13 guibg=DarkBlue
197 highlight PmenuSel ctermbg=7 guibg=DarkBlue guifg=LightBlue
198 "highlight PmenuSbar ctermbg=7 guibg=DarkGray
199 "highlight PmenuThumb guibg=Black
200
201 hi Pmenu guifg=#000000 guibg=#F8F8F8 ctermfg=black ctermbg=Lightgray
202 hi PmenuSbar guifg=#8A95A7 guibg=#F8F8F8 gui=NONE ctermfg=darkcyan ctermbg=lightgray cterm=NONE
203 hi PmenuThumb guifg=#F8F8F8 guibg=#8A95A7 gui=NONE ctermfg=lightgray ctermbg=darkcyan cterm=NONE
204
205 " some convenient mappings
206 inoremap <expr> <Esc> pumvisible() ? "\<C-e>" : "\<Esc>"
207 inoremap <expr> <CR> pumvisible() ? "\<C-y>" : "\<CR>"
208 inoremap <expr> <Down> pumvisible() ? "\<C-n>" : "\<Down>"
209 inoremap <expr> <Up> pumvisible() ? "\<C-p>" : "\<Up>"
210 inoremap <expr> <C-d> pumvisible() ? "\<PageDown>\<C-p>\<C-n>" : "\<C-d>"
211 inoremap <expr> <C-u> pumvisible() ? "\<PageUp>\<C-p>\<C-n>" : "\<C-u>"
212
213 " automatically open and close the popup menu / preview window
214 au CursorMovedI,InsertLeave * if pumvisible() == 0|silent! pclose|endif
215 set completeopt=menu,longest,preview
216 " }
217
218 " Ctags {
a44447d3 »
2010-07-08 adding better tag support
219 set tags=./tags;/,~/.vimtags
220 " }
221
222 " EasyTags {
223 let g:easytags_cmd = '/usr/local/bin/ctags'
bbd971df »
2010-04-20 Adding .vimrc file
224 " }
614e5715 »
2010-04-27 adding support for autoclosetag and making it play nice with delimitmate
225
226 " Delimitmate {
227 au FileType * let b:delimitMate_autoclose = 1
228
229 " If using html auto complete (complete closing tag)
230 au FileType xml,html,xhtml let b:delimitMate_matchpairs = "(:),[:],{:}"
231 " }
71a549a4 »
2010-04-27 Organize it a bit, change supertab default to context
232
614e5715 »
2010-04-27 adding support for autoclosetag and making it play nice with delimitmate
233 " AutoCloseTag {
234 " Make it so AutoCloseTag works for xml and xhtml files as well
235 au FileType xhtml,xml ru ftplugin/html/autoclosetag.vim
236 " }
bbd971df »
2010-04-20 Adding .vimrc file
237
83b27da9 »
2010-05-15 updated mappings, fixed broken links in readme, updated children
238 " SnipMate {
239 " Setting the author var
240 let g:snips_author = 'Steve Francia <steve.francia@gmail.com>'
241 " Shortcut for reloading snippets, useful when developing
242 nnoremap ,smr <esc>:exec ReloadAllSnippets()<cr>
243 " }
bbd971df »
2010-04-20 Adding .vimrc file
244 " }
245
246 " GUI Settings {
247 " GVIM- (here instead of .gvimrc)
248 if has('gui_running')
249 set guioptions-=T " remove the toolbar
250 set lines=40 " 40 lines of text instead of 24,
251 endif
252 " }
e2db1fc8 »
2010-08-11 improve vim compatibility with Windows 7, update readme
253 "
254
6036fa3c »
2010-08-30 made .vimrc work right again with swap, view and backup directories
255 " Not quite working yet
256 "function InitializeDirectories()
257 "let separator = "."
258 "let parent = $HOME
259 "let prefix = '.vim'
260 "let dir_list = {
261 "\ 'backup': 'backupdir',
262 "\ 'views': 'viewdir',
263 "\ 'swap': 'directory' }
264
265 "for [dirname, settingname] in items(dir_list)
266 "let directory = parent . '/' . prefix . dirname . "/"
267 "if exists("*mkdir")
268 "if !isdirectory(directory)
269 "call mkdir(directory)
270 "endif
271 "endif
272 "if !isdirectory(directory)
273 "echo "Warning: Unable to create backup directory: " . directory
274 "echo "Try: mkdir -p " . directory
275 "else
276 "" Adding an extra trailing slash so it stores the path and not just the
277 "" filename so there aren't collisions for backups
278 "" Windows Vista / 7 has UAC issues, so setting $temp as fallback
279 "exec "set " . settingname . "='" . directory . "/'," . $temp
280 "endif
281 "endfor
282 "endfunction
283 "call InitializeDirectories()
Something went wrong with that request. Please try again.