X-Git-Url: https://v.licheni.net/stack/conf/vim.git/blobdiff_plain/dcb11c1c29c57db025d616ff3bd08d2de54ff0d5..fc439c42dd9170620ac31f0f27575097d6b6ca3c:/vimrc?ds=inline diff --git a/vimrc b/vimrc index 4364483..9f079ea 100644 --- a/vimrc +++ b/vimrc @@ -10,6 +10,14 @@ set viminfo+=! " make sure it can save viminfo set isk+=_,@,- " none of these should be word dividers, so make them not be set nobackup +set completeopt=longest,menuone,preview +inoremap pumvisible() ? "\" : "\u\" +inoremap pumvisible() ? '' : + \ '=pumvisible() ? "\Down>" : ""' + +inoremap pumvisible() ? '' : + \ '=pumvisible() ? "\Down>" : ""' + """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" " Theme/Colors """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" @@ -29,7 +37,7 @@ set ruler " Always show current positions along the bottom set number " turn on line numbers set lz " do not redraw while running macros (much faster) (LazyRedraw) set hid " you can change buffer without saving -set backspace=2 " make backspace work normal +set backspace=eol,start,indent " make backspace work normal set whichwrap+=<,>,h,l " backspace and cursor keys wrap to set shortmess=atI " shortens messages to avoid 'press a key' prompt set report=0 " tell us when anything is changed via :... @@ -54,6 +62,7 @@ set laststatus=2 " always show the status line " Text Formatting/Layout """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" set fo=tcrqn " See Help (complex) +set ai " autoindent set si " smartindent set tabstop=4 " tab spacing (settings below are just to unify it) set softtabstop=4 " unify @@ -152,10 +161,13 @@ map :call MySpellLang() " Map NERDTree show and hide map :NERDTreeToggle imap :NERDTreeToggle -" Taglist toggle -map :TlistOpen -imap :TlistClose +" Tagbar toggle +map :TagbarToggle +imap :TagbarToggle +" Alt-right/left to navigate forward/backward in the tags stack +map +map """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" " Autocommands @@ -181,6 +193,12 @@ if has ("autocmd") 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 :call PhpDocSingle()i + autocmd FileType php nnoremap :call PhpDocSingle() + autocmd FileType php vnoremap :call PhpDocRange() + " 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). @@ -191,11 +209,6 @@ if has ("autocmd") endif -""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" -" Useful abbrevs -""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" -iab xdate =strftime("%d/%m/%y %H:%M:%S") - """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" " General configs """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" @@ -208,6 +221,8 @@ if &term == "screen" || &term == "xterm" set title endif + + """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" " Plugin activation """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" @@ -217,11 +232,20 @@ let vam_install_path = expand('$HOME') . '/.vim/addons' 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'], - \ 'python': ['pythoncomplete', 'pydoc', 'python%790'], + \ '^\%(c\|cpp\|javascript\|python\|php\|html\|xml\|r\|sh\|css\|java\|make\|xslt\|vim\)$': [ 'Tagbar', 'checksyntax', 'TagHighlight'], + \ '^\%(c\|cpp\)$': [ 'clang_complete' ], + \ 'python': ['pythoncomplete', 'python_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('')).' =~ 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'