[Assorted-commits] SF.net SVN: assorted: [730] configs/trunk/src/vim/plugin/_yang.vim
Brought to you by:
yangzhang
From: <yan...@us...> - 2008-05-08 19:16:54
|
Revision: 730 http://assorted.svn.sourceforge.net/assorted/?rev=730&view=rev Author: yangzhang Date: 2008-05-08 12:16:37 -0700 (Thu, 08 May 2008) Log Message: ----------- added quick date insertion; fixed vimdiff colors Modified Paths: -------------- configs/trunk/src/vim/plugin/_yang.vim Modified: configs/trunk/src/vim/plugin/_yang.vim =================================================================== --- configs/trunk/src/vim/plugin/_yang.vim 2008-05-08 19:06:11 UTC (rev 729) +++ configs/trunk/src/vim/plugin/_yang.vim 2008-05-08 19:16:37 UTC (rev 730) @@ -25,11 +25,36 @@ map <space> <c-f> map <s-space> <c-b> +imap <f6> <c-o>=system("date")[0:-2]<cr> +" imap <f6> <c-r>=strftime("%d/%m/%Y %H:%M:%S")<cr> +function ProjectDir() + let dir = expand('%:h') + if (dir =~ "^$") + let dir = getcwd() + endif + while isdirectory(dir) && + \dir !~ '^/*$' && + \glob(dir . "/.project.vim") !~ "^$" + let dir = fnamemodify(dir, ":h") + endwhile + if glob(dir . "/.project.vim") =~ "^$" + let dir = getcwd() + endif + return dir +endfunction + +" XXX Why doesn't this work the first time if I directly load a file from the command line, eg "vim foo.cc"? +" XXX This is highly insecure; should only allow the same things allowed in modelines. +autocmd BufNewFile,BufRead * if glob(ProjectDir() . "/.project.vim") !~ "^$" | execute "source " . ProjectDir() . "/.project.vim" | endif + + + + imap ^D <ESC>`[ @@ -159,7 +184,8 @@ " autocmd Mapserver map files au BufNewFile,BufRead *.map setf map " temporaries -autocmd BufNewFile,BufRead *.{c,cc,cpp,cxx,h} setlocal cindent expandtab softtabstop=2 shiftwidth=2 tabstop=8 +autocmd BufNewFile,BufRead *.{lzz,tt,tcc} setlocal filetype=cpp +autocmd BufNewFile,BufRead *.{c,cc,cpp,cxx,h,lzz,tt,tcc} setlocal cindent expandtab softtabstop=2 shiftwidth=2 tabstop=8 autocmd BufNewFile,BufRead *.java setlocal cindent noexpandtab softtabstop=4 shiftwidth=4 tabstop=4 " autocmd GDB au BufNewFile,BufRead *.gdb set ft=gdb @@ -365,28 +391,9 @@ ""au BufRead *.lhs compiler ghci " hugs filetype plugin indent on -function ProjectDir() - let dir = expand('%') - if (dir =~ "^$") - let dir = getcwd() - endif - while isdirectory(dir) && - \ dir !~ '^/*$' && - \glob(dir . "/configure*") =~ "^$" - let dir = fnamemodify(dir, ":h") - endwhile - if glob(dir . "/configure*") =~ "^$" - let dir = getcwd() - endif - return dir -endfunction +highlight DiffAdd ctermbg=4 ctermfg=gray +highlight DiffChange ctermbg=5 +highlight DiffDelete cterm=bold ctermbg=6 ctermfg=gray +highlight DiffText cterm=bold ctermbg=1 -" ctags handling -let tag_path = ProjectDir() . "/tags" -let &tags = &tags . "," . tag_path -autocmd BufWritePost * - \ if exists("b:is_source") && b:is_source | - \ silent! exe "!ctags -f ".tag_path." -a ".expand("%") | - \ endif - " vim:et:sw=2:ts=2 This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |