set isk+=_,@,- " none of these should be word dividers, so make them not be
set nobackup
+set completeopt=longest,menuone,preview
+inoremap <expr> <CR> pumvisible() ? "\<C-y>" : "\<C-g>u\<CR>"
+inoremap <expr> <C-n> pumvisible() ? '<C-n>' :
+ \ '<C-n><C-r>=pumvisible() ? "\<lt>Down>" : ""<CR>'
+
+inoremap <expr> <M-,> pumvisible() ? '<C-n>' :
+ \ '<C-x><C-o><C-n><C-p><C-r>=pumvisible() ? "\<lt>Down>" : ""<CR>'
+
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" Theme/Colors
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" Map NERDTree show and hide
map <F2> :NERDTreeToggle<CR>
imap <F2> <Esc>:NERDTreeToggle<CR>
-" Taglist toggle
-map <F3> :TlistOpen<CR>
-imap <F3> <Esc>:TlistClose<CR>
+" Tagbar toggle
+map <F3> :TagbarToggle<CR>
+imap <F3> <Esc>:TagbarToggle<CR>
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
autocmd BufNewFile *.pl call append(0, "#!/usr/bin/perl")
autocmd BufNewFile *.py call append(0, "#!/bin/python")
+
+ " PHP documenter script bound to Control-P
+ autocmd FileType php inoremap <C-p> <ESC>:call PhpDocSingle()<CR>i
+ autocmd FileType php nnoremap <C-p> :call PhpDocSingle()<CR>
+ autocmd FileType php vnoremap <C-p> :call PhpDocRange()<CR>
+
" When editing a file, always jump to the last known cursor position.
" Don't do it when the position is invalid or when inside an event handler
" (happens when dropping a file on gvim).
set title
endif
+
+
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" Plugin activation
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
exec 'set runtimepath+='.vam_install_path.'/vim-addon-manager'
" Enable addons with vim-addon-manager using file type recognition
let ft_addons = {
- \ 'always': ['surround', 'checksyntax', 'LargeFile', 'snipmate', 'snipmate-snippets', 'The_NERD_tree'],
+ \ 'always': ['surround', 'checksyntax', 'LargeFile', 'snipmate', 'snipmate-snippets', 'The_NERD_tree', 'SuperTab%1643'],
\ 'r': [ 'Screen_vim__gnu_screentmux', 'Vim-R-plugin' ],
- \ '^\%(c\|cpp\|javascript\|python\|php\|html\|xml\|r\|sh\|css\|java\|make\|xslt\|vim\)$': [ 'taglist-plus', 'checksyntax'],
- \ 'python': ['pythoncomplete', 'pydoc', 'python%790'],
+ \ '^\%(c\|cpp\|javascript\|python\|php\|html\|xml\|r\|sh\|css\|java\|make\|xslt\|vim\)$': [ 'Tagbar', 'checksyntax'],
+ \ '^\%(c\|cpp\)$': [ 'clang_complete' ],
+ \ 'python': ['pythoncomplete', 'pydoc'],
+ \ 'php': ['phpcomplete', 'PDV_-_phpDocumentor_for_Vim'],
\ 'gpg': ['gnupg'],
\ }
call vam#ActivateAddons(ft_addons['always'], {'auto_install': 1})
au FileType * for l in values(filter(copy(ft_addons), string(expand('<amatch>')).' =~ v:key')) | call vam#ActivateAddons(l, {'force_loading_plugins_now':1}) | endfor
+
+" SuperTab option for context aware completion
+let g:SuperTabDefaultCompletionType = "context"
+
+let g:clang_complete_copen = 1
+let g:clang_complete_auto = 1
+let g:clang_user_options='|| exit 0'