Thread: [Assorted-commits] SF.net SVN: assorted: [262] configs/trunk/src/vim/plugin/_yang.vim
Brought to you by:
yangzhang
From: <yan...@us...> - 2008-01-20 06:41:21
|
Revision: 262 http://assorted.svn.sourceforge.net/assorted/?rev=262&view=rev Author: yangzhang Date: 2008-01-19 22:41:25 -0800 (Sat, 19 Jan 2008) Log Message: ----------- tweak 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-01-20 06:41:09 UTC (rev 261) +++ configs/trunk/src/vim/plugin/_yang.vim 2008-01-20 06:41:25 UTC (rev 262) @@ -129,8 +129,7 @@ " AUTOCOMMANDS ---------------------------------------------------------------- " makes this enable plugins and indentation based on file types -filetype plugin on -filetype indent on +filetype plugin indent on " binaries augroup Binary au! This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <yan...@us...> - 2008-01-20 19:24:54
|
Revision: 268 http://assorted.svn.sourceforge.net/assorted/?rev=268&view=rev Author: yangzhang Date: 2008-01-20 11:24:54 -0800 (Sun, 20 Jan 2008) Log Message: ----------- fixed filetype detection 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-01-20 18:26:49 UTC (rev 267) +++ configs/trunk/src/vim/plugin/_yang.vim 2008-01-20 19:24:54 UTC (rev 268) @@ -126,10 +126,17 @@ set winaltkeys=no set wrapscan " TODO ??? +" Enable plugins and indentation based on filetypes. We must first deactivate +" filetype detection because "filetype * on" is the instant when vim crawls +" the indent/ and ftplugin/ directories in the current rtp. However, if this +" is already on, then the command will do nothing. In fact, this is already +" likely to be on (due to default or platform-specific configurations). +" Hence, we need to turn it off to force vim to see the files in our current +" rtp. +filetype off +filetype plugin indent on " AUTOCOMMANDS ---------------------------------------------------------------- -" makes this enable plugins and indentation based on file types -filetype plugin indent on " binaries augroup Binary au! This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <yan...@us...> - 2008-01-30 05:48:14
|
Revision: 274 http://assorted.svn.sourceforge.net/assorted/?rev=274&view=rev Author: yangzhang Date: 2008-01-29 21:48:19 -0800 (Tue, 29 Jan 2008) Log Message: ----------- added java settings 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-01-30 05:47:58 UTC (rev 273) +++ configs/trunk/src/vim/plugin/_yang.vim 2008-01-30 05:48:19 UTC (rev 274) @@ -155,6 +155,7 @@ au BufNewFile,BufRead *.map setf map " temporaries autocmd BufEnter *.{c,cc,cpp,cxx,h} setlocal cindent expandtab softtabstop=4 shiftwidth=4 tabstop=8 +autocmd BufEnter *.java setlocal cindent noexpandtab softtabstop=4 shiftwidth=4 tabstop=4 " autocmd GDB au BufEnter *.gdb set ft=gdb " autocmd hxx, cxx This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <yan...@us...> - 2008-02-02 09:08:18
|
Revision: 288 http://assorted.svn.sourceforge.net/assorted/?rev=288&view=rev Author: yangzhang Date: 2008-02-02 01:08:15 -0800 (Sat, 02 Feb 2008) Log Message: ----------- added reminder 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-02-02 03:22:42 UTC (rev 287) +++ configs/trunk/src/vim/plugin/_yang.vim 2008-02-02 09:08:15 UTC (rev 288) @@ -148,6 +148,8 @@ au BufWritePost *.bin if &bin | %!xxd au BufWritePost *.bin set nomod | endif augroup END +" TODO change all BufEnter to something more correct; BufEnter is annoyingly +" aggressive and triggers whenever we (for instance) switch into this buffer " Java/Eclim "au BufEnter *.java iunmap <tab> "au BufEnter *.java setlocal cot+=longest | inoremap <buffer> . .<c-x><c-u> | inoremap <buffer> <c-j> <c-x><c-u> | nnoremap <silent> <buffer> <tab> :call eclim#util#FillTemplate("${", "}")<cr> | nnoremap <silent> <buffer> <leader>i :JavaImport<cr> | nnoremap <silent> <buffer> <leader>d :JavaDocSearch -x declarations<cr> | nnoremap <silent> <buffer> <cr> :JavaSearchContext<cr> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <yan...@us...> - 2008-02-15 02:43:14
|
Revision: 438 http://assorted.svn.sourceforge.net/assorted/?rev=438&view=rev Author: yangzhang Date: 2008-02-14 18:43:19 -0800 (Thu, 14 Feb 2008) Log Message: ----------- got rid of bufenter 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-02-15 02:42:03 UTC (rev 437) +++ configs/trunk/src/vim/plugin/_yang.vim 2008-02-15 02:43:19 UTC (rev 438) @@ -117,7 +117,7 @@ set ruler " TODO ??? set shiftwidth=2 set showmatch -set smartindent " TODO ??? +set nosmartindent " TODO ??? set switchbuf=useopen " TODO ??? set tabstop=2 set updatetime=500 @@ -137,6 +137,10 @@ filetype plugin indent on " AUTOCOMMANDS ---------------------------------------------------------------- + +" Don't use BufEnter since it is annoyingly aggressive and triggers whenever +" we (for instance) switch into this buffer + " binaries augroup Binary au! @@ -148,20 +152,19 @@ au BufWritePost *.bin if &bin | %!xxd au BufWritePost *.bin set nomod | endif augroup END -" TODO change all BufEnter to something more correct; BufEnter is annoyingly -" aggressive and triggers whenever we (for instance) switch into this buffer + " Java/Eclim -"au BufEnter *.java iunmap <tab> -"au BufEnter *.java setlocal cot+=longest | inoremap <buffer> . .<c-x><c-u> | inoremap <buffer> <c-j> <c-x><c-u> | nnoremap <silent> <buffer> <tab> :call eclim#util#FillTemplate("${", "}")<cr> | nnoremap <silent> <buffer> <leader>i :JavaImport<cr> | nnoremap <silent> <buffer> <leader>d :JavaDocSearch -x declarations<cr> | nnoremap <silent> <buffer> <cr> :JavaSearchContext<cr> +"au BufNewFile,BufRead *.java iunmap <tab> +"au BufNewFile,BufRead *.java setlocal cot+=longest | inoremap <buffer> . .<c-x><c-u> | inoremap <buffer> <c-j> <c-x><c-u> | nnoremap <silent> <buffer> <tab> :call eclim#util#FillTemplate("${", "}")<cr> | nnoremap <silent> <buffer> <leader>i :JavaImport<cr> | nnoremap <silent> <buffer> <leader>d :JavaDocSearch -x declarations<cr> | nnoremap <silent> <buffer> <cr> :JavaSearchContext<cr> " autocmd Mapserver map files au BufNewFile,BufRead *.map setf map " temporaries -autocmd BufEnter *.{c,cc,cpp,cxx,h} setlocal cindent expandtab softtabstop=4 shiftwidth=4 tabstop=8 -autocmd BufEnter *.java setlocal cindent noexpandtab softtabstop=4 shiftwidth=4 tabstop=4 +autocmd BufNewFile,BufRead *.{c,cc,cpp,cxx,h} 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 BufEnter *.gdb set ft=gdb +au BufNewFile,BufRead *.gdb set ft=gdb " autocmd hxx, cxx -"au BufEnter *.[ch]xx setlocal et +"au BufNewFile,BufRead *.[ch]xx setlocal et "au BufReadPost * " \ if line("'\"") > 0 && line("'\"") <= line("$") | " \ exe "normal g`\"" | This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
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. |
From: <yan...@us...> - 2008-05-08 20:18:53
|
Revision: 754 http://assorted.svn.sourceforge.net/assorted/?rev=754&view=rev Author: yangzhang Date: 2008-05-08 13:18:33 -0700 (Thu, 08 May 2008) Log Message: ----------- added .lzx (for some reason it doesn't seem to be working automatically) 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 20:18:02 UTC (rev 753) +++ configs/trunk/src/vim/plugin/_yang.vim 2008-05-08 20:18:33 UTC (rev 754) @@ -187,6 +187,7 @@ 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 BufNewFile,BufRead *.lzx setlocal filetype=lzx " autocmd GDB au BufNewFile,BufRead *.gdb set ft=gdb " autocmd hxx, cxx This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <yan...@us...> - 2008-05-10 05:46:09
|
Revision: 791 http://assorted.svn.sourceforge.net/assorted/?rev=791&view=rev Author: yangzhang Date: 2008-05-09 22:46:06 -0700 (Fri, 09 May 2008) Log Message: ----------- fixed date insertion 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-10 05:45:51 UTC (rev 790) +++ configs/trunk/src/vim/plugin/_yang.vim 2008-05-10 05:46:06 UTC (rev 791) @@ -25,7 +25,7 @@ map <space> <c-f> map <s-space> <c-b> -imap <f6> <c-o>=system("date")[0:-2]<cr> +imap <f6> <c-r>=system("date")[0:-2]<cr> " imap <f6> <c-r>=strftime("%d/%m/%Y %H:%M:%S")<cr> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <yan...@us...> - 2008-05-14 22:57:44
|
Revision: 821 http://assorted.svn.sourceforge.net/assorted/?rev=821&view=rev Author: yangzhang Date: 2008-05-14 15:57:50 -0700 (Wed, 14 May 2008) Log Message: ----------- added f7 date insertion 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-14 22:57:35 UTC (rev 820) +++ configs/trunk/src/vim/plugin/_yang.vim 2008-05-14 22:57:50 UTC (rev 821) @@ -26,6 +26,7 @@ map <s-space> <c-b> imap <f6> <c-r>=system("date")[0:-2]<cr> +imap <f7> <c-r>=strftime("%Y-%m-%d")<cr> " imap <f6> <c-r>=strftime("%d/%m/%Y %H:%M:%S")<cr> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <yan...@us...> - 2008-07-07 21:44:56
|
Revision: 884 http://assorted.svn.sourceforge.net/assorted/?rev=884&view=rev Author: yangzhang Date: 2008-07-07 14:45:04 -0700 (Mon, 07 Jul 2008) Log Message: ----------- added underlining; added m-b for ToggleBrowser 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-07-07 21:42:05 UTC (rev 883) +++ configs/trunk/src/vim/plugin/_yang.vim 2008-07-07 21:45:04 UTC (rev 884) @@ -15,9 +15,10 @@ nnoremap <silent> <C-BS> :call ShiftWordInSpace(-1)<CR> nnoremap <silent> \cw :call CenterWordInSpace()<CR> + nnoremap <silent> \va :call AlignWordWithWordInPreviousLine()<CR> -nmap <m-b> :silent call ToggleBrowser()<CR> +nnoremap <m-b> :silent call ToggleBrowser()<CR> "map <F1> :call ToggleSketch()<CR> @@ -25,8 +26,15 @@ map <space> <c-f> map <s-space> <c-b> -imap <f6> <c-r>=system("date")[0:-2]<cr> -imap <f7> <c-r>=strftime("%Y-%m-%d")<cr> +" underline with character of your choice, e.g.: <f5>- or <f5>= +nnoremap <f5> yyp<c-v>$r +inoremap <f5> <esc>yyp<c-v>$r + +" insert timestamp +inoremap <f6> <c-r>=system("date")[0:-2]<cr> + +" insert datestamp +inoremap <f7> <c-r>=strftime("%Y-%m-%d")<cr> " imap <f6> <c-r>=strftime("%d/%m/%Y %H:%M:%S")<cr> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |