aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSilvio Rhatto <rhatto@riseup.net>2024-07-28 18:45:28 -0300
committerSilvio Rhatto <rhatto@riseup.net>2024-07-28 18:45:28 -0300
commit2a5476d79b9db791200a8d38ac7fd552aff46783 (patch)
tree481a1b55d9147f187cc815f678da61d54beea922
parenta91d756f65f67f53de78385b660b1345c60d575f (diff)
downloadvim-2a5476d79b9db791200a8d38ac7fd552aff46783.tar.gz
vim-2a5476d79b9db791200a8d38ac7fd552aff46783.tar.bz2
Feat: shortcut to insert current date
-rw-r--r--vim.dot.link/plugin/key_mappings.vim10
-rw-r--r--vim.dot.link/plugin/lib.vim4
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 <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>
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 <Leader>c :call ToggleCheckbox()<CR>