-
Notifications
You must be signed in to change notification settings - Fork 4
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
It doesn't work in orgmode #13
Comments
I don't use org-mode myself so I will need help to fix this. Pull requests welcome. For starters, what do you mean by "doesn't work"? Is it simply the case that |
Hi. I mean that no word is suggested. Like if fancy-dabbrev wouldn't exist. |
@Ypot Does the tab key not trigger the popup, or do you expect regular dabbrev suggestion while you type and these also don't work? Can you look what the tab key is bound to? |
Hi! You are correct:
|
@Ypot for a quick fix you might want to look into rebinding tab in org-mode so you can expand and also do the org-cycle stuff otherwise.
(defun my/fancy-dabbrev-expand-or-org-cycle ()
(interactive)
(unless (fancy-dabbrev--expand)
(call-interactively org-cycle)))
(define-key 'org-mode-map (kbd "<tab>") #'my/fancy-dabbrev-expand-or-org-cycle) (Not tested, but this is the gist) |
Thanks I added this code:
Now TAB completes the word I am writing, but I can not choose. I can't see any option. |
You're right. It appears to behave as if one calls Triggering the expansion popup, not just 1-time dabbrev expansion, might interfere more with org-cycle, though. Do you use the cycle command? If not, you can also bind tab to just Here's the internal implementation of expansion:
It has a check whatever was run last; and it calls You could try to inline more of the expansion function into your own function here, but that sounds cumbersome. I personally would prefer to have making an expansion trigger an internal minor mode, like "is expanding, showing the popup", and then we have focused key bindings for what has to happen when expansion is active, but not settled. |
org-mode + fancy-dabbrev seem to work fine for me with f3b05ad and something like this: (use-package org
:bind (:map org-mode-map
("<tab>" . fancy-dabbrev-expand-or-indent)
("<backtab>" . fancy-dabbrev-backward))
:config
(setq org-cycle-emulate-tab nil)
(add-hook 'org-mode-hook (lambda () (setq-local fancy-dabbrev-indent-command 'org-cycle))))
(use-package fancy-dabbrev
:config
(global-fancy-dabbrev-mode)
(global-set-key (kbd "TAB") 'fancy-dabbrev-expand-or-indent)
(global-set-key (kbd "<backtab>") 'fancy-dabbrev-backward)) @Ypot: Does this work good enough for you? |
Not bad! It works, but now I can't expand the org subtrees* *Subtrees can be expanded, but the cursor must be placed after a blank space. |
The above snippet helps me get the expansion menu, but not the preview. Are there any options of having the preview be shown in orgmode? |
@Ypot wrote:
Right, since that's a valid expansion context the keypress will not be forwarded to
I actually think that it would be a good idea not to use the same key binding for expansion and cycling since there will always be cases where you want something else than what happens. It's the same thing for me with ordinary indentation, by the way, I solve that by letting |
Thanks. I will try these keybindings:
|
Thank you Joel - just wanted to confirm that with f3b05ad now preview is working in org-mode too. :) |
It works in my init.el file, but it doesn't work in my .org files.
It looks great, I hope that could be solved.
These are my settings:
The text was updated successfully, but these errors were encountered: