scy, to vim
@scy@chaos.social avatar

My #Vim (and #Neovim) can now insert the current date or time using mappings like "<C-R><Leader>d". This is consistent with other Ctrl-R mappings like "<C-R>%" which will insert the current file name.

This was inspired by @blaix's post https://hachyderm.io/@blaix/112576852666967922 (commit https://github.com/blaix/homer/commit/9f774be9be0ebd1fe01040257a7f8ce9e8dca5c1), but I've chosen a more general approach that will also work when you already are in insert mode, and also in command-line mode.

https://codeberg.org/scy/dotfiles/src/commit/c02b23d71374d2aaecc0e43a4f0921b76b18391c/.vim/plugin/datetimereg.vim

  • All
  • Subscribed
  • Moderated
  • Favorites
  • JUstTest
  • thenastyranch
  • magazineikmin
  • mdbf
  • GTA5RPClips
  • everett
  • rosin
  • Youngstown
  • tacticalgear
  • slotface
  • ngwrru68w68
  • kavyap
  • DreamBathrooms
  • khanakhh
  • megavids
  • tester
  • ethstaker
  • cubers
  • osvaldo12
  • cisconetworking
  • Durango
  • InstantRegret
  • normalnudes
  • Leos
  • modclub
  • anitta
  • provamag3
  • lostlight
  • All magazines