X-Git-Url: https://git.r.bdr.sh/rbdr/nota.nvim/blobdiff_plain/56292c7915662bbf721ca8c3d2cee6a04134a9c6..503d09fc95a47c13141d097cf80dd243d1dce342:/plugin/nota.lua diff --git a/plugin/nota.lua b/plugin/nota.lua index 4e62170..9c6e419 100644 --- a/plugin/nota.lua +++ b/plugin/nota.lua @@ -36,51 +36,51 @@ --- Sets up the Nota commands and keybins -- @param user_configuration tNotaConfiguration the user provided configuration for the plugin -function setup(user_configuration) - local api = vim.api - local fs = vim.loop - local fn = vim.fs +local api = vim.api +local fs = vim.loop +local fn = vim.fs - if not api.nvim_create_user_command then - return - end +if not api.nvim_create_user_command then + return +end - local command = api.nvim_create_user_command +local command = api.nvim_create_user_command - local configuration = require('configuration').configure(user_configuration) +local configuration = require('configuration').configuration - if configuration.default_keybinds then - local configuration = require('keybinds').bind() - end +if configuration.default_keybinds then + require('keybinds').bind() +end - -- Note Handling Commands - command('NotaOpenDailyNote', function() require('notes').open_daily(configuration) end, { nargs = 0 }) - command('NotaOpenWeeklyNote', function() require('notes').open_weekly(configuration) end, { nargs = 0 }) - command('NotaOpenMonthlyNote', function() require('notes').open_monthly(configuration) end, { nargs = 0 }) - command('NotaOpenSeasonalNote', function() require('notes').open_seasonal(configuration) end, { nargs = 0 }) - command('NotaOpenYearlyNote', function() require('notes').open_yearly(configuration) end, { nargs = 0 }) - command('NotaOpenNote', function() require('notes').open(configuration) end, { nargs = 0 }) +-- 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(configuration) end, { nargs = 0 }) - command('NotaOpenOpen', function() require('task_views').open_open(configuration) end, { nargs = 0 }) - command('NotaOpenJournal', function() require('task_views').open_journal(configuration) 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(configuration) end, { nargs = 0 }) - command('NotaInsertTask', function() require('tasks').insert(configuration) end, { nargs = 0 }) - command('NotaCaptureTask', function() require('tasks').capture(configuration) end, { nargs = 0 }) - command('NotaTagTask', function() require('tasks').tag(configuration) end, { nargs = 0 }) - command('NotaRescheduleTaskToday', function() require('tasks').reschedule_for_today(configuration) end, { nargs = 0 }) - command('NotaRescheduleTaskTomorrow', function() require('tasks').reschedule_for_tomorrow(configuration) end, { nargs = 0 }) - command('NotaRescheduleTaskSomeday', function() require('tasks').reschedule_for_someday(configuration) end, { nargs = 0 }) - command('NotaRescheduleTask', function(options) require('tasks').reschedule(configuration, options.args) end, { nargs = 1 }) +-- 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(configuration) end, { nargs = 0 }) - command('NotaCapturePlan', function() require('plan').capture(configuration) end, { nargs = 0 }) +-- .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(configuration) end, { nargs = 0 }) - command('NotaCaptureLearning', function() require('learning').capture(configuration) end, { nargs = 0 }) -end +-- Learning File Handling Commands +command('NotaOpenLearning', function() require('learning').open() end, { nargs = 0 }) +command('NotaCaptureLearning', function() require('learning').capture() end, { nargs = 0 })