--- @type tNotaConfiguration -- @field [nota_home] string the location of your notes. All other paths will be relative to this. Defaults to $XDG_DATA_HOME/nota or ~/.local/share/nota -- @field [default_keybinds] boolean whether to use the default key bindings or not. Defaults to true. -- @field [periodic_locations] tPeriodicLocationsConfiguration (optional) the location of periodic notes. -- @field [templates] tTemplatesConfiguration (optional) the location of templates for periodic notes. -- @field [tasks] tTasksConfiguration (optional) configuration for task tools -- @field [learning] tLearningConfiguration (optional) configuration for learning tools -- @field [plan] tPlanConfiguration (optional) configuration for .plan file tools --- @type tPeriodicLocationsConfiguration -- @field [daily] string (optional) the location where daily notes are stored relative to nota_home. Defaults to periodic/daily. -- @field [weekly] string (optional) the location where weekly notes are stored relative to nota_home. Defaults to periodic/weekly. -- @field [monthly] string (optional) the location where monthly notes are stored relative to nota_home. Defaults to periodic/monthly. -- @field [seasonal] string (optional) the location where seasonal notes are stored relative to nota_home. Defaults to periodic/seasonal. -- @field [yearly] string (optional) the location where yearly notes are stored relative to nota_home. Defaults to periodic/yearly. --- @type tTemplatesConfiguration -- @field [daily] string (optional) the location to the daily note template file relative to nota_home. Defaults to templates/daily.md -- @field [weekly] string (optional) the location to the weekly note template file relative to nota_home. Defaults to templates/weekly.md -- @field [monthly] string (optional) the location to the monthly note template file relative to nota_home. Defaults to templates/monthly.md -- @field [seasonal] string (optional) the location to the seasonal note template file relative to nota_home. Defaults to templates/seasonal.md -- @field [yearly] string (optional) the location to the seasonal note template file relative to nota_home. Defaults to templates/yearly.md -- @field [plan] string (optional) the location to the plan template file relative to nota_home. Defaults to templates/plan.md --- @type tTasksConfiguration -- @field [inbox] string (optional) the location of the inbox for capturing tasks relative to nota_home. Default is "inbox.md" -- @field [someday] string (optional) the location of the inbox for indefinitely deferred tasks relative to nota_home. Default is "someday.md" --- @type tLearningConfiguration -- @field [learning_file] string (optional) the location of the learning file for capturing entries relative to nota_home. Default is "learning.md" -- @field [prefix] string (optional) the prefix to add when capturing learning entries. Default is "%Y-%m-%d: " --- @type tPlanConfiguration -- @field [archive] string (optional) the location of the plan archive relative to nota_home. Default is "plans" -- @field [plan_file] string (optional) the location of the active plan file. Default is "~/.plan" --- Sets up the Nota commands and keybins -- @param user_configuration tNotaConfiguration the user provided configuration for the plugin local api = vim.api local fs = vim.loop local fn = vim.fs if not api.nvim_create_user_command then return end local command = api.nvim_create_user_command local configuration = require('configuration').configuration if configuration.default_keybinds then require('keybinds').bind() end -- Note Handling Commands command('NotaOpenDailyNote', function() require('notes').open_daily() end, { nargs = 0 }) command('NotaOpenWeeklyNote', function() require('notes').open_weekly() end, { nargs = 0 }) command('NotaOpenMonthlyNote', function() require('notes').open_monthly() end, { nargs = 0 }) command('NotaOpenSeasonalNote', function() require('notes').open_seasonal() end, { nargs = 0 }) command('NotaOpenYearlyNote', function() require('notes').open_yearly() end, { nargs = 0 }) command('NotaOpenNote', function() require('notes').open() end, { nargs = 0 }) -- Task View Handling Commands command('NotaOpenAgenda', function() require('task_views').open_agenda() end, { nargs = 0 }) command('NotaOpenOpen', function() require('task_views').open_open() end, { nargs = 0 }) command('NotaOpenOpenImportant', function() require('task_views').open_open_important() end, { nargs = 0 }) command('NotaOpenJournal', function() require('task_views').open_journal() end, { nargs = 0 }) -- Task Handling Commands command('NotaToggleTask', function() require('tasks').toggle() end, { nargs = 0 }) command('NotaToggleTaskImportance', function() require('tasks').toggle_importance() end, { nargs = 0 }) command('NotaInsertTask', function() require('tasks').insert() end, { nargs = 0 }) command('NotaCaptureTask', function() require('tasks').capture() end, { nargs = 0 }) command('NotaTagTask', function() require('tasks').tag() end, { nargs = 0 }) command('NotaRescheduleTaskToday', function() require('tasks').reschedule_for_today() end, { nargs = 0 }) command('NotaRescheduleTaskTomorrow', function() require('tasks').reschedule_for_tomorrow() end, { nargs = 0 }) command('NotaRescheduleTaskSomeday', function() require('tasks').reschedule_for_someday() end, { nargs = 0 }) command('NotaRescheduleTask', function(options) require('tasks').reschedule(options.args) end, { nargs = 1 }) -- .plan Handling Commands command('NotaOpenPlan', function() require('plan').open() end, { nargs = 0 }) command('NotaCapturePlan', function() require('plan').capture() end, { nargs = 0 }) -- Learning File Handling Commands command('NotaOpenLearning', function() require('learning').open() end, { nargs = 0 }) command('NotaCaptureLearning', function() require('learning').capture() end, { nargs = 0 })