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

How to use org calendar? #816

Open
julian-hoch opened this issue Jun 1, 2024 · 3 comments
Open

How to use org calendar? #816

julian-hoch opened this issue Jun 1, 2024 · 3 comments

Comments

@julian-hoch
Copy link

I have trouble figuring out how to use the org calendar. If I use hjkl in the minibuffer, it does not move the date, instead it enters those characters verbatim.
This is my config:

(use-package evil-collection
    :after evil
    :custom
    (evil-collection-calendar-want-org-bindings t)
    :config
    (setq evil-collection-mode-list (delq 'vundo evil-collection-mode-list))
    (evil-collection-init))

Am I doing it wrong? I would have expected that h/l moves by day, j/k by week and perhaps some other keys to change the month.

@condy0919
Copy link
Collaborator

The option evil-collection-calendar-want-org-bindings is to enable

<normal-state> c		org-calendar-goto-agenda
<normal-state> i		org-agenda-diary-entry

M-x calendar then type c or i. Make sure org-agenda-diary-file is not 'diary-file.

@julian-hoch
Copy link
Author

Hmm c does move to agenda, but i still is bound to insert mode. But in any case my use case is different - when I enter a date, e.g. using C-c . (org-time-stamp) I get presented with a calendar I can use to input a date.
This was what I was referring to - currently I do not see a way to select a date from the calendar except the default shift+cursor.
Jun05::200640
Here is where I would have expected evil bindings to move the date around.

@condy0919
Copy link
Collaborator

The binding are defined in org-read-date-minibuffer-local-map keymap.

(define-key org-read-date-minibuffer-local-map (kbd "j") (kbd "S-<down>"))

to get evil-style motion.

IMO, it's an org integration. Currently the org integration of evil-collection is simple,

(defun evil-collection-org-setup ()
  "Set up `evil' bindings for `org'."
  (evil-collection-define-key 'normal 'org-mode-map
    [tab] 'org-cycle
    [S-tab] 'org-shifttab)

  (evil-collection-define-key 'motion 'org-mode-map
    "{" 'org-backward-paragraph
    "}" 'org-forward-paragraph
    "(" 'org-backward-sentence
    ")" 'org-forward-sentence))

That's all.

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

No branches or pull requests

2 participants