aboutsummaryrefslogtreecommitdiffstats
path: root/bundle/date/autoload/date.vim
diff options
context:
space:
mode:
Diffstat (limited to 'bundle/date/autoload/date.vim')
-rw-r--r--bundle/date/autoload/date.vim12
1 files changed, 12 insertions, 0 deletions
diff --git a/bundle/date/autoload/date.vim b/bundle/date/autoload/date.vim
new file mode 100644
index 0000000..3c86507
--- /dev/null
+++ b/bundle/date/autoload/date.vim
@@ -0,0 +1,12 @@
+" Insert the current date in the format "2021.10.01" after the cursor.
+function! date#Insert(separator)
+ let separator = '.'
+
+ if a:separator != ''
+ let separator = a:separator
+ endif
+
+ let date = strftime('%Y' . separator . '%m' . separator . '%d')
+
+ execute 'normal! a' . date . "\<Esc>"
+endfunction