aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTom Ryder <tom@sanctum.geek.nz>2020-05-31 01:27:15 +1200
committerTom Ryder <tom@sanctum.geek.nz>2020-05-31 01:27:15 +1200
commit5ba79325a3ee4cb7d7217c4de3006abc51ba5f99 (patch)
tree9f3e6857d4234b6827db7a03d45132af53a57a99
parentMerge branch 'release/v9.12.0' into develop (diff)
downloaddotfiles-5ba79325a3ee4cb7d7217c4de3006abc51ba5f99.tar.gz
dotfiles-5ba79325a3ee4cb7d7217c4de3006abc51ba5f99.zip
Spin put_date.vim out into its own plugin
-rw-r--r--.gitmodules3
-rw-r--r--vim/autoload/put_date.vim24
m---------vim/bundle/put_date0
-rw-r--r--vim/plugin/put_date.vim6
4 files changed, 3 insertions, 30 deletions
diff --git a/.gitmodules b/.gitmodules
index 41920514..e892cefb 100644
--- a/.gitmodules
+++ b/.gitmodules
@@ -44,6 +44,9 @@
[submodule "vim/bundle/put_blank_lines"]
path = vim/bundle/put_blank_lines
url = https://sanctum.geek.nz/code/vim-put-blank-lines.git
+[submodule "vim/bundle/put_date"]
+ path = vim/bundle/put_date
+ url = https://sanctum.geek.nz/code/vim-put-date.git
[submodule "vim/bundle/quickfix_auto_open"]
path = vim/bundle/quickfix_auto_open
url = https://sanctum.geek.nz/code/vim-quickfix-auto-open.git
diff --git a/vim/autoload/put_date.vim b/vim/autoload/put_date.vim
deleted file mode 100644
index b0b0b548..00000000
--- a/vim/autoload/put_date.vim
+++ /dev/null
@@ -1,24 +0,0 @@
-" RFC2822 format string for strftime()
-let s:rfc_2822 = '%a, %d %b %Y %T %z'
-
-" Write a date to the buffer, UTC or local, in the specified format,
-" defaulting to RFC2822; formats are provided without the leading % signs
-" before each letter, like PHP date()
-"
-function! put_date#(line, utc, format) abort
- let line = a:line
- let utc = a:utc
- let format = strlen(a:format)
- \ ? substitute(a:format, '\a', '%&', 'g')
- \ : s:rfc_2822
- if utc
- if exists('$TZ')
- let tz = $TZ
- endif
- let $TZ = 'UTC'
- endif
- execute line.'put =strftime(format)'
- if exists('tz')
- let $TZ = tz
- endif
-endfunction
diff --git a/vim/bundle/put_date b/vim/bundle/put_date
new file mode 160000
+Subproject 598090797c2cb3a4fe945d2eacd3eca42a0cfe5
diff --git a/vim/plugin/put_date.vim b/vim/plugin/put_date.vim
deleted file mode 100644
index 7848e95f..00000000
--- a/vim/plugin/put_date.vim
+++ /dev/null
@@ -1,6 +0,0 @@
-if exists('loaded_put_date') || &compatible || !exists('*strftime')
- finish
-endif
-let loaded_put_date = 1
-command! -bang -bar -nargs=* -range PutDate
- \ call put_date#(<q-line1>, <q-bang> ==# '!', <q-args>)