]> git.rmz.io Git - dotfiles.git/commitdiff
vim/org: simple function to insert journal entry
authorSamir Benmendil <me@rmz.io>
Sat, 14 Jan 2023 01:19:01 +0000 (01:19 +0000)
committerSamir Benmendil <me@rmz.io>
Sat, 14 Jan 2023 02:35:28 +0000 (02:35 +0000)
vim/ftplugin/org.vim

index 0d870b1f4a6971fde01a65627a19c4bc041fc009..bdbcb73c4f8055b67710904b2e978e5ee4335075 100644 (file)
@@ -1,2 +1,9 @@
 setlocal textwidth=80
 setlocal formatoptions+=aw
+
+function! s:insert_journal_entry()
+    exe 'normal! O**** ['.strftime('%Y-%m-%d %a %H:%M').'] - '
+endf
+
+"TODO only in journal.org
+inoremap <buffer> <silent> <C-CR> <CR><Esc>:call <SID>insert_journal_entry()<CR>a