Skip to content

Instantly share code, notes, and snippets.

@njpearman
Created June 28, 2020 14:23
Show Gist options
  • Save njpearman/95d0d2bed23f421527553a1307224c66 to your computer and use it in GitHub Desktop.
Save njpearman/95d0d2bed23f421527553a1307224c66 to your computer and use it in GitHub Desktop.
VimScript journal opener
" My first super-simple and hardcoded bit of VimScript
" that opens up a markdown-based journal file
function! JournalToday()
let filename = strftime("~/journal/%Y-%m-%d.markdown")
echo "Opened journal: " . filename
execute "vsplit" filename
endfunction
" executing a function is literal: enter command-line mode, enter call and the
" function name, and press return
nnoremap <leader>jt :call JournalToday()<CR>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment