Projectile: Change default prefix to C-c p doesn't work

Created on 25 Jul 2018  路  4Comments  路  Source: bbatsov/projectile

Expected behavior

After changing default prefix I can use projectile commands using C-c p prefix.

Actual behavior

When I press C-c p i see message C-c p is undefined in echo area, but prefix C-c C-p still works.

Steps to reproduce the problem

  • Run emacs -Q --load emacsprojectile.el
  • Content of emacsprojectile.el:
(require 'package)
(let* ((no-ssl (and (memq system-type '(windows-nt ms-dos))
                    (not (gnutls-available-p))))
       (url (concat (if no-ssl "http" "https") "://melpa.org/packages/")))
  (add-to-list 'package-archives (cons "melpa" url) t))

(package-initialize)

(unless (package-installed-p 'projectile)
  (package-install 'projectile))

(require 'projectile)
(projectile-mode +1)
(setq projectile-keymap-prefix (kbd "C-c p"))

Environment & Version information

Projectile version information

Projectile version: 20180724.318

Emacs version

26.1

Operating system

Linux 4.14.56 #2 SMP Wed Jul 18 00:09:15 CDT 2018 x86_64 Intel(R) Core(TM) i7-4790S CPU @ 3.20GHz GenuineIntel GNU/Linux

emacs

Most helpful comment

You have to set this before loading the mode. If for some reason this doesn't work as well - move the setq before the require.

All 4 comments

You have to set this before loading the mode. If for some reason this doesn't work as well - move the setq before the require.

It works if I set it before require statement. So in case of using use-package, should I set it in :init?

So in case of using use-package, should I set it in :init?

Yes, or :custom.

I checked and it works:

(use-package projectile
  :init
  (setq projectile-keymap-prefix (kbd "C-c p"))
  :config
  (projectile-mode +1))

Thanks, issue solved for me.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

sweord picture sweord  路  3Comments

JSmith-BitFlipper picture JSmith-BitFlipper  路  4Comments

ChinaXing picture ChinaXing  路  5Comments

kaiwk picture kaiwk  路  4Comments

andrematheus picture andrematheus  路  3Comments