1 -------------------------------------------------------------------------------
2 -- Tools to deal with the learning file
3 -------------------------------------------------------------------------------
6 local Configuration = require('nota.configuration')
7 local Util = require('nota.util')
8 -------------------------------------------------------------------------------
10 -------------------------------------------------------------------------------
11 -------------------------------------------------------------------------------
13 -------------------------------------------------------------------------------
15 --- Opens the learning file
16 function Learning.open()
17 local learning_path = Configuration.path_for(Configuration.configuration.learning.learning_file)
18 local learning_parent = Util.directory_name(learning_path)
19 Util.ensure_directory_exists(learning_parent)
20 vim.cmd('edit ' .. learning_path)
23 --- Capture a learning entry
24 function Learning.capture()
25 local prefix = os.date(Configuration.configuration.learning.prefix)
27 vim.cmd('normal! ggO'..prefix)
28 vim.cmd('startinsert!')