Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow custom editor #292

Open
varac opened this issue Jan 5, 2018 · 12 comments
Open

Allow custom editor #292

varac opened this issue Jan 5, 2018 · 12 comments
Labels

Comments

@varac
Copy link

varac commented Jan 5, 2018

It would be nice to edit a new/existing item using my editor of choice, like khard does.
Meanwhile, where can I find a documentaion on the current integrated editor ?
Especially when removing a long description from an item I feel the pain of a different, unknown editor.

@untitaker
Copy link
Member

Hit F1 for a list of shortcuts. One of them will open EDITOR with the current textfield content

@varac
Copy link
Author

varac commented Jan 18, 2018

Thx, I was not aware of that. However, this opens an editor for a particular text field. khard uses an external editor to edit all fields at once, which would be my favorite.

@WhyNotHugo
Copy link
Member

The latest version lets you do todo edit --raw, but you really need to know what you're doing with that (since we don't validate modifications).
Is that kinda what you're looking for?

@varac
Copy link
Author

varac commented Jan 22, 2018

Looks good, but I'm hesitant to use it when you say you don't validate. Also, --raw don't exist for todo new, which is unfortunate.

@untitaker
Copy link
Member

new with raw would be the same as you just creating a file yourself, no?

@WhyNotHugo
Copy link
Member

new with raw would be the same as you just creating a file yourself, no?

I guess so. Though it might be a bit better to create a blank todo and allow editing that (eg: with a created date, uid, etc).

OTOH, I guess we could try to validate todos edited with raw, by:

  • Copy the file to $TMP.
  • Open it with the user's editor.
  • Try and parse the file:
    • If that works, copy it back.
    • If there's an error, show it, and offer to reopen the editor.

Thoughts?

@varac
Copy link
Author

varac commented Jan 22, 2018

@untitaker, @WhyNotHugo:

new with raw would be the same as you just creating a file yourself, no?

I guess so.

No. Pls have a look how khard does it. khard new starts your configured editor, seeds it with all the available fields and (hopefully) validates it on saving.
If we consider this option, we should make it ppl as easy as possible, without the need to remember field names i.e.

@WhyNotHugo
Copy link
Member

FWIW, what fields are you trying to edit that you can't edit via the UI?
I'd rather improve the UI, instead of converting to a custom format for the editor.

@varac
Copy link
Author

varac commented Jan 24, 2018

@WhyNotHugo I can edit all fields using the UI, it's just that it would be much more convinient to use the keybindings of my favorite editor. So after all, not super important but rather a nice-to-have, and I can understand if you won't put a lot of effort into it. Nonetheless, maybe somebody else likes to implement it ?
My goal would be to have all related cli tools (khard, khal, todoman) usable with your favorite editor, but I can live with the current situation.

@WhyNotHugo
Copy link
Member

TBH, this sounds like a job for an external app should do that, and making the editor called with --raw is as far as I'd go inside todoman.

You'd want your external app to:

  • Convert ICS files to a certain format
  • Open your favourite editor
  • Validate the edited file
  • Convert that back to ICS and save

As of now though, you could use EDITOR=ics-editor todoman edit --raw 7.

@varac
Copy link
Author

varac commented Jan 25, 2018

@WhyNotHugo I disagree, this only works for existing events, and not for new ones.

@WhyNotHugo
Copy link
Member

I guess todo new can be extended to support --raw as well, that should be pretty trivial.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants