Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WIP: GTD Base Features #60

Merged
merged 96 commits into from
Sep 8, 2021
Merged

WIP: GTD Base Features #60

merged 96 commits into from
Sep 8, 2021

Conversation

danymat
Copy link
Member

@danymat danymat commented Aug 8, 2021

This is the first iteration of GTD base features:

  • Specifying a workplace for gtd
  • Creating GTD Capture Workflow
    • Created a UI for capturing a task
    • The task captured is written in an inbox.norg file
    • Created a Neorg command for it : Neorg gtd capture
    • Created a keybinding for it: gtda (will probably be deleted/modified)
    • Use a popup with quick selection
  • Fields specification for a task like This is a task @ExampleContext +"Example Project"
    • Support for contexts (e.g @home)
    • Support for project (+"this is a project")
    • Support for due dates (e.g $due:tomorrow with today, tomorrow, $d, $m, $w, and any date with format YY-mm-dd recognized. $ is treated as number, for example 10d is 10 days from now)
    • Support for start dates (same syntax as due dates, but starting with $start:)
    • Support for note (e.g $note:"this is a note")
  • Operations on tasks
    • Moving tasks between projects/.norg files
    • Adding tasks after specific projects

In order to test the implementation:

  1. Use the forked repo:
    use {
        'danymat/neorg',
        requires = "nvim-lua/plenary.nvim",
        branch = "gtd_base"
    }
  1. Configure Neorg by enabling the required modules
require('neorg').setup {
    load = {
        ["core.defaults"] = {},
        ["core.keybinds"] = { -- REQUIRED FOR GTD
            config = {
                default_keybinds = true,
                neorg_leader = "<Leader>o"
            }
        },
        ["core.norg.concealer"] = {}, -- Allows for use of icons
        ["core.norg.dirman"] = { -- REQUIRED FOR GTD
            config = {
                workspaces = {
                    main = "~/neorg",
                    gtd = "~/gtd"
                }
            }
        },
        ["core.gtd.base"] = { -- REQUIRED FOR GTD
            config = { workspace = "gtd" }
        },
        ["core.ui"] = {}, -- REQUIRED FOR GTD
    }
}

danymat and others added 23 commits August 8, 2021 10:49
This is the first commit for a GTD module focusing on the full
specifications of the process.
At the moment it just creates the GTD
module with a custom function add_task_to_inbox(), which will hopefully start an
UI in order to insert the task to inbox.
I use core.ui to generate the prompt asking the user to add the task to
the inbox list.
Still there are some issues regarding core.ui:
    - after <CR>, the buffer keeps asking for an other user input.
    - If if press <C-c>, the buffer seems to close but the callback
      doesn't start
Divided documentation in USAGE/KEYBINDS/REQUIRES following the best
practices
This is the start of command capabilities for gtd. At the moment it
supports :Neorg gtd capture, which will call the funciton
add_task_to_inbox()
At the moment it only defines the command, since i'm waiting for a
function to open a file.
I defined a new function called open_file() in dirman, and used it to
open the list when :Neorg gtd list inbox is called
At the moment it supports the syntax discussed in nvim-neorg#61

For example:

This is a task @home +"This is a project"

will be written in inbox as:

* This is a project
** home
- [ ] This is a task
I forgot to add the - [ ], before the task content
The due date support is done via $due:..., with ... being one of the following ($ treated as number):

- $d: days from now (e.g 2d is 2 days from now)
- $w: weeks from now (e.g 2w is 2 weeks from now)
- $m: months from now (e.g 2m is 2 months from now)
- tomorrow: tomorrow's date
- today: today's date
- Any date with the format specified below
The format for date is YY-mm-dd
I added the support for start dates, with the same syntax as due dates.

Futhermore, I refactored the finders to be only one function doing all,
and the syntax is specified in module.private.syntax
Instead of calling the function for each syntax, i iterated through
them, which is better for lisibility
    - Add temporary `:Neorg gtd select_date` command to test the new
      selection system
    - Make capture popups close on `<CR>`
    - Remove async startup in Neorg
    - Format with stylua (the most important feature)
In order to add or modify a syntax, we now only need to set or change
values in the module.private.syntax table
@danymat danymat changed the title GTD Base Features WIP: GTD Base Features Aug 18, 2021
@danymat danymat changed the base branch from unstable to gtd_base September 8, 2021 15:41
@danymat danymat marked this pull request as ready for review September 8, 2021 15:44
@danymat
Copy link
Member Author

danymat commented Sep 8, 2021

I'm merging now this PR in gtd_base branch, and we will continue the development from this branch.

@danymat danymat merged commit 829354b into nvim-neorg:gtd_base Sep 8, 2021
@danymat danymat deleted the gtd_base branch September 8, 2021 15:45
vhyrro pushed a commit that referenced this pull request Jan 24, 2022
esquires pushed a commit to esquires/neorg that referenced this pull request Apr 12, 2022
WIP: GTD Base Features
Former-commit-id: 293a20c
@danymat danymat mentioned this pull request Dec 23, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants