C-p 怎样绑定到 dired-mode 的 'dired-previous-line 上面?

发现 dired-mode 向上键是单独的 p ,而不是 C-p,试了各种办法都没有绑上去。

  1. 在 dotspacemacs/user-config 中
  (require 'dired)
  (define-key dired-mode-map (kbd "C-p") 'dired-previous-line)
  1. 在私有 layer 的 packages.el 中
(defconst xxx-packages
  '(
    (dired :location built-in)
  )

(defun adispring/init-dired ()
  (use-package dired
    :config
    (progn
      (define-key dired-mode-map (kbd "C-p") 'dired-previous-line)
      )))
(defun adispring/post-init-dired ()
  (with-eval-after-load 'dired
      (define-key dired-mode-map (kbd "C-p") 'dired-previous-line)
      ))

我的 .spacemacs.d 仓库:https://github.com/adispring/spacemacsDotD

(evilified-state-evilify-map dired-mode-map
        :mode dired-mode
        :bindings
        (kbd "C-p") 'dired-previous-line)

试试这个?

发现是因为安装 range 导致的,去掉 range ,C-p 就回来了