]> gitweb.fluxo.info Git - rhatto/dotfiles/vim.git/commitdiff
Feat: shortcut to insert current date
authorSilvio Rhatto <rhatto@riseup.net>
Sun, 28 Jul 2024 21:45:28 +0000 (18:45 -0300)
committerSilvio Rhatto <rhatto@riseup.net>
Sun, 28 Jul 2024 21:45:28 +0000 (18:45 -0300)
vim.dot.link/plugin/key_mappings.vim
vim.dot.link/plugin/lib.vim

index 1b297f60f2e6dbc0ffdc8356952241b9771f3664..bde9e08fe2140dfed2ae7066a3d450952ba6bde8 100644 (file)
@@ -212,3 +212,13 @@ vmap <Leader>I <Plug>(simple-todo-new-list-item-start-of-line)
 vmap <Leader>X <Plug>(simple-todo-mark-as-undone)
 vmap <Leader>x <Plug>(simple-todo-mark-as-done)
 vmap <Leader>s <Plug>(simple-todo-mark-switch)
+
+" From lib.vim
+"nnoremap <Leader>c :call ToggleCheckbox()<CR>
+
+" Insert the current date in ISO format
+"
+" Thanks https://vimtricks.com/p/insert-the-current-date-or-time/
+"map <leader>d :0put =strftime('%Y-%m-%d')<CR>
+nnoremap <leader>d i<C-R>=strftime('%Y-%m-%d')<CR>
+inoremap <leader>d <C-R>=strftime('%Y-%m-%d')<CR>
index 7e71c6f42f678bc39a74181f7107c4c0dc85325c..0e4cafadc6cc9ab0b06671e698a6b09ad4c77181 100644 (file)
@@ -5,6 +5,8 @@
 
 " Checkbox handling
 "
+" This is commented out because vitalk/vim-simple-todo is being used instead.
+"
 " Thanks https://www.reddit.com/r/vim/comments/slqsao/readymade_solution_for_handling_markdown/
 "function! ToggleCheckbox()
 "  let line = getline('.')
@@ -17,5 +19,3 @@
 "    call setline('.', substitute(line, '- ', '- \[ \] ', ''))
 "  endif
 "endf
-"
-"nnoremap <Leader>c :call ToggleCheckbox()<CR>