我是 Emacs 的新手。我已经安装了弹丸。
当我这样做时C-c p
,它说:
C-c p is undefined
想知道有什么问题吗?
以下是我的~/.emacs
文件。
(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)
编辑
我的 .projectile 文件
-/venv
-*.pyc
-*.pyc~
-.git
-.gitignore
-.DS_Store
编辑 2
C-h v
输出projectile-keymap-prefix
如下:
projectile-keymap-prefix is a variable defined in `projectile.el'.
Its value is "^Cp"
Documentation:
Projectile keymap prefix.
You can customize this variable
编辑 3
我正在使用 OS X 10.10.4。我从命令行启动 emacs $emacs
。我已经使用以下命令安装了 Emacs:
brew install emacs --with-cocoa
而且,第一次(当我启动 emacs 时)。如果这样做M-x
,我没有得到project-switch-project
,而是我得到了project-switch-to-buffer
。切换缓冲区后,我可以切换项目。