diff options
author | Tom Ryder <tom@sanctum.geek.nz> | 2020-01-03 03:39:57 +1300 |
---|---|---|
committer | Tom Ryder <tom@sanctum.geek.nz> | 2020-01-03 03:39:57 +1300 |
commit | eb84b7edd1f6b2bf868bd7190671286d08f93a28 (patch) | |
tree | 9089bb26b1920670c67cc9e9762e37f1cef13e03 | |
parent | Rename and move HTML URL anchoring (diff) | |
download | dotfiles-eb84b7edd1f6b2bf868bd7190671286d08f93a28.tar.gz dotfiles-eb84b7edd1f6b2bf868bd7190671286d08f93a28.zip |
Remove duplicate function definitions
-rw-r--r-- | vim/autoload/html.vim | 46 |
1 files changed, 0 insertions, 46 deletions
diff --git a/vim/autoload/html.vim b/vim/autoload/html.vim index c93c0b8e..2ce5288d 100644 --- a/vim/autoload/html.vim +++ b/vim/autoload/html.vim @@ -4,49 +4,3 @@ function! html#Tidy() abort %!tidy -quiet call winrestview(view) endfunction - -let s:formats = { - \ 'human': '%a, %d %b %Y %T %Z', - \ 'machine': '%Y-%m-%dT%H:%M:%S.000Z', - \} - -function! s:Timestamp(time) abort - if exists('$TZ') - let tz = $TZ - endif - let $TZ = 'UTC' - let time = localtime() - let timestamp = {} - for key in keys(s:formats) - let timestamp[key] = strftime(s:formats[key], time) - endfor - if exists('tz') - let $TZ = tz - endif - return timestamp -endfunction - -let s:pattern = '\m\C' - \.'Last updated: ' - \.'<time datetime="[^"]\+">' - \.'[^<]\+' - \.'</time>' - -" Update a timestamp -function! html#TimestampUpdate() abort - if !&modified - return - endif - let lnum = search(s:pattern, 'nw') - if !lnum - return - endif - let timestamp = s:Timestamp(localtime()) - let update = 'Last updated: ' - \.'<time datetime="'.timestamp['machine'].'">' - \.timestamp['human'] - \.'</time>' - let line = getline(lnum) - let line = substitute(line, s:pattern, update, '') - call setline(lnum, line) -endfunction |