Agenda Mode updates and sorting + <leader>a
This commit is contained in:
@@ -83,7 +83,7 @@ dashboard.section.header.val = vim.split(adjustedLogo, '\n')
|
|||||||
local buttons = {
|
local buttons = {
|
||||||
dashboard.button('n', ' New file', ':ene <BAR> startinsert <CR>'),
|
dashboard.button('n', ' New file', ':ene <BAR> startinsert <CR>'),
|
||||||
dashboard.button('s', ' Settings', '<cmd>WorkspacesOpen config-nvim<CR>'),
|
dashboard.button('s', ' Settings', '<cmd>WorkspacesOpen config-nvim<CR>'),
|
||||||
dashboard.button('a', ' Agenda & TODOs', '<cmd>Org agenda t<CR>'),
|
dashboard.button('a', ' Agenda & TODOs', '<cmd>Org agenda c<CR>'),
|
||||||
dashboard.button('u', ' Update plugins', '<cmd>Lazy update<CR>'),
|
dashboard.button('u', ' Update plugins', '<cmd>Lazy update<CR>'),
|
||||||
dashboard.button('w', ' Workspaces', '<cmd>WorkspacesOpen<CR>'),
|
dashboard.button('w', ' Workspaces', '<cmd>WorkspacesOpen<CR>'),
|
||||||
dashboard.button('q', ' Quit', '<cmd>qa<CR>'),
|
dashboard.button('q', ' Quit', '<cmd>qa<CR>'),
|
||||||
|
|||||||
@@ -43,7 +43,7 @@ vim.keymap.set('n', '<leader>of',
|
|||||||
})
|
})
|
||||||
end,
|
end,
|
||||||
{ desc = "Open org folder" })
|
{ desc = "Open org folder" })
|
||||||
vim.keymap.set('n', '<leader>a', ':silent Org agenda t<cr>', { desc = "Org Agenda" })
|
vim.keymap.set('n', '<leader>a', ':silent Org agenda c<cr>', { desc = "Org Agenda" })
|
||||||
vim.keymap.set('n', '<leader>Q', ':silent Org capture t<cr>', { desc = "Org new TODO"})
|
vim.keymap.set('n', '<leader>Q', ':silent Org capture t<cr>', { desc = "Org new TODO"})
|
||||||
vim.keymap.set('n', '<leader>q', ':silent Org capture i<cr>', { desc = "Org new interruption" })
|
vim.keymap.set('n', '<leader>q', ':silent Org capture i<cr>', { desc = "Org new interruption" })
|
||||||
|
|
||||||
|
|||||||
@@ -56,7 +56,7 @@ require("lazy").setup({
|
|||||||
--
|
--
|
||||||
['<CR>'] = { 'select_and_accept', 'fallback' },
|
['<CR>'] = { 'select_and_accept', 'fallback' },
|
||||||
-- ['<C-space>'] = { 'select_next', 'show_and_insert', '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 },
|
signature = { enabled = true },
|
||||||
|
|
||||||
@@ -193,7 +193,7 @@ require("lazy").setup({
|
|||||||
-- Setup orgmode
|
-- Setup orgmode
|
||||||
require('orgmode').setup({
|
require('orgmode').setup({
|
||||||
win_split_mode = '0tabnew',
|
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
|
-- cf: https://github.com/nvim-orgmode/orgmode/blob/master/docs/configuration.org#mappings
|
||||||
mappings = {
|
mappings = {
|
||||||
org = {
|
org = {
|
||||||
@@ -203,13 +203,46 @@ require("lazy").setup({
|
|||||||
org_demote_subtree = { '>s', '<C-M-Right>' },
|
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_agenda_files = '~/orgfiles/**/*',
|
||||||
-- org_default_notes_file = '~/orgfiles/refile.org',
|
-- org_default_notes_file = '~/orgfiles/refile.org',
|
||||||
org_agenda_files = sl_opt.org_agenda_files,
|
org_agenda_files = sl_opt.org_agenda_files,
|
||||||
org_default_notes_file = sl_opt.org_default_notes_file,
|
org_default_notes_file = sl_opt.org_default_notes_file,
|
||||||
org_archive_location = sl_opt.org_archive_location,
|
org_archive_location = sl_opt.org_archive_location,
|
||||||
org_capture_templates = {
|
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" },
|
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)' },
|
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
|
-- NOTE: If you are using nvim-treesitter with ~ensure_installed = "all"~ option
|
||||||
-- add ~org~ to ignore_install
|
-- add ~org~ to ignore_install
|
||||||
-- require('nvim-treesitter.configs').setup({
|
-- require('nvim-treesitter.configs').setup({
|
||||||
|
|||||||
Reference in New Issue
Block a user