aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTom Ryder <tom@sanctum.geek.nz>2019-06-10 10:18:28 +1200
committerTom Ryder <tom@sanctum.geek.nz>2019-06-10 10:18:28 +1200
commitbc6124c2dbaeb997abd418e5088583aa1c5d2b93 (patch)
treef3cad14aca22e9c36bef9207359c0d5df09b3e74
parentUse strftime() for date printing (diff)
downloaddotfiles-bc6124c2dbaeb997abd418e5088583aa1c5d2b93.tar.gz
dotfiles-bc6124c2dbaeb997abd418e5088583aa1c5d2b93.zip
Factor out date printing into function
-rw-r--r--vim/vimrc8
1 files changed, 6 insertions, 2 deletions
diff --git a/vim/vimrc b/vim/vimrc
index 57c685f9..dfd09db0 100644
--- a/vim/vimrc
+++ b/vim/vimrc
@@ -1171,6 +1171,10 @@ nnoremap <Leader>C
xnoremap <Leader>C
\ :<C-U>setlocal cursorcolumn! cursorcolumn?<CR>gv
+" Print an RFC2822-compliant date string
+command Date
+ \ put=strftime('%a, %d %b %Y %T %z')
+
" Set up a quick command-function pair to run a command with the UTC timezone,
" in this case, for my date-printing mappings. Is there a nicer way to do
" this? I couldn't find one.
@@ -1186,10 +1190,10 @@ command -complete=command -nargs=1 UTC
" Leader,d inserts the local date (RFC 2822)
nnoremap <Leader>d
- \ :<C-U>put=strftime('%a, %d %b %Y %T %z')<CR>
+ \ :<C-U>Date<CR>
" Leader,D inserts the UTC date (RFC 2822)
nnoremap <Leader>D
- \ :<C-U>UTC put=strftime('%a, %d %b %Y %T %z')<CR>
+ \ :<C-U>UTC Date<CR>
" Leader,e forces a buffer to be editable
nnoremap <Leader>e