From 2a5476d79b9db791200a8d38ac7fd552aff46783 Mon Sep 17 00:00:00 2001 From: Silvio Rhatto Date: Sun, 28 Jul 2024 18:45:28 -0300 Subject: Feat: shortcut to insert current date --- vim.dot.link/plugin/key_mappings.vim | 10 ++++++++++ vim.dot.link/plugin/lib.vim | 4 ++-- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/vim.dot.link/plugin/key_mappings.vim b/vim.dot.link/plugin/key_mappings.vim index 1b297f6..bde9e08 100644 --- a/vim.dot.link/plugin/key_mappings.vim +++ b/vim.dot.link/plugin/key_mappings.vim @@ -212,3 +212,13 @@ vmap I (simple-todo-new-list-item-start-of-line) vmap X (simple-todo-mark-as-undone) vmap x (simple-todo-mark-as-done) vmap s (simple-todo-mark-switch) + +" From lib.vim +"nnoremap c :call ToggleCheckbox() + +" Insert the current date in ISO format +" +" Thanks https://vimtricks.com/p/insert-the-current-date-or-time/ +"map d :0put =strftime('%Y-%m-%d') +nnoremap d i=strftime('%Y-%m-%d') +inoremap d =strftime('%Y-%m-%d') diff --git a/vim.dot.link/plugin/lib.vim b/vim.dot.link/plugin/lib.vim index 7e71c6f..0e4cafa 100644 --- a/vim.dot.link/plugin/lib.vim +++ b/vim.dot.link/plugin/lib.vim @@ -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 c :call ToggleCheckbox() -- cgit v1.2.3