todoman icon indicating copy to clipboard operation
todoman copied to clipboard

Navigating tasks with vim keys

Open IgnacioJPickering opened this issue 1 year ago • 6 comments

I would like to navigate the TUI using vim-style keybindings (hjkl, triggered by the "escape" key). Is this a possibility?

IgnacioJPickering avatar May 19 '23 22:05 IgnacioJPickering

It might be simpler to configure ctrl+j, ctrl-k, etc (kinda like what fzf does). Modal editing might require more complicated changes (but should still be doable).

WhyNotHugo avatar May 22 '23 19:05 WhyNotHugo

I have not spent any time trying to find out who is "guilty" for this (my terminal emulator/todoman/framework that todoman uses for interactive mode if any), but I accidentally discovered that Ctrl+o opens the currently focused field in external editor (vim in my case). I'm pretty sure that it is not a feature of my terminal emulator, which means it could work for you too. It will not help you with switching fields but it should if you are looking for a way to edit the individual fields in vim-like way.

~~Regarding switching fields: Ctrl+j/k would indeed be one natural possibility, another one would be (Shift+)Tab since Tab does not seem to currently insert an actual tab or do anything else. khal implements the latter.~~

Edit: it seems that the field jumping using tab is already being discussed in #204. Also my guess is that urwid is the one responsible for the open-in-editor feature.

balejk avatar Oct 13 '23 19:10 balejk

The Ctrl+o thing is a todoman feature:

https://github.com/pimutils/todoman/blob/27c45f0de5a9f9b92bec8eff18ce7d0757ba4260/todoman/widgets.py#L63-L65

WhyNotHugo avatar Oct 13 '23 19:10 WhyNotHugo

ctrl+k is mapped to "delete till end of line". I'm not sure why this is. Maybe readline compat?

WhyNotHugo avatar Oct 13 '23 19:10 WhyNotHugo

The Ctrl+o thing is a todoman feature:

Ah, I see, very cool!

ctrl+k is mapped to "delete till end of line". I'm not sure why this is. Maybe readline compat?

I presume (based on the other issue) that moving between fields is handled by urwid?

balejk avatar Oct 13 '23 20:10 balejk

The function that I linked above delegates any "unknown" key mappings to urwid. Arrow keys must be implemented by them.

WhyNotHugo avatar Oct 14 '23 09:10 WhyNotHugo