Code Monkey home page Code Monkey logo

todotxt.nvim's Introduction

todotxt.nvim

Neovim plugin to view and add tasks stored in a todo.txt format.

asciicast

Features

Sidebar split

Sidebar split to view and manage tasks.

sidebar

Prompt

Prompt to quickly add new tasks.

prompt

Requirements

Installation

With packer.nvim:

use {
	'arnarg/todotxt.nvim',
	requires = {'MunifTanjim/nui.nvim'},
}

Quickstart

Add the setup() function to your init file.

For init.lua:

require('todotxt-nvim').setup({
	todo_file = "/path/to/todo.txt",
})

For init.vim:

lua <<EOF
require('todotxt-nvim').setup({
	todo_file = "/path/to/todo.txt",
})
EOF

Configuration

{
  todo_file = "/path/to/todo.txt",
  sidebar = {
    width = 40,
    position = "left" | "right" | "bottom" | "top", -- default: "right"
  },
  capture = {
    prompt = "> ",
    -- Percentage is percentage of width of the whole editor
    -- Integer is number of columns
    width = "75%" | 50,
    position = "50%",
    -- Styled after https://swiftodoapp.com/todotxt-syntax/priority/
    -- With this, if you include any of the below keywords it will
    -- automatically use the associated priority and remove that
    -- keyword from the final task.
    alternative_priority = {
      A = "now",
      B = "next",
      C = "today",
      D = "this week",
      E = "next week",
    },
  },
  -- Highlights used in both capture prompt and tasks sidebar
  -- Each highlight type can be a table with 'fg', 'bg' and 'style'
  -- options or a string referencing an existing highlight group.
  -- highlights = {
  --   project = "Identifier",
  -- }
  highlights = {
    project = {
      fg = "magenta",
      bg = "NONE",
      style = "NONE",
    },
    context = {
      fg = "cyan",
      bg = "NONE",
      style = "NONE",
    },
    date = {
      fg = "NONE",
      bg = "NONE",
      style = "underline",
    },
    done_task = {
      fg = "gray",
      bg = "NONE",
      style = "NONE",
    },
    priorities = {
      A = {
        fg = "red",
        bg = "NONE",
        style = "bold",
      },
      B = {
        fg = "magenta",
        bg = "NONE",
        style = "bold",
      },
      C = {
        fg = "yellow",
        bg = "NONE",
        style = "bold",
      },
      D = {
        fg = "cyan",
        bg = "NONE",
        style = "bold",
      },
    },
  },
  -- Keymap used in sidebar split
  keymap = {
    quit = "q",
    toggle_metadata = "m",
    delete_task = "dd",
    complete_task = "<space>",
    edit_task = "ee",
  },
}

Usage

Commands

:ToDoTxtCapture: Opens up a prompt to add a new task.

:ToDoTxtTasksToggle: Opens up a sidebar split with tasks parsed from todo.txt file provided to setup(). There is also :ToDoTxtTasksOpen and :ToDoTxtTasksClose available.

Keymap in sidebar split

Keymap Action
e Edit task under cursor
dd Delete task under cursor
<space> Toggles task under cursor as done/not done
m Toggle metadata for task
q Close sidebar pane

todotxt.nvim's People

Contributors

arnarg avatar thyw avatar wiener234 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

todotxt.nvim's Issues

[Feature Request] Wrap option

With long descriptions for the todos, it's impractical to have them in a side pane without wrapping.

:set wrap works while reading, but when I mark anything as done, it reverts back to not wrapping.

Perhaps a wrap option in the config could be used to set the default behavior?

project status?

Hi @arnarg , this plugin seems good for todo.txt usage, but there are no commits in recent months. Are you still using or developing it?

Sidebar left/right

Is it possible to configure the sidebar to open on the left instead of the right?

Highlight links

Is it possible to link highlights to existing groups depending on if you set a string or table? Something like this:

highlights = {
  project = "Identifier",
  context = "Function",
}

Toggle done

Thoughts on adding a sidebar keymap to toggle a task status done/undone?

Highlighting of the `todo.txt` file

Hi πŸ‘‹

Does the plugin provide highlighting for the todo.txt file itself (as shown in the asciinema gif), or is it only for the side bar? I didn't see any ftdetect code in the repo, but then again I'm not too familiar with lua plugins.

Cheers.

Getting errors after installing with LunarVim

Hi There!

I'm using LunarVim and installed and configured your plugin, but I'm getting errors when i try to run any of the commands. I have a feeling this is something on LunarVim's end but just wanted to double-check here first.

Snapshots of my config.lua:
image
image

Errors when I try to run the ToDoTxtCapture and ToDoTxtTasksOpen commands:
image
image

Are there any configuration steps that I might have missed that might be causing this problem?

Thanks!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.