vonshednob / pter

Manage your todo.txt in a commandline user interface (TUI)
https://vonshednob.cc/pter/
MIT License
102 stars 6 forks source link

Open in external editor #5

Closed maxigaz closed 2 years ago

maxigaz commented 2 years ago

Being used to (Neo)vim, I would be very pleased if I could open the current todo list or the highlighted task in an external editor. Is it possible to do this from pter?

vonshednob commented 2 years ago

Currently not, but sounds like an easy task. I’ll get on it.

vonshednob commented 2 years ago

It’s implemented as of version 2.0.0 (commit 395e06efb406910762d51fcc04889a9e04fc7ec3).

By default pter will try to use VISUAL or EDITOR (in this order), but the configuration option editor (in [Global] overwrites these). If all fails, pter will just hope for the best and see if nano exists (at this point we’re looking at a user who never configured their environment variables, so launching the external editor was probably a mistake to begin with).

After editing pter will still apply the usual sugar coating (expand relative dates, auto-generate IDs, if requested).

It’s currently not possible to create a new task through an external editor, because that opens a whole new can of worms… if you want that, too, please create a new issue so we can discuss the odds and ends.