diff options
author | Tom Ryder <tom@sanctum.geek.nz> | 2019-06-10 10:22:15 +1200 |
---|---|---|
committer | Tom Ryder <tom@sanctum.geek.nz> | 2019-06-10 10:22:15 +1200 |
commit | c505e7a735a3a4c1a0b579487a24f233bde47632 (patch) | |
tree | e2c3e70b2aa4a9069717cfd8ae446bb187fe7782 | |
parent | Merge branch 'release/v5.29.0' (diff) | |
parent | Bump VERSION (diff) | |
download | dotfiles-5.30.0.tar.gz (sig) dotfiles-5.30.0.zip |
Merge branch 'release/v5.30.0'v5.30.0
* release/v5.30.0:
Inline a set-run-restore command triplet
Document what appears to be a Vim v8.1 bug
Rename Date() to PutDate() to make func clearer
Factor out date printing into function
Use strftime() for date printing
Arrange abbreviations in columns
-rw-r--r-- | VERSION | 4 | ||||
-rw-r--r-- | vim/vimrc | 46 |
2 files changed, 35 insertions, 15 deletions
@@ -1,2 +1,2 @@ -tejr dotfiles v5.29.0 -Sun Jun 9 20:59:12 UTC 2019 +tejr dotfiles v5.30.0 +Sun Jun 9 22:22:15 UTC 2019 @@ -1171,12 +1171,32 @@ nnoremap <Leader>C xnoremap <Leader>C \ :<C-U>setlocal cursorcolumn! cursorcolumn?<CR>gv -" Leader,d inserts the local date (POSIX date) +" Print an RFC2822-compliant date string +command PutDate + \ 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. +" +" This presently seems to be broken in v8.1.1487; the timezone first chosen +" seems to 'stick' permanently. I haven't worked out why yet. Using the new +" getenv() and setenv() functions does not seem to fix it. It works fine in +" Debian GNU/Linux's packaged v8.0.x. +" +function! UTC(command) abort + let tz = expand('$TZ') + let $TZ = 'UTC' | execute a:command | let $TZ = tz +endfunction +command -complete=command -nargs=1 UTC + \ call UTC(<q-args>) + +" Leader,d inserts the local date (RFC 2822) nnoremap <Leader>d - \ :read !date<CR> -" Leader,D inserts the UTC date (POSIX date) + \ :<C-U>PutDate<CR> +" Leader,D inserts the UTC date (RFC 2822) nnoremap <Leader>D - \ :read !date -u<CR> + \ :<C-U>UTC PutDate<CR> " Leader,e forces a buffer to be editable nnoremap <Leader>e @@ -1393,12 +1413,12 @@ nnoremap <Leader><Tab> \ :<C-U>setlocal autoindent! autoindent?<CR> " Some useful abbreviations -inoreabbrev tr@ tom@sanctum.geek.nz -inoreabbrev tr/ <https://sanctum.geek.nz/> - -" Things I almsot always type wrnog -inoreabbrev almsot almost -inoreabbrev wrnog wrong -inoreabbrev Fielding Feilding -inoreabbrev THe The -inoreabbrev THere There +inoreabbrev tr@ tom@sanctum.geek.nz +inoreabbrev tr/ <https://sanctum.geek.nz/> + +" THe things I almsot always type wrnog +inoreabbrev almsot almost +inoreabbrev wrnog wrong +inoreabbrev Fielding Feilding +inoreabbrev THe The +inoreabbrev THere There |