2

I have jedi-mode installed in emacs for python editing because I find C-. and C-, very useful for jumping to definitions and back. Automatic auto-completion, however, is not something I want. As I try to use emacs with jedi installed, it is continually trying to jump in with suggestions and bring up popups. How can I configure jedi so that it only does things in response to specific invocations, and not in response to typing or cursor movement?

I've tried setting (setq jedi:complete-on-dot nil) and (setq jedi:tooltip-method nil) but these only disable some of jedi's reactive features. How do I disable all of them?

Alternatively, is there a different emacs package that would be a better choice if I mostly just want to be able to jump to definitions?

Jeff Kaufman
  • 575
  • 3
  • 13
  • If all you're looking for is jumping to and from definitions, maybe [dumb jump](https://github.com/jacktasia/dumb-jump) would work for you. I haven't tried it but what you are asking for is the entire premise of the package. – Randy Morris Apr 27 '17 at 19:03
  • jedi inspects the python ast, so it can show you the definition of things like attributes of variables. dumbjump is based on grep and regexps and so would be much less capable. – Jeff Kaufman Apr 28 '17 at 13:08
  • It looks like you can just enable `jedi-mode` directly rather than calling `jedi:setup`. If you do this the "jump to definition" binds are still installed but the autocompletion stuff isn't set up. – Randy Morris Apr 28 '17 at 13:21
  • That didn't work for me: setting `jedi-mode` without running `jedi-setup` gave me `File mode specification error: (void-function jedi:mode)`. (But I figured out how to get what I wanted, and posted an answer below) – Jeff Kaufman Apr 28 '17 at 17:59
  • Note the difference in 'jedi-mode' and 'jedi:mode'. I suspect you tried to run the latter. Running 'jedi-mode' in a python file with no additional configuration gave me the jump binds with no autocomplete. Either way I'm glad you found a solution that works for you. – Randy Morris Apr 28 '17 at 19:47

1 Answers1

1

jedi uses auto-complete for auto-completion, so to turn that off you need to look at the auto-complete manual:

; move quick-help tooltips to the minibuffer
(setq jedi:tooltip-method nil)

; disable all auto-completion unless explicitly invoked with M-tab
(setq ac-auto-show-menu nil)
(setq ac-auto-start nil)
(define-key ac-mode-map (kbd "M-TAB") 'auto-complete)

; start jedi
(add-hook 'python-mode-hook 'jedi:setup)
Jeff Kaufman
  • 575
  • 3
  • 13