开发者

Emacs Python interpreter tweaks

开发者 https://www.devze.com 2023-03-22 15:39 出处:网络
Having minor issue configuring emacs. I am trying to re-assign the M-Tab key binding for anything code completion as its already bound to ubuntu unity \"tab/page viewer\".

Having minor issue configuring emacs. I am trying to re-assign the M-Tab key binding for anything code completion as its already bound to ubuntu unity "tab/page viewer".

(require 'anything)
(require 'anything-ipython)
(when (require 'anything-show-completion nil t)
  (use-anything-show-completion 'anything-ipython-complete
                            '(length initial-patter开发者_开发技巧n)))

These are the attempts I have had to rebind it. don't particularly want but I know its not taken by anything else.

;;; (define-key anything-mode-map (kbd "<F9>") 'anything)
;;; (define-key anything-show-completion-mode-map (kbd "<F9>") 'anything)
;;; (define-key anything-show-completion-map (kbd "<F9>") 'anything)

Just can't quite get it right.


I think you'll find that you want to use lower-case "f9": (kbd "<f9>") instead of (kbd "<F9>").

You can check with C-hkF9 to see what Emacs reports that key as being, and use that same string verbatim as the argument to(kbd).

Also note that you use ESC as a substitute for Meta -- Emacs will translate it. So ESCTAB will do the same as M-TAB. And in the case of TAB, you can also generate that character code with C-i, so M-C-i is another existing binding.

I looked up the files you mentioned, and anything-ipython.el seems to be the only one which binds M-TAB, and based on its installation instructions you should already have the following code:

;;  Install: 
;;  =======
;;
;; Setup anything python:
;; Put this file in your load path.
;; Add to .emacs:
;;
;; (require 'anything-ipython)
;; (add-hook 'python-mode-hook #'(lambda ()
;;                                 (define-key py-mode-map (kbd "M-<tab>") 'anything-ipython-complete)))
;; (add-hook 'ipython-shell-hook #'(lambda ()
;;                                   (define-key py-mode-map (kbd "M-<tab>") 'anything-ipython-complete)))
;;

So I'm guessing that's what you want to be changing.

0

精彩评论

暂无评论...
验证码 换一张
取 消