I am new to Emacs. I have installed Projectile.
When I do C-c p
, it says:
C-c p is undefined
Wondering what is wrong?
Following is my ~/.emacs
file.
(require 'package)
(add-to-list 'package-archives
'("melpa" . "http://melpa.milkbox.net/packages/") t)
(package-initialize)
(defvar required-packages
'(
projectile
) "a list of packages to ensure are installed at launch.")
(require 'cl)
; method to check if all packages are installed
(defun packages-installed-p ()
(loop for p in required-packages
when (not (package-installed-p p)) do (return nil)
finally (return t)))
; if not all packages are installed, check one by one and install the missing ones.
(unless (packages-installed-p)
; check for new packages (package versions)
(message "%s" "Emacs is now refreshing its package database...")
(package-refresh-contents)
(message "%s" " done.")
; install the missing packages
(dolist (p required-packages)
(when (not (package-installed-p p))
(package-install p))))
(require 'projectile)
(projectile-global-mode)
Edit
My .projectile file
-/venv
-*.pyc
-*.pyc~
-.git
-.gitignore
-.DS_Store
Edit 2
C-h v
output for projectile-keymap-prefix
as below:
projectile-keymap-prefix is a variable defined in `projectile.el'.
Its value is "^Cp"
Documentation:
Projectile keymap prefix.
You can customize this variable
Edit 3
I am using OS X 10.10.4. I start emacs from command line $emacs
. I have installed Emacs using following commands:
brew install emacs --with-cocoa
And, very first time (when I launch emacs). If do M-x
, I don't get project-switch-project
, rather I get project-switch-to-buffer
. After switching buffer, I can switch project.
.projectile
file somewhere? If you aren't within a project, my understanding is that this may not work. – Radiotelegraphy.init
code worked for me in terms of installingprojectile
and getting the commands to function. Try restarting emacs, perhaps. – Radiotelegraphy