Giter Club home page Giter Club logo

kronos.vim's Introduction

⚠️ Project archived. Have a look at unfog, its successor.

Kronos.vim Build Status

A simple task and time manager.

Table of contents

Requirements

  • VIM v8+ or NVIM v0.3.4+ (not tested on lower versions)
  • Python v3.3+ (check it with :echo has('python3') and :!python3 --version)

Usage

:Kronos

Then you can create, read, update, delete tasks using Vim mapping. The table will automatically readjust when you save the buffer (:w).

Create

To create a task, you can:

  • Write or copy a full table line: |id|desc|tags|active|due|
  • Follow the Kronos format: <desc> <tags> <due>

Create task

A tag should start by a +. You can add as many tags as you need.

A due should start by a :. There is 3 kinds of due:

  • The absolute due: :DDMMYY:HHMM, which correspond to a specific date.
  • The approximative due, which is a partial absolute, for eg. :DD, ::HH, :DDM:M. Kronos will try to find the closest date matching this due.
  • The relative due, which is relative to the actual date. For eg. :1y, :2mo, :4h. Available units: y, mo, w, d, h, m.
    Note: unit order should be respected, from the biggest to the smallest. 2y4mo24m is valid, 3m4d is not.

Here some use cases:

Actual date Given pattern Due
03/03/2019 21:42 :4 04/03/2019 00:00
03/03/2019 21:42 :2 02/04/2019 00:00
03/03/2019 21:42 :0304 or :034 03/04/2019 00:00
03/03/2019 21:42 :3004 or 304 30/04/2019 00:00
03/03/2019 21:42 :0202 02/02/2020 00:00
03/03/2019 21:42 :020221 02/02/2021 00:00
03/03/2019 21:42 ::22 03/03/2019 22:00
03/03/2019 21:42 ::19 04/03/2019 19:00
03/03/2019 21:42 :4:2150 04/03/2019 21:50
03/03/2019 21:42 :2d 05/03/2019 21:42
03/03/2019 21:42 :1w10m 10/03/2019 21:52
03/03/2019 21:42 :1y13mo1h 03/04/2021 22:42

Note: the date format is DD/MM/YYYY HH:MM

Read

To show focused task details, press <K>:

Read task

Update

To update a task, just edit the cell and save:

Update task

For the due field, you need to use the Kronos due format (:18, :20:1230, 2w...).

Start/stop

To start/stop a task, press <Enter>:

Start/stop task

Done

To mark a task as done, delete the line:

Done task

Hide done tasks

To show/hide done tasks, press <gh> (for go hide):

Hide done tasks

Context

The context filters tasks by a list of tags. Once set up:

  • You will see only tasks containing at least one tag of your context
  • When you create a task, all tags in your context will be assigned to it

To set up a context, press gc (for go to context), and type all tags you want in your context (separated by spaces). Typing an empty context removes it:

Set context

Sort

You can sort tasks by pressing gs (for ascending) or gS (for descending). The sort depends on the position of the cursor. For eg, if it's in the ID column, it will sort the ids.

Note: once the tasks sorted, the buffer will be considered as modified, no matter the result.

Worktime

The worktime allows you to check how much time you spent on one or many tags, grouped by day. Press gw (for go to worktime), and type the tags you want to calculate the total worktime:

Worktime

You can also add a beginning date with >DDMMYY:HHMM and a ending date with <DDMMYY:HHMM. (they can be absolute dues or approximative dues, but not relative dues). Here some valid options:

  • tag1 tag2 >18 <20: worktime for tag1, tag2 between the 18th and the 20th of the current month
  • tag1 >:10 : worktime for tag1 starting at 10AM of the current day
  • tag2 <18:22 : worktime for tag2 ending at 10PM of the 18th of the current month

Delete

To delete a task, delete the line when done tasks are shown:

Delete task

Backend

By default, Kronos stores tasks in a file (/path/to/vim/pluggins/kronos.vim/.database). You can define an additionnal backend (for now, only Taskwarrior is available):

let g:kronos_backend = 'file' | 'taskwarrior'

This way, tasks will be synchronized with Taskwarrior. It means you can manage basic actions with Kronos, and manage advanced ones with Taskwarrior CLI.

Note: the synchronization is only from Kronos to Taskwarrior. To synchronize from Taskwarrior to Kronos, check the import section below.

Import

If you want to import your Taskwarrior tasks into Kronos, you can use the import.py script at the root folder of the plugin. Usage:

./import.py taskwarrior ./path/to/your/backlog.data

Note: this will erase the current database

Mappings

Here the default mappings:

Function Mapping
Toggle task <CR>
Show task infos K
Set context gc
Sort (asc) gs
Sort (desc) gS
Hide/show done tasks gh
Show worktime gw
Jump to the next cell <C-n>
Jump to the prev cell <C-p>
Delete in cell dic
Change in cell cic
Visual in cell vic

You can customize them:

nmap <cr>   <plug>(kronos-toggle)
nmap K      <plug>(kronos-info)
nmap gc     <plug>(kronos-context)
nmap gs     <plug>(kronos-sort-asc)
nmap gS     <plug>(kronos-sort-desc)
nmap gh     <plug>(kronos-hide-done)
nmap gw     <plug>(kronos-worktime)
nmap <c-n>  <plug>(kronos-next-cell)
nmap <c-p>  <plug>(kronos-prev-cell)
nmap dic    <plug>(kronos-delete-in-cell)
nmap cic    <plug>(kronos-change-in-cell)
nmap vic    <plug>(kronos-visual-in-cell)

Contributing

Git commit messages follow the Angular Convention, but contain only a subject.

Use imperative, present tense: “change” not “changed” nor “changes”
Don't capitalize first letter
No dot (.) at the end

Code should be as clean as possible, variables and functions use the snake case convention. A line should never contain more than 80 characters.

Tests should be added for each new functionality. Be sure to run tests before proposing a pull request.

Changelog

  • Jul. 24, 2019 - Add tasks sorting
  • Jul. 23, 2019 - Add option to use Taskwarrior as backend
  • May. 14, 2019 - Add relative due + rewrite datetime part in python3
  • May. 13, 2019 - Add custom mapping
  • May. 12, 2019 - Add script to import tasks from taskwarrior (thanks to KevCui)
  • May. 11, 2019 - Remove sync support due to too many complications
  • Dec. 31, 2018 - Worktime is now calculated also per day
  • Dec. 26, 2018 - Refactor interface (Vimwiki like)
  • Oct. 18, 2018 - Refactor code to match the Kronos protocol
  • Jul. 05, 2018 - Add context by tags
  • Jun. 26, 2018 - Implement Gist sync feature
  • Jun. 25, 2018 - Add ability to mark tasks as undone
  • Jun. 24, 2018 - Add option to show or hide done tasks
  • Jun. 23, 2018 - Init changelog

Credits

kronos.vim's People

Contributors

crookedneighbor avatar jeunghunkim avatar kimnorgaard avatar soywod 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  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  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

kronos.vim's Issues

scratch mode after "go hide" (gh) on windows

After pressing gh (go hide) I get into scratch mode from where I cannot go back to regular Kronos.
kronos_scratch

This only happens on Windows (not Linux (Mint)).

System: Windows 10
NVIM v0.4.0-941-g16ee24082

where are kronos task stored

Hi
many thanks for this nice plugin!
I am wondering where the Kronos-tasks (file) is/are stored to back it up.
Thanks! David

Error when trying to view task

This happens after I view a task with K and then try to view it again

Error detected while processing function kronos#ui#info:
line   11:
E21: Cannot make changes, 'modifiable' is off
E21: Cannot make changes, 'modifiable' is off

Ability to use day intead of date

If I know something is due for next wednesday, I don't want to open the calendar to see which date it is or to do calculations in my head.
Great work !

Removing/adding tag while updating task removes due date/time.

When I remove a tag with -, the tag is properly removed, but I also lose the due date/time.

As a minimal working example:
:K a new task +todo :24:2359

Then enter the u mode:

u
-todo 

Which properly removes the tag "todo", but also removes the due date/time.

[Feature Request] Import raw data from taskwarrior

Currently, I'm using taskwarrior for managing my daily tasks. I'd like to start using kronos. Is there a plan to add the feature which can import the taskwarrior raw data to kronos .database? It would make life easier for doing transition. Thanks!

some new features

I added some features in my fork. I can make a PR if you're interested, but I didn't set up tests for the note feature (old tests are still successful).

Change where Kronos is opened:

  • by default Kronos is opened in a new tab, when closing you are brought to the old tab
  • you can set g:kronos_wincmd to vs, sp, tabedit, etc to change this behaviour

I made this change because bdelete closes the window where you opened Kronos, and if you had a split, it will be gone. Now, if you open it in a split (vs), a new split is created and the Kronos window size is automatically readjusted.

Add a note to a task:

  • by pressing n in the gui (either in list or info view), you open a new Note pane
  • the note is automatically saved when pressing Esc, but only stored if not empty (must match a \w)
  • dn deletes the note if pressed in the Note or in the Info pane (not in the List)

Imgur

Store tasks into a GitHub Gist

What do you think of this idea ? So, many other clients could be developed (kronos.web, kronos.sys, kronos.app etc) and using this same Gist (kind of sync) ?

Worktime grouped by weeks

The readme says:

The worktime allows you to check how much time you spent on one or many tags, grouped by day. Press gw (for go to worktime), and type the tags you want to calculate the total worktime:

Is there a way to check how much time spent on a task and also to show the time spent on a task in weeks instead of hours?

Over long durations, time spent in weeks would be more meaningful than time spent in hours of each day

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.