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.

:ToDoTasksToggle: Opens up a sidebar split with tasks parsed from todo.txt file provided to setup(). There is also :ToDoTasksOpen and :ToDoTasksClose 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

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.