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

org-cycle problem in evil normal state #4024

Closed
dingmingxin opened this issue Dec 1, 2015 · 7 comments
Closed

org-cycle problem in evil normal state #4024

dingmingxin opened this issue Dec 1, 2015 · 7 comments

Comments

@dingmingxin
Copy link

Here are the layers that I loaded.

dotspacemacs-configuration-layers
'(
     better-defaults
     emacs-lisp
     git
     markdown
     org
  )

When I start emacs in OSX Terminal.app , opening a org file. Hitting TAB key in the keyboard did not trigger function:

org-cycle

By describe-function org-cycle, I got:

It is bound to <mouse-1>, <normal-state> <tab>, <tab> .....

I have nothing special settings in my Terminal.app. And Tab behavior is normal in "Gnu Emacs for OSX"(GUI mode).

spacemacs version: 0.104.6
emacs version: 25.1
osx: 10.11.1

How can I solve this problem .Can anyone help me out ? Much appreciations.

@StreakyCobra
Copy link
Contributor

It's probably another variant of #3472. The <tab> keycode is only understood by the GUI version of emacs, and the TAB keycode is understood by both Terminal and GUI versions of emacs. There is two of them because, for historic reasons, TAB and C-i are the same keycode. So to have the possibility to differentiate Tab from C-i in GUI, the <tab> keycode is used.

  • <tab> = Tab (GUI only)
  • TAB = C-i = C-i = Tab (Terminal, or GUI if <tab> is not set)

There are people wanting to use TAB everywhere, like you, to have the same behaviour in Terminal and in GUI. There are others people, like in the linked issue, that want to use <tab> everywhere to have the possibility to differentiate Tab key from C-i in GUI, but breaking terminals.

@justbur found a clean way to satisfy everybody and this will probably be soon in develop (and later in master). This is truly awesome, because it will even work on demonized emacs :-)

@dingmingxin
Copy link
Author

Thanks for replying in time.
But in which way can I personally configure emacs, making TAB act as org-cycle in org mode ?
I have tried this in ~/.spacemacs.d/init.el

(defun dotspacemacs/user-config ()
  "Configuration function for user code.
  This function is called at the very end of Spacemacs initialization after
  layers configuration. You are free to put any user code."
  (define-key evil-normal-state-map (kbd "TAB") 'org-cycle)
  )

But it did not work as I expected.

@syl20bnr
Copy link
Owner

syl20bnr commented Dec 2, 2015

This is a temporary regression in develop, we will fix it soon, sorry for this.

@justbur
Copy link
Contributor

justbur commented Dec 2, 2015

@dingmingxin like this in user-config

(evil-define-key 'normal evil-jumper-mode-map (kbd "TAB") nil)

@dingmingxin
Copy link
Author

@syl20bnr Thanks for your awesome work.
@justbur Just tested:

  (evil-define-key 'normal evil-jumper-mode-map (kbd "TAB") nil)

This works for me . Thank you very much.

@StreakyCobra
Copy link
Contributor

Related PRs: #4025, #3999

@vitiral
Copy link

vitiral commented Dec 24, 2015

Just want to mention that this is still broken for me in mainline.

@justbur is there a way to do it so that that only takes effect for org mode? Something like (evil-define-key-mode 'org-mode ... et

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

No branches or pull requests

6 participants