aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTom Ryder <tom@sanctum.geek.nz>2019-12-30 17:37:38 +1300
committerTom Ryder <tom@sanctum.geek.nz>2019-12-30 17:37:38 +1300
commite0714a6cca119ed9300bd9906ef9026313a8c780 (patch)
tree76c146aed74cc5538003baa64a156f56261ad4dd
parentAdd some comments (diff)
downloaddotfiles-e0714a6cca119ed9300bd9906ef9026313a8c780.tar.gz
dotfiles-e0714a6cca119ed9300bd9906ef9026313a8c780.zip
Put a common string into a variable
-rw-r--r--vim/autoload/html/timestamp.vim7
1 files changed, 5 insertions, 2 deletions
diff --git a/vim/autoload/html/timestamp.vim b/vim/autoload/html/timestamp.vim
index 871a800f..081d92bc 100644
--- a/vim/autoload/html/timestamp.vim
+++ b/vim/autoload/html/timestamp.vim
@@ -33,9 +33,12 @@ function! s:Timestamp(time) abort
endfunction
+" Define timestamp prefix string
+let s:prefix = 'Last updated: '
+
" Define pattern to match date timestamps; no Z̷͖̟̩͕̊̇̈ͬ̆̄Á̩̺͙̫͇͔̓͛ͭ̓̈́L̟͘G̤̣̳̊̌O̻̝̣̠͇̥̠͗ͤ͐͘ please
let s:pattern = '\m\C'
- \.'Last updated: '
+ \.s:prefix
\.'<time datetime="[^"]\+">'
\.'[^<]\+'
\.'</time>'
@@ -58,7 +61,7 @@ function! html#timestamp#Update() abort
let timestamp = s:Timestamp(localtime())
" Fill out updated timestamp string with dictionary values
- let update = 'Last updated: '
+ let update = s:prefix
\.'<time datetime="'.timestamp['machine'].'">'
\.timestamp['human']
\.'</time>'