| verzia 1.45, 2002/02/20 19:11:51 |
verzia 1.46, 2002/02/24 18:39:59 |
| Riadok 67 let g:makeflags="" |
|
| Riadok 67 let g:makeflags="" |
|
| " Settings for AutoLastMod {{{ |
" Settings for AutoLastMod {{{ |
| " Set this to 1 if you will automaticaly change date of modification of file. |
" Set this to 1 if you will automaticaly change date of modification of file. |
| let g:autolastmod=1 |
let g:autolastmod=1 |
| " Modification is made on line like this variable: |
" Modification is made on line like this variable (regular expression!): |
| let g:autolastmodtext="Last modified: " |
let g:autolastmodtext="^\\([ ]*Last modified: \\)" |
| " }}} |
" }}} |
| |
|
| |
|
|
|
| |
|
| " Autocommands for *.html *.cgi {{{ |
" Autocommands for *.html *.cgi {{{ |
| " Automatic updates date of last modification in HTML files. File must |
" Automatic updates date of last modification in HTML files. File must |
| " contain line "^Last modified: ", else will be date writtend on the current |
" contain line "^\([<space><Tab>]*\)Last modified: ", |
| " line. |
" else will be date writtend on the current " line. |
| augroup HtmlCgi |
augroup HtmlCgiPHP |
| autocmd! |
autocmd! |
| " Appending right part of tag in HTML files. |
" Appending right part of tag in HTML files. |
| autocmd BufEnter *.html imap <buffer> QQ </><Esc>2F<lywf>f/pF<i |
autocmd BufEnter *.html imap <buffer> QQ </><Esc>2F<lywf>f/pF<i |
| autocmd BufWritePre,FileWritePre *.html call AutoLastMod() |
autocmd BufWritePre,FileWritePre *.html call AutoLastMod() |
| autocmd BufEnter *.cgi imap <buffer> QQ </><Esc>2F<lywf>f/pF<i |
autocmd BufEnter *.cgi imap <buffer> QQ </><Esc>2F<lywf>f/pF<i |
| autocmd BufWritePre,FileWritePre *.cgi call AutoLastMod() |
autocmd BufWritePre,FileWritePre *.cgi call AutoLastMod() |
| |
autocmd BufEnter *.php imap <buffer> QQ </><Esc>2F<lywf>f/pF<i |
| |
autocmd BufWritePre,FileWritePre *.php call AutoLastMod() |
| |
autocmd BufEnter *.php3 imap <buffer> QQ </><Esc>2F<lywf>f/pF<i |
| |
autocmd BufWritePre,FileWritePre *.php3 call AutoLastMod() |
| augroup END |
augroup END |
| " }}} |
" }}} |
| |
|
|
|
| " |
" |
| fun! LastMod(text, ...) |
fun! LastMod(text, ...) |
| mark d |
mark d |
| let line = a:text . strftime("%Y %b %d %X") " text of changed line |
let line = "\\1" . strftime("%Y %b %d %X") " text of changed line |
| let find = "g/^" . a:text " regexpr to find line |
let find = "g/" . a:text " regexpr to find line |
| let matx = "^" . a:text " ...if line was found |
let matx = a:text . ".*" " ...if line was found |
| exec find |
exec find |
| let curr_line = getline(".") |
let curr_line = getline(".") |
| if match(curr_line, matx) == 0 |
if match(curr_line, matx) == 0 |
| call setline(line("."), line) |
" call setline(line("."), line) |
| |
call setline(line("."), substitute(getline("."), matx, line, "")) |
| exec "'d" |
exec "'d" |
| endif |
endif |
| endfun |
endfun |