Cleanup of spacing, removed a few defunct config sections

This commit is contained in:
Richard Bateman 2011-12-10 13:10:06 -07:00 committed by Steve Francia
parent f6fbdcabb6
commit ba0cc623e6

570
.vimrc
View File

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