Agenda Mode updates and sorting + <leader>a

This commit is contained in:
Lüdecke Sascha
2026-09-28 09:52:20 +02:00
parent 8258f31107
commit 4b22a7504c
3 changed files with 48 additions and 5 deletions

View File

@@ -56,7 +56,7 @@ require("lazy").setup({
--
['<CR>'] = { 'select_and_accept', 'fallback' },
-- ['<C-space>'] = { 'select_next', 'show_and_insert', 'fallback' },
['<C-space>'] = { function(cmp) cmp.show({ providers = { 'lsp' } }) end },
['<C-space>'] = { function(cmp) cmp.show({ providers = { 'lsp' } }) end },
},
signature = { enabled = true },
@@ -193,7 +193,7 @@ require("lazy").setup({
-- Setup orgmode
require('orgmode').setup({
win_split_mode = '0tabnew',
org_log_done = false,
-- org_log_done = false,
-- cf: https://github.com/nvim-orgmode/orgmode/blob/master/docs/configuration.org#mappings
mappings = {
org = {
@@ -203,13 +203,46 @@ require("lazy").setup({
org_demote_subtree = { '>s', '<C-M-Right>' },
}
},
org_agenda_hide_empty_blocks = true,
org_agenda_custom_commands = {
-- "c" is the shortcut that will be used in the prompt
c = {
description = 'Combined view', -- Description shown in the prompt for the shortcut
types = {
{
type = 'tags_todo', -- Type can be agenda | tags | tags_todo
match = '+PRIORITY="A"', --Same as providing a "Match:" for tags view <leader>oa + m, See: https://orgmode.org/manual/Matching-tags-and-properties.html
org_agenda_overriding_header = 'High prio todos',
org_agenda_todo_ignore_deadlines = 'far', -- Ignore all deadlines that are too far in future (over org_deadline_warning_days). Possible values: all | near | far | past | future
org_agenda_sorting_strategy = { 'tag-up', 'todo-state-down', 'priority-down' } -- See all options available on org_agenda_sorting_strategy
},
{
type = 'agenda',
org_agenda_overriding_header = 'Agenda 10 days',
org_agenda_span = 10, -- 'week' is default, so it's not necessary here, just an example
-- org_agenda_start_on_weekday = 1, -- Start on Monday
-- org_agenda_start_on_weekday = false, -- Start today
-- org_agenda_remove_tags = true -- Do not show tags only for this view
org_agenda_sorting_strategy = { 'time-up', 'tag-up', 'todo-state-down', 'priority-down' } -- See all options available on org_agenda_sorting_strategy
},
{
type = 'tags_todo',
match = '-PRIORITY="A"', --Same as providing a "Match:" for tags view <leader>oa + m, See: https://orgmode.org/manual/Matching-tags-and-properties.html
org_agenda_overriding_header = 'Normal prio todos',
org_agenda_sorting_strategy = { 'tag-up', 'todo-state-down', 'priority-down' }, -- See all options available on org_agenda_sorting_strategy
-- org_agenda_todo_ignore_scheduled = 'all', -- Ignore all headlines that are scheduled. Possible values: past | future | all
},
}
},
},
-- org_agenda_files = '~/orgfiles/**/*',
-- org_default_notes_file = '~/orgfiles/refile.org',
org_agenda_files = sl_opt.org_agenda_files,
org_default_notes_file = sl_opt.org_default_notes_file,
org_archive_location = sl_opt.org_archive_location,
org_capture_templates = {
t = { description = 'Task', template = "* TODO %u %?" },
t = { description = 'Task', template = "* TODO %u %?\n SCHEDULED: %^{Due date}t" },
i = { description = 'Interruption', template = "* STARTED [#A] %^{Working on}\n %U\n %a\n" },
},
org_todo_keywords = { 'TODO(t)', 'STARTED(s)', 'PLANNED(p)', '|', 'DONE(d)', 'UNPLANNED(u)' },
@@ -235,6 +268,16 @@ require("lazy").setup({
},
})
vim.api.nvim_create_autocmd('ColorScheme', {
pattern = '*',
callback = function()
-- Define own colors
-- color updates
vim.api.nvim_set_hl(0, '@org.agenda.weekend', { fg = '#aaaaaa' })
vim.api.nvim_set_hl(0, '@org.agenda.day', { fg = '#eeeeee' })
end
})
-- NOTE: If you are using nvim-treesitter with ~ensure_installed = "all"~ option
-- add ~org~ to ignore_install
-- require('nvim-treesitter.configs').setup({