Coder Social home page Coder Social logo

nocksock / do.nvim Goto Github PK

View Code? Open in Web Editor NEW
35.0 1.0 3.0 3.32 MB

A tiny task manager within nvim that helps you stay on track. (づ◡﹏◡)づ

Lua 92.80% JavaScript 3.10% Shell 3.81% Vim Script 0.29%
neovim neovim-lua-plugin neovim-plugin nvim-plugin todo-list lua nvim hacktober

do.nvim's Introduction

Do.nvim

A tiny task manager within nvim that helps you stay on track.

Preview

Introduction

Introduction Gif

Rationale

While coding, we often need to do several things that depend on another. And it's quite easy to loose track of what we initially set out to do in the first place, which is also know as Yak Shaving. Or we just have a list of tasks that we want to work off step by step.

This plugin provides a few simple commands to help you stay on track.

It manages a list of things and always shows you the first item. It provides you with some commands to add things to it, without leaving context. And it uses a simple, intuitive floating buffer to manage that list.

Usage

  • :Do add a line to the end of the list.
  • :Do! add a line to the front of list.
  • :Done! remove the first line from the list.
  • :DoEdit edit the list in a floating window.
  • :DoSave create .do_tasks file in cwd. Will auto-sync afterwards.
  • :DoToggle toggle the display. Use with caution!

Installation

Requires Neovim 0.8.

-- use the package manager of your choice, eg. packer
use("https://github.com/nocksock/do.nvim")

-- setup wherever you do that in you config (eg init.lua)
require("do").setup({
  -- default options
  message_timeout = 2000, -- how long notifications are shown
  kaomoji_mode = 0, -- 0 kaomoji everywhere, 1 skip kaomoji in doing
  winbar = false,
  doing_prefix = "Doing: ",
  store = {
    auto_create_file = false, -- automatically create a .do_tasks when calling :Do
    file_name = ".do_tasks",
  }
})

Winbar

This plugin felt best to me using the winbar - which is a new feature in neovim 0.8. In order to use it, enable it:

require('do').setup({
  winbar = true
})

Lualine

In case you'd rather use it in the statusline or tabbar, you can use the exposed views to do so. For example with lualine:

require('lualine').setup {
  winbar = {
    lualine_a = {
      function()
        return require('do').view('active')
      end,
    },
  },
  inactive_winbar = {
    -- in order to prevent jumping of code in certain cursor positions this will
    -- (at the moment) show an empty line - but only if .view has contents.
    lualine_a = { require("do").view_inactive },
  },
}

Events

This plugin exposes a custom event, for when a task is added or modified. You can use it like so:

vim.api.nvim_create_autocmd({ "User" }, {
   group = require("do.state").state.auGroupID,
   pattern = "TaskModified",
   desc = "This is called when a task is added or deleted",
   callback = function()
      vim.notify("A task has been modified")
   end,
})

Development

Run tests

Running tests requires plenary.nvim to be checked out in the parent directory of this repository. You can then run:

nvim --headless --noplugin -u tests/minimal.vim -c "PlenaryBustedDirectory tests/ {minimal_init = 'tests/minimal.vim'}"

Or if you want to run a single test file:

nvim --headless --noplugin -u tests/minimal.vim -c "PlenaryBustedDirectory tests/path_to_file.lua {minimal_init = 'tests/minimal.vim'}"

do.nvim's People

Contributors

avegancafe avatar nocksock avatar shawnyu5 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

Watchers

 avatar

do.nvim's Issues

make a global task list too.

Currently .do_tasks is created (maybe at project root).
changing projects (:Telescope projects), still persists the Do s.
Changing projects should empty the Do s?

Blank line with lazyvim

Hi, I probably doing somethings wrong, I'm not an expert.
Neovim version:

NVIM v0.9.5
Build type: Release
LuaJIT 2.1.1692716794

I'm using this plugin on lazyvim like this:

return {
  {
    "nocksock/do.nvim",
    opts = {
      message_timeout = 2000, -- how long notifications are shown
      kaomoji_mode = 1, -- 0 kaomoji everywhere, 1 skip kaomoji in doing
      winbar = true,
      doing_prefix = "Doing: ",
      store = {
        auto_create_file = true, -- automatically create a .do_tasks when calling :Do
        file_name = "~/do_tasks",
      },
    },
  },
}

It seems to load and I have the commands. If I run :Do test the only this it does is overriding what barbecue plugin (that use winbar) is saying.

If I disable barbecue the only thing it does is creating a blank line in the winbar.

Thank you

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.