How can I make C-p an Emacs prefix key for Devel::PerlySense?

前端 未结 2 2015
闹比i
闹比i 2021-02-03 11:01

I just installed Devel::PerlySense 0.0180.

I have put the following in my .emacs file:

 ; PerlySense
 (load \"~/perly-sense\")

 (global-unset-key \"\\C-         


        
2条回答
  •  隐瞒了意图╮
    2021-02-03 11:08

    The explicit answer to your question is this:

    (define-prefix-command 'perly-sense-map)
    (global-set-key (kbd "C-p") 'perly-sense-map)
    (define-key perly-sense-map (kbd "C-d") 'perly-sense-smart-docs-at-point)
    (define-key perly-sense-map (kbd "C-g") 'perly-sense-smart-go-to-at-point)
    

    For more information as to what's being done, check out documentation for

    • define-prefix-command
    • keymaps
    • kbd

    In the original post, you mixed using kbd and the older "\C-p" notation. You can read this large tutorial discussing keybindings, which has tons of information (more than what you probably need). I find the kbd usage to be the easiest, you just pass it the string that you'd see when you do help on a key (C-h k).

提交回复
热议问题