2010-04-20 16:08:48 +00:00
|
|
|
|
" Modeline and Notes {
|
2010-04-27 17:58:52 +00:00
|
|
|
|
" vim: set foldmarker={,} foldlevel=0 foldmethod=marker spell:
|
2010-04-20 16:08:48 +00:00
|
|
|
|
"
|
2010-08-20 00:42:57 +00:00
|
|
|
|
" This is the personal .vimrc file of Steve Francia.
|
|
|
|
|
" While much of it is beneficial for general use, I would
|
|
|
|
|
" recommend picking out the parts you want and understand.
|
2010-04-20 16:08:48 +00:00
|
|
|
|
"
|
2010-08-20 00:42:57 +00:00
|
|
|
|
" You can find me at http://spf13.com
|
2010-04-20 16:08:48 +00:00
|
|
|
|
" }
|
|
|
|
|
|
2010-10-02 12:25:10 +00:00
|
|
|
|
" Environment {
|
|
|
|
|
" Basics {
|
|
|
|
|
set nocompatible " must be first line
|
2011-02-23 00:10:22 +00:00
|
|
|
|
set background=dark " Assume a dark background
|
2010-10-02 12:25:10 +00:00
|
|
|
|
" }
|
2010-08-10 17:04:25 +00:00
|
|
|
|
|
2010-10-02 12:25:10 +00:00
|
|
|
|
" Windows Compatible {
|
|
|
|
|
" On Windows, also use '.vim' instead of 'vimfiles'; this makes synchronization
|
|
|
|
|
" across (heterogeneous) systems easier.
|
|
|
|
|
if has('win32') || has('win64')
|
|
|
|
|
set runtimepath=$HOME/.vim,$VIM/vimfiles,$VIMRUNTIME,$VIM/vimfiles/after,$HOME/.vim/after
|
|
|
|
|
endif
|
|
|
|
|
" }
|
2011-03-02 18:57:03 +00:00
|
|
|
|
"
|
|
|
|
|
" Setup Bundle Support {
|
|
|
|
|
" The next two lines ensure that the ~/.vim/bundle/ system works
|
2011-05-17 19:40:32 +00:00
|
|
|
|
set rtp+=~/.vim/vundle.git/
|
|
|
|
|
call vundle#rc()
|
2011-03-02 18:57:03 +00:00
|
|
|
|
" }
|
|
|
|
|
|
2011-02-23 00:10:22 +00:00
|
|
|
|
" }
|
2010-04-23 21:07:12 +00:00
|
|
|
|
|
2011-05-17 19:40:32 +00:00
|
|
|
|
" Bundles {
|
|
|
|
|
" GitHub Bundles {
|
|
|
|
|
Bundle 'spf13/snipmate.vim'
|
|
|
|
|
Bundle 'spf13/vim-colors'
|
2011-05-18 22:11:40 +00:00
|
|
|
|
Bundle 'garbas/vim-snipmate'
|
2011-05-17 19:40:32 +00:00
|
|
|
|
Bundle 'spf13/vim-markdown'
|
|
|
|
|
Bundle 'spf13/vim-surround'
|
|
|
|
|
Bundle 'spf13/PIV'
|
|
|
|
|
Bundle 'spf13/nerdtree'
|
|
|
|
|
Bundle 'altercation/vim-colors-solarized'
|
|
|
|
|
Bundle 'tpope/vim-fugitive'
|
|
|
|
|
Bundle 'lokaltog/vim-easymotion'
|
|
|
|
|
Bundle 'scrooloose/nerdcommenter'
|
|
|
|
|
Bundle 'ervandew/supertab'
|
|
|
|
|
Bundle 'Raimondi/delimitMate'
|
|
|
|
|
Bundle 'tomtom/checksyntax_vim'
|
|
|
|
|
Bundle 'wincent/Command-T'
|
|
|
|
|
Bundle 'taxilian/VimDebugger'
|
|
|
|
|
Bundle 'bloveridge/jslint.vim'
|
|
|
|
|
Bundle 'bloveridge/pyflakes-vim'
|
|
|
|
|
Bundle 'mileszs/ack.vim'
|
|
|
|
|
Bundle 'leshill/vim-json'
|
|
|
|
|
Bundle 'fs111/pydoc.vim'
|
|
|
|
|
Bundle 'godlygeek/tabular'
|
|
|
|
|
Bundle 'greyblake/vim-preview'
|
|
|
|
|
Bundle 'rstacruz/sparkup', {'rtp': 'vim/'}
|
|
|
|
|
" }
|
|
|
|
|
" vim-scripts repos {
|
|
|
|
|
Bundle 'L9'
|
|
|
|
|
Bundle 'FuzzyFinder'
|
|
|
|
|
Bundle 'rails.vim'
|
|
|
|
|
Bundle 'matchit.zip'
|
|
|
|
|
Bundle 'python.vim'
|
|
|
|
|
Bundle 'python_match.vim'
|
|
|
|
|
Bundle 'pythoncomplete'
|
2011-05-18 22:11:40 +00:00
|
|
|
|
"Bundle 'autocomplpop'
|
2011-05-17 19:40:32 +00:00
|
|
|
|
" }
|
|
|
|
|
" }
|
|
|
|
|
|
2010-04-20 16:08:48 +00:00
|
|
|
|
" General {
|
2010-10-02 12:25:10 +00:00
|
|
|
|
set background=dark " Assume a dark background
|
2011-02-28 21:19:21 +00:00
|
|
|
|
if !has('win32') && !has('win64')
|
|
|
|
|
set term=$TERM " Make arrow and other keys work
|
|
|
|
|
endif
|
2010-04-20 16:08:48 +00:00
|
|
|
|
filetype plugin indent on " Automatically detect file types.
|
2010-04-21 23:14:29 +00:00
|
|
|
|
syntax on " syntax highlighting
|
2011-02-23 00:10:22 +00:00
|
|
|
|
set mouse=a " automatically enable mouse usage
|
|
|
|
|
"set autochdir " always switch to the current file directory.. Messes with some plugins, best left commented out
|
|
|
|
|
" not every vim is compiled with this, use the following line instead
|
|
|
|
|
" If you use command-t plugin, it conflicts with this, comment it out.
|
|
|
|
|
"autocmd BufEnter * if bufname("") !~ "^\[A-Za-z0-9\]*://" | lcd %:p:h | endif
|
2010-04-21 23:14:29 +00:00
|
|
|
|
scriptencoding utf-8
|
2011-02-23 00:10:22 +00:00
|
|
|
|
|
2011-01-26 05:32:28 +00:00
|
|
|
|
" set autowrite " automatically write a file when leaving a modified buffer
|
2010-04-20 16:08:48 +00:00
|
|
|
|
set shortmess+=filmnrxoOtT " abbrev. of messages (avoids 'hit enter')
|
2010-08-12 14:06:11 +00:00
|
|
|
|
set viewoptions=folds,options,cursor,unix,slash " better unix / windows compatibility
|
|
|
|
|
set virtualedit=onemore " allow for cursor beyond last character
|
|
|
|
|
set history=1000 " Store a ton of history (default is 20)
|
2011-02-23 00:10:22 +00:00
|
|
|
|
set spell " spell checking on
|
2010-04-23 21:07:12 +00:00
|
|
|
|
|
|
|
|
|
" Setting up the directories {
|
|
|
|
|
set backup " backups are nice ...
|
2010-04-27 17:58:52 +00:00
|
|
|
|
au BufWinLeave * silent! mkview "make vim save view (state) (folds, cursor, etc)
|
|
|
|
|
au BufWinEnter * silent! loadview "make vim load view (state) (folds, cursor, etc)
|
2010-04-23 21:07:12 +00:00
|
|
|
|
" }
|
2010-04-20 16:08:48 +00:00
|
|
|
|
" }
|
|
|
|
|
|
|
|
|
|
" Vim UI {
|
2011-04-06 16:26:50 +00:00
|
|
|
|
color solarized " load a colorscheme
|
2011-02-23 00:10:22 +00:00
|
|
|
|
set tabpagemax=15 " only show 15 tabs
|
|
|
|
|
set showmode " display the current mode
|
2010-04-20 16:08:48 +00:00
|
|
|
|
|
2011-02-23 00:10:22 +00:00
|
|
|
|
set cursorline " highlight current line
|
|
|
|
|
hi cursorline guibg=#333333 " highlight bg color of current line
|
2010-04-20 16:08:48 +00:00
|
|
|
|
hi CursorColumn guibg=#333333 " highlight cursor
|
|
|
|
|
|
|
|
|
|
if has('cmdline_info')
|
2011-02-23 00:10:22 +00:00
|
|
|
|
set ruler " show the ruler
|
2010-04-20 16:08:48 +00:00
|
|
|
|
set rulerformat=%30(%=\:b%n%y%m%r%w\ %l,%c%V\ %P%) " a ruler on steroids
|
2011-02-23 00:10:22 +00:00
|
|
|
|
set showcmd " show partial commands in status line and
|
2010-04-20 16:08:48 +00:00
|
|
|
|
" selected characters/lines in visual mode
|
|
|
|
|
endif
|
|
|
|
|
|
2011-02-23 00:10:22 +00:00
|
|
|
|
if has('statusline')
|
|
|
|
|
set laststatus=2
|
2011-02-25 23:07:07 +00:00
|
|
|
|
|
|
|
|
|
" Broken down into easily includeable segments
|
|
|
|
|
set statusline=%<%f\ " Filename
|
|
|
|
|
set statusline+=%w%h%m%r " Options
|
|
|
|
|
set statusline+=%{fugitive#statusline()} " Git Hotness
|
|
|
|
|
set statusline+=\ [%{&ff}/%Y] " filetype
|
|
|
|
|
set statusline+=\ [%{getcwd()}] " current dir
|
|
|
|
|
"set statusline+=\ [A=\%03.3b/H=\%02.2B] " ASCII / Hexadecimal value of char
|
|
|
|
|
set statusline+=%=%-14.(%l,%c%V%)\ %p%% " Right aligned file nav info
|
2011-02-23 00:10:22 +00:00
|
|
|
|
endif
|
2010-08-20 00:42:57 +00:00
|
|
|
|
|
|
|
|
|
set backspace=indent,eol,start " backspace for dummys
|
|
|
|
|
set linespace=0 " No extra spaces between rows
|
|
|
|
|
set nu " Line numbers on
|
|
|
|
|
set showmatch " show matching brackets/parenthesis
|
|
|
|
|
set incsearch " find as you type search
|
|
|
|
|
set hlsearch " highlight search terms
|
|
|
|
|
set winminheight=0 " windows can be 0 line high
|
|
|
|
|
set ignorecase " case insensitive search
|
|
|
|
|
set smartcase " case sensitive when uc present
|
|
|
|
|
set wildmenu " show list instead of just completing
|
2011-04-25 12:20:57 +00:00
|
|
|
|
set wildmode=list:longest,full " command <Tab> completion, list matches, then longest common part, then all.
|
2010-04-20 16:08:48 +00:00
|
|
|
|
set whichwrap=b,s,h,l,<,>,[,] " backspace and cursor keys wrap to
|
2011-02-23 00:10:22 +00:00
|
|
|
|
set scrolljump=5 " lines to scroll when cursor leaves screen
|
|
|
|
|
set scrolloff=3 " minimum lines to keep above and below cursor
|
|
|
|
|
set foldenable " auto fold code
|
2010-04-21 23:14:29 +00:00
|
|
|
|
set gdefault " the /g flag on :s substitutions by default
|
2011-04-25 12:20:57 +00:00
|
|
|
|
set list
|
|
|
|
|
set listchars=tab:>.,trail:.,extends:#,nbsp:. " Highlight problematic whitespace
|
|
|
|
|
|
2010-04-20 16:08:48 +00:00
|
|
|
|
|
|
|
|
|
" }
|
|
|
|
|
|
|
|
|
|
" Formatting {
|
|
|
|
|
set nowrap " wrap long lines
|
|
|
|
|
set autoindent " indent at the same level of the previous line
|
|
|
|
|
set shiftwidth=4 " use indents of 4 spaces
|
2011-04-06 16:19:10 +00:00
|
|
|
|
set expandtab " tabs are spaces, not tabs
|
2010-04-20 16:08:48 +00:00
|
|
|
|
set tabstop=4 " an indentation every four columns
|
2011-04-06 16:19:10 +00:00
|
|
|
|
set softtabstop=4 " let backspace delete indent
|
2010-04-20 16:08:48 +00:00
|
|
|
|
"set matchpairs+=<:> " match, to be used with %
|
|
|
|
|
set pastetoggle=<F12> " pastetoggle (sane indentation on pastes)
|
|
|
|
|
"set comments=sl:/*,mb:*,elx:*/ " auto format comment blocks
|
2010-10-28 17:54:16 +00:00
|
|
|
|
" Remove trailing whitespaces and ^M chars
|
2011-04-06 16:19:10 +00:00
|
|
|
|
autocmd FileType c,cpp,java,php,js,python,twig,xml,yml autocmd BufWritePre <buffer> :call setline(1,map(getline(1,"$"),'substitute(v:val,"\\s\\+$","","")'))
|
2010-04-20 16:08:48 +00:00
|
|
|
|
" }
|
|
|
|
|
|
2011-02-23 00:10:22 +00:00
|
|
|
|
" Key (re)Mappings {
|
2010-04-20 16:08:48 +00:00
|
|
|
|
|
2010-10-08 12:41:13 +00:00
|
|
|
|
"The default leader is '\', but many people prefer ',' as it's in a standard
|
|
|
|
|
"location
|
2010-10-28 17:54:16 +00:00
|
|
|
|
let mapleader = ','
|
2010-10-08 12:41:13 +00:00
|
|
|
|
|
2011-04-25 12:20:57 +00:00
|
|
|
|
" Making it so ; works like : for commands. Saves typing and eliminates :W style typos due to lazy holding shift.
|
|
|
|
|
nnoremap ; :
|
|
|
|
|
|
|
|
|
|
|
2010-04-20 16:08:48 +00:00
|
|
|
|
" Easier moving in tabs and windows
|
2011-02-23 00:10:22 +00:00
|
|
|
|
map <C-J> <C-W>j<C-W>_
|
|
|
|
|
map <C-K> <C-W>k<C-W>_
|
|
|
|
|
map <C-L> <C-W>l<C-W>_
|
|
|
|
|
map <C-H> <C-W>h<C-W>_
|
|
|
|
|
map <C-K> <C-W>k<C-W>_
|
|
|
|
|
|
2011-04-25 12:20:57 +00:00
|
|
|
|
" Wrapped lines goes down/up to next row, rather than next line in file.
|
|
|
|
|
nnoremap j gj
|
|
|
|
|
nnoremap k gk
|
|
|
|
|
|
2011-02-23 00:10:22 +00:00
|
|
|
|
" The following two lines conflict with moving to top and bottom of the
|
|
|
|
|
" screen
|
|
|
|
|
" If you prefer that functionality, comment them out.
|
2011-05-18 22:43:53 +00:00
|
|
|
|
map <S-H> gT
|
2011-02-23 00:10:22 +00:00
|
|
|
|
map <S-L> gt
|
|
|
|
|
|
|
|
|
|
" Stupid shift key fixes
|
2011-05-18 22:43:53 +00:00
|
|
|
|
cmap W w
|
2011-02-23 00:10:22 +00:00
|
|
|
|
cmap WQ wq
|
|
|
|
|
cmap wQ wq
|
|
|
|
|
cmap Q q
|
|
|
|
|
cmap Tabe tabe
|
2010-04-21 23:14:29 +00:00
|
|
|
|
|
|
|
|
|
" Yank from the cursor to the end of the line, to be consistent with C and D.
|
|
|
|
|
nnoremap Y y$
|
2010-08-20 00:42:57 +00:00
|
|
|
|
|
|
|
|
|
""" Code folding options
|
|
|
|
|
nmap <leader>f0 :set foldlevel=0<CR>
|
|
|
|
|
nmap <leader>f1 :set foldlevel=1<CR>
|
|
|
|
|
nmap <leader>f2 :set foldlevel=2<CR>
|
|
|
|
|
nmap <leader>f3 :set foldlevel=3<CR>
|
|
|
|
|
nmap <leader>f4 :set foldlevel=4<CR>
|
|
|
|
|
nmap <leader>f5 :set foldlevel=5<CR>
|
|
|
|
|
nmap <leader>f6 :set foldlevel=6<CR>
|
|
|
|
|
nmap <leader>f7 :set foldlevel=7<CR>
|
|
|
|
|
nmap <leader>f8 :set foldlevel=8<CR>
|
|
|
|
|
nmap <leader>f9 :set foldlevel=9<CR>
|
2010-05-16 03:57:04 +00:00
|
|
|
|
|
2011-04-25 12:20:57 +00:00
|
|
|
|
"clearing highlighted search
|
|
|
|
|
nmap <silent> <leader>/ :nohlsearch<CR>
|
|
|
|
|
|
2010-05-16 03:57:04 +00:00
|
|
|
|
" Shortcuts
|
|
|
|
|
" Change Working Directory to that of the current file
|
|
|
|
|
cmap cwd lcd %:p:h
|
2010-10-08 02:59:02 +00:00
|
|
|
|
cmap cd. lcd %:p:h
|
2010-09-29 21:06:30 +00:00
|
|
|
|
|
2010-10-31 02:50:20 +00:00
|
|
|
|
" visual shifting (does not exit Visual mode)
|
|
|
|
|
vnoremap < <gv
|
|
|
|
|
vnoremap > >gv
|
|
|
|
|
|
2010-08-20 00:42:57 +00:00
|
|
|
|
" Fix home and end keybindings for screen, particularly on mac
|
|
|
|
|
" - for some reason this fixes the arrow keys too. huh.
|
|
|
|
|
map [F $
|
|
|
|
|
imap [F $
|
|
|
|
|
map [H g0
|
|
|
|
|
imap [H g0
|
|
|
|
|
|
2010-09-29 21:06:30 +00:00
|
|
|
|
" For when you forget to sudo.. Really Write the file.
|
|
|
|
|
cmap w!! w !sudo tee % >/dev/null
|
2010-04-20 16:08:48 +00:00
|
|
|
|
" }
|
|
|
|
|
|
|
|
|
|
" Plugins {
|
|
|
|
|
|
|
|
|
|
" VCSCommand {
|
2010-10-08 02:59:02 +00:00
|
|
|
|
" let b:VCSCommandMapPrefix=',v'
|
|
|
|
|
" let b:VCSCommandVCSType='git'
|
2010-04-20 16:08:48 +00:00
|
|
|
|
" }
|
2010-04-25 01:00:54 +00:00
|
|
|
|
|
2010-04-28 12:58:54 +00:00
|
|
|
|
" PIV {
|
|
|
|
|
let g:DisableAutoPHPFolding = 0
|
2011-02-25 23:07:07 +00:00
|
|
|
|
"let cfu=phpcomplete#CompletePHP
|
2010-04-28 12:58:54 +00:00
|
|
|
|
" }
|
|
|
|
|
|
2010-04-25 01:00:54 +00:00
|
|
|
|
" Supertab {
|
2010-10-31 02:50:20 +00:00
|
|
|
|
let g:SuperTabDefaultCompletionType = "context"
|
2010-04-25 01:00:54 +00:00
|
|
|
|
let g:SuperTabContextDefaultCompletionType = "<c-x><c-o>"
|
|
|
|
|
" }
|
2010-04-20 16:08:48 +00:00
|
|
|
|
|
|
|
|
|
" Misc {
|
|
|
|
|
:map <C-F10> <Esc>:vsp<CR>:VTree<CR>
|
|
|
|
|
" map Control + F10 to Vtree
|
|
|
|
|
|
2010-08-20 01:41:01 +00:00
|
|
|
|
noremap <leader><F5> :CheckSyntax<cr>
|
2010-08-20 00:42:57 +00:00
|
|
|
|
let g:checksyntax_auto = 1
|
2010-04-20 16:08:48 +00:00
|
|
|
|
|
2010-08-20 00:42:57 +00:00
|
|
|
|
"comment out line(s) in visual mode -RB: If you do this, you can't
|
|
|
|
|
"switch sides of the comment block in visual mode.
|
|
|
|
|
"vmap o :call NERDComment(1, 'toggle')<CR>
|
2010-04-20 16:08:48 +00:00
|
|
|
|
let g:NERDShutUp=1
|
|
|
|
|
|
|
|
|
|
let b:match_ignorecase = 1
|
|
|
|
|
" }
|
2010-08-20 00:42:57 +00:00
|
|
|
|
|
2010-04-20 16:08:48 +00:00
|
|
|
|
" ShowMarks {
|
|
|
|
|
let showmarks_include = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"
|
|
|
|
|
" Don't leave on by default, use :ShowMarksOn to enable
|
2011-02-23 00:10:22 +00:00
|
|
|
|
let g:showmarks_enable = 0
|
2010-04-20 16:08:48 +00:00
|
|
|
|
" For marks a-z
|
|
|
|
|
highlight ShowMarksHLl gui=bold guibg=LightBlue guifg=Blue
|
|
|
|
|
" For marks A-Z
|
|
|
|
|
highlight ShowMarksHLu gui=bold guibg=LightRed guifg=DarkRed
|
|
|
|
|
" For all other marks
|
|
|
|
|
highlight ShowMarksHLo gui=bold guibg=LightYellow guifg=DarkYellow
|
|
|
|
|
" For multiple marks on the same line.
|
|
|
|
|
highlight ShowMarksHLm gui=bold guibg=LightGreen guifg=DarkGreen
|
|
|
|
|
" }
|
|
|
|
|
|
2011-02-23 00:10:22 +00:00
|
|
|
|
" Command-t {
|
|
|
|
|
let g:CommandTSearchPath = $HOME . '/Code'
|
|
|
|
|
" }
|
|
|
|
|
|
2010-04-20 16:08:48 +00:00
|
|
|
|
" OmniComplete {
|
2011-05-17 23:57:54 +00:00
|
|
|
|
if has("autocmd") && exists("+omnifunc")
|
|
|
|
|
autocmd Filetype *
|
|
|
|
|
\if &omnifunc == "" |
|
|
|
|
|
\setlocal omnifunc=syntaxcomplete#Complete |
|
|
|
|
|
\endif
|
|
|
|
|
endif
|
2010-04-20 16:08:48 +00:00
|
|
|
|
|
|
|
|
|
" Popup menu hightLight Group
|
2010-08-20 00:42:57 +00:00
|
|
|
|
"highlight Pmenu ctermbg=13 guibg=DarkBlue
|
2010-08-20 16:26:46 +00:00
|
|
|
|
"highlight PmenuSel ctermbg=7 guibg=DarkBlue guifg=LightBlue
|
2010-08-20 00:42:57 +00:00
|
|
|
|
"highlight PmenuSbar ctermbg=7 guibg=DarkGray
|
|
|
|
|
"highlight PmenuThumb guibg=Black
|
2010-04-20 16:08:48 +00:00
|
|
|
|
|
|
|
|
|
hi Pmenu guifg=#000000 guibg=#F8F8F8 ctermfg=black ctermbg=Lightgray
|
|
|
|
|
hi PmenuSbar guifg=#8A95A7 guibg=#F8F8F8 gui=NONE ctermfg=darkcyan ctermbg=lightgray cterm=NONE
|
|
|
|
|
hi PmenuThumb guifg=#F8F8F8 guibg=#8A95A7 gui=NONE ctermfg=lightgray ctermbg=darkcyan cterm=NONE
|
|
|
|
|
|
|
|
|
|
" some convenient mappings
|
|
|
|
|
inoremap <expr> <Esc> pumvisible() ? "\<C-e>" : "\<Esc>"
|
|
|
|
|
inoremap <expr> <CR> pumvisible() ? "\<C-y>" : "\<CR>"
|
|
|
|
|
inoremap <expr> <Down> pumvisible() ? "\<C-n>" : "\<Down>"
|
|
|
|
|
inoremap <expr> <Up> pumvisible() ? "\<C-p>" : "\<Up>"
|
2011-05-18 22:43:53 +00:00
|
|
|
|
inoremap <expr> <C-d> pumvisible() ? "\<PageDown>\<C-p>\<C-n>" : "\<C-d>"
|
2010-04-20 16:08:48 +00:00
|
|
|
|
inoremap <expr> <C-u> pumvisible() ? "\<PageUp>\<C-p>\<C-n>" : "\<C-u>"
|
|
|
|
|
|
2011-01-28 22:43:48 +00:00
|
|
|
|
" and make sure that it doesn't break supertab
|
|
|
|
|
let g:SuperTabCrMapping = 0
|
|
|
|
|
|
2010-04-20 16:08:48 +00:00
|
|
|
|
" automatically open and close the popup menu / preview window
|
|
|
|
|
au CursorMovedI,InsertLeave * if pumvisible() == 0|silent! pclose|endif
|
2010-10-31 02:50:20 +00:00
|
|
|
|
set completeopt=menu,preview,longest
|
2010-04-20 16:08:48 +00:00
|
|
|
|
" }
|
|
|
|
|
|
|
|
|
|
" Ctags {
|
2010-07-08 22:50:44 +00:00
|
|
|
|
set tags=./tags;/,~/.vimtags
|
|
|
|
|
" }
|
|
|
|
|
|
|
|
|
|
" EasyTags {
|
2010-08-20 00:42:57 +00:00
|
|
|
|
let g:easytags_cmd = 'ctags'
|
2010-04-20 16:08:48 +00:00
|
|
|
|
" }
|
2010-04-28 03:40:26 +00:00
|
|
|
|
|
|
|
|
|
" Delimitmate {
|
2011-02-23 00:10:22 +00:00
|
|
|
|
au FileType * let b:delimitMate_autoclose = 1
|
2010-04-28 03:40:26 +00:00
|
|
|
|
|
|
|
|
|
" If using html auto complete (complete closing tag)
|
|
|
|
|
au FileType xml,html,xhtml let b:delimitMate_matchpairs = "(:),[:],{:}"
|
|
|
|
|
" }
|
2010-04-27 17:58:52 +00:00
|
|
|
|
|
2010-04-28 03:40:26 +00:00
|
|
|
|
" AutoCloseTag {
|
2011-05-18 22:11:40 +00:00
|
|
|
|
" Make it so AutoCloseTag works for xml and xhtml files as well
|
|
|
|
|
au FileType xhtml,xml ru ftplugin/html/autoclosetag.vim
|
|
|
|
|
nmap <Leader>ac <Plug>ToggleAutoCloseMappings
|
2010-04-28 03:40:26 +00:00
|
|
|
|
" }
|
2010-04-20 16:08:48 +00:00
|
|
|
|
|
2010-05-16 03:57:04 +00:00
|
|
|
|
" SnipMate {
|
|
|
|
|
" Setting the author var
|
2011-02-23 00:10:22 +00:00
|
|
|
|
" If forking, please overwrite in your .vimrc.local file
|
|
|
|
|
let g:snips_author = 'Steve Francia <steve.francia@gmail.com>'
|
2010-05-16 03:57:04 +00:00
|
|
|
|
" Shortcut for reloading snippets, useful when developing
|
|
|
|
|
nnoremap ,smr <esc>:exec ReloadAllSnippets()<cr>
|
|
|
|
|
" }
|
2010-10-08 02:59:02 +00:00
|
|
|
|
|
|
|
|
|
" NerdTree {
|
|
|
|
|
map <C-e> :NERDTreeToggle<CR>:NERDTreeMirror<CR>
|
|
|
|
|
map <leader>e :NERDTreeFind<CR>
|
|
|
|
|
nmap <leader>nt :NERDTreeFind<CR>
|
|
|
|
|
|
|
|
|
|
let NERDTreeShowBookmarks=1
|
|
|
|
|
let NERDTreeIgnore=['\.pyc', '\~$', '\.swo$', '\.swp$', '\.git', '\.hg', '\.svn', '\.bzr']
|
|
|
|
|
let NERDTreeChDirMode=0
|
2011-02-23 00:10:22 +00:00
|
|
|
|
let NERDTreeQuitOnOpen=1
|
2010-10-08 02:59:02 +00:00
|
|
|
|
let NERDTreeShowHidden=1
|
|
|
|
|
let NERDTreeKeepTreeInNewTab=1
|
2011-02-23 00:10:22 +00:00
|
|
|
|
" }
|
2011-05-05 14:24:50 +00:00
|
|
|
|
|
|
|
|
|
" Tabularize {
|
|
|
|
|
if exists(":Tabularize")
|
|
|
|
|
nmap <Leader>a= :Tabularize /=<CR>
|
|
|
|
|
vmap <Leader>a= :Tabularize /=<CR>
|
|
|
|
|
nmap <Leader>a: :Tabularize /:<CR>
|
|
|
|
|
vmap <Leader>a: :Tabularize /:<CR>
|
|
|
|
|
nmap <Leader>a:: :Tabularize /:\zs<CR>
|
|
|
|
|
vmap <Leader>a:: :Tabularize /:\zs<CR>
|
|
|
|
|
nmap <Leader>a, :Tabularize /,<CR>
|
|
|
|
|
vmap <Leader>a, :Tabularize /,<CR>
|
|
|
|
|
nmap <Leader>a| :Tabularize /|<CR>
|
|
|
|
|
vmap <Leader>a| :Tabularize /|<CR>
|
|
|
|
|
endif
|
|
|
|
|
" }
|
|
|
|
|
|
2011-02-23 00:10:22 +00:00
|
|
|
|
|
2010-08-20 00:42:57 +00:00
|
|
|
|
" Richard's plugins {
|
|
|
|
|
" Fuzzy Finder {
|
|
|
|
|
""" Fuzzy Find file, tree, buffer, line
|
|
|
|
|
nmap <leader>ff :FufFile **/<CR>
|
|
|
|
|
nmap <leader>ft :FufFile<CR>
|
|
|
|
|
nmap <leader>fb :FufBuffer<CR>
|
|
|
|
|
nmap <leader>fl :FufLine<CR>
|
|
|
|
|
nmap <leader>fr :FufRenewCache<CR>
|
|
|
|
|
" }
|
|
|
|
|
|
|
|
|
|
" Session List {
|
|
|
|
|
set sessionoptions=blank,buffers,curdir,folds,tabpages,winsize
|
|
|
|
|
nmap <leader>sl :SessionList<CR>
|
|
|
|
|
nmap <leader>ss :SessionSave<CR>
|
|
|
|
|
" }
|
|
|
|
|
|
|
|
|
|
" Buffer explorer {
|
|
|
|
|
nmap <leader>b :BufExplorer<CR>
|
|
|
|
|
" }
|
|
|
|
|
|
|
|
|
|
" VCS commands {
|
|
|
|
|
nmap <leader>vs :VCSStatus<CR>
|
|
|
|
|
nmap <leader>vc :VCSCommit<CR>
|
|
|
|
|
nmap <leader>vb :VCSBlame<CR>
|
|
|
|
|
nmap <leader>va :VCSAdd<CR>
|
|
|
|
|
nmap <leader>vd :VCSVimDiff<CR>
|
|
|
|
|
nmap <leader>vl :VCSLog<CR>
|
|
|
|
|
nmap <leader>vu :VCSUpdate<CR>
|
|
|
|
|
" }
|
|
|
|
|
" php-doc commands {
|
|
|
|
|
nmap <leader>pd :call PhpDocSingle()<CR>
|
|
|
|
|
vmap <leader>pd :call PhpDocRange()<CR>
|
|
|
|
|
" }
|
|
|
|
|
|
|
|
|
|
" Debugging with VimDebugger {
|
|
|
|
|
map <F11> :DbgStepInto<CR>
|
|
|
|
|
map <F10> :DbgStepOver<CR>
|
|
|
|
|
map <S-F11> :DbgStepOut<CR>
|
|
|
|
|
map <F5> :DbgRun<CR>
|
|
|
|
|
map <F6> :DbgDetach<CR>
|
|
|
|
|
map <F8> :DbgToggleBreakpoint<CR>
|
|
|
|
|
map <S-F8> :DbgFlushBreakpoints<CR>
|
|
|
|
|
map <F9> :DbgRefreshWatch<CR>
|
|
|
|
|
map <S-F9> :DbgAddWatch<CR>
|
|
|
|
|
" }
|
|
|
|
|
|
|
|
|
|
" Taglist Variables {
|
|
|
|
|
let Tlist_Auto_Highlight_Tag = 1
|
|
|
|
|
let Tlist_Auto_Update = 1
|
|
|
|
|
let Tlist_Exit_OnlyWindow = 1
|
|
|
|
|
let Tlist_File_Fold_Auto_Close = 1
|
|
|
|
|
let Tlist_Highlight_Tag_On_BufEnter = 1
|
|
|
|
|
let Tlist_Use_Right_Window = 1
|
|
|
|
|
let Tlist_Use_SingleClick = 1
|
|
|
|
|
|
|
|
|
|
let g:ctags_statusline=1
|
|
|
|
|
" Override how taglist does javascript
|
|
|
|
|
let g:tlist_javascript_settings = 'javascript;f:function;c:class;m:method;p:property;v:global'
|
|
|
|
|
" }
|
2011-02-18 21:07:21 +00:00
|
|
|
|
|
|
|
|
|
" JSON {
|
|
|
|
|
nmap <leader>jt <Esc>:%!python -m json.tool<CR><Esc>:set filetype=json<CR>
|
|
|
|
|
" }
|
2010-10-08 02:59:02 +00:00
|
|
|
|
" }
|
2010-04-20 16:08:48 +00:00
|
|
|
|
" }
|
|
|
|
|
|
|
|
|
|
" GUI Settings {
|
|
|
|
|
" GVIM- (here instead of .gvimrc)
|
|
|
|
|
if has('gui_running')
|
|
|
|
|
set guioptions-=T " remove the toolbar
|
|
|
|
|
set lines=40 " 40 lines of text instead of 24,
|
2010-10-08 02:59:02 +00:00
|
|
|
|
set transparency=5 " Make the window slightly transparent
|
|
|
|
|
else
|
|
|
|
|
set term=builtin_ansi " Make arrow and other keys work
|
2010-04-20 16:08:48 +00:00
|
|
|
|
endif
|
|
|
|
|
" }
|
2010-08-20 16:26:46 +00:00
|
|
|
|
|
2011-02-13 05:30:46 +00:00
|
|
|
|
function! InitializeDirectories()
|
|
|
|
|
let separator = "."
|
|
|
|
|
let parent = $HOME
|
|
|
|
|
let prefix = '.vim'
|
|
|
|
|
let dir_list = {
|
|
|
|
|
\ 'backup': 'backupdir',
|
|
|
|
|
\ 'views': 'viewdir',
|
|
|
|
|
\ 'swap': 'directory' }
|
|
|
|
|
|
|
|
|
|
for [dirname, settingname] in items(dir_list)
|
|
|
|
|
let directory = parent . '/' . prefix . dirname . "/"
|
|
|
|
|
if exists("*mkdir")
|
|
|
|
|
if !isdirectory(directory)
|
|
|
|
|
call mkdir(directory)
|
|
|
|
|
endif
|
|
|
|
|
endif
|
|
|
|
|
if !isdirectory(directory)
|
|
|
|
|
echo "Warning: Unable to create backup directory: " . directory
|
|
|
|
|
echo "Try: mkdir -p " . directory
|
|
|
|
|
else
|
2011-05-17 23:46:31 +00:00
|
|
|
|
let directory = substitute(directory, " ", "\\\\ ", "g")
|
2011-02-15 23:51:26 +00:00
|
|
|
|
exec "set " . settingname . "=" . directory
|
2011-02-13 05:30:46 +00:00
|
|
|
|
endif
|
|
|
|
|
endfor
|
|
|
|
|
endfunction
|
2011-05-18 22:43:53 +00:00
|
|
|
|
call InitializeDirectories()
|
2011-02-13 05:30:46 +00:00
|
|
|
|
|
|
|
|
|
function! NERDTreeInitAsNeeded()
|
|
|
|
|
redir => bufoutput
|
|
|
|
|
buffers!
|
|
|
|
|
redir END
|
|
|
|
|
let idx = stridx(bufoutput, "NERD_tree")
|
|
|
|
|
if idx > -1
|
|
|
|
|
NERDTreeMirror
|
|
|
|
|
NERDTreeFind
|
|
|
|
|
wincmd l
|
|
|
|
|
endif
|
|
|
|
|
endfunction
|
2010-08-31 20:41:34 +00:00
|
|
|
|
|
|
|
|
|
" Use local vimrc if available {
|
|
|
|
|
if filereadable(expand("~/.vimrc.local"))
|
|
|
|
|
source ~/.vimrc.local
|
|
|
|
|
endif
|
|
|
|
|
" }
|