Work around ido-mode remapping Spacemacs keys
Add aliases for commands that ido-mode remaps that we want to bind to Spacemacs keys, and use these aliases in the Spacemacs key bindings so that these bindings invoke the original commands rather than the ido commands. See <https://github.com/syl20bnr/spacemacs/issues/10237#issuecomment-359861570>.
This commit is contained in:
parent
c3e402332f
commit
07964b1a2e
|
@ -76,6 +76,9 @@ This file containes the change log for the next major version of Spacemacs.
|
||||||
- Avoid importing already defined variables (except `PATH`/`MANPATH`).
|
- Avoid importing already defined variables (except `PATH`/`MANPATH`).
|
||||||
- Move all scrolling key bindings from ~SPC n~ to ~SPC N~ (Somelauw)
|
- Move all scrolling key bindings from ~SPC n~ to ~SPC N~ (Somelauw)
|
||||||
- Overhaul the scroll transient state on ~SPC N~ prefix (Somelauw)
|
- Overhaul the scroll transient state on ~SPC N~ prefix (Somelauw)
|
||||||
|
- Use Helm or Ivy (if one of these is enabled) for ~SPC a d~ (=dired=),
|
||||||
|
~SPC F f~ (=find-file-other-frame=), ~SPC F b~ (=switch-to-buffer-other-frame=),
|
||||||
|
~SPC F B~ (=display-buffer-other-frame=), and ~SPC F O~ (=dired-other-frame=).
|
||||||
*** Layer changes
|
*** Layer changes
|
||||||
**** GitHub
|
**** GitHub
|
||||||
- Add new package =magithub=
|
- Add new package =magithub=
|
||||||
|
|
|
@ -88,6 +88,18 @@ automatically applied to."
|
||||||
:type '(list symbol))
|
:type '(list symbol))
|
||||||
|
|
||||||
|
|
||||||
|
;; ido-mode remaps some commands to ido counterparts. We want default Emacs key
|
||||||
|
;; bindings (those under C-x) to use ido, but we want to use the original
|
||||||
|
;; commands in Spacemacs key bindings (those under M-m or SPC) so that they use
|
||||||
|
;; `read-file-name-function', `completing-read-function',
|
||||||
|
;; `completion-in-region-function', etc. configured by Helm or Ivy etc. The
|
||||||
|
;; following aliases allow us to bind Spacemacs keys to the original commands.
|
||||||
|
(defalias 'spacemacs/find-file-other-frame 'find-file-other-frame)
|
||||||
|
(defalias 'spacemacs/dired 'dired)
|
||||||
|
(defalias 'spacemacs/dired-other-frame 'dired-other-frame)
|
||||||
|
(defalias 'spacemacs/switch-to-buffer-other-frame 'switch-to-buffer-other-frame)
|
||||||
|
(defalias 'spacemacs/display-buffer-other-frame 'display-buffer-other-frame)
|
||||||
|
|
||||||
(defun spacemacs/indent-region-or-buffer ()
|
(defun spacemacs/indent-region-or-buffer ()
|
||||||
"Indent a region if selected, otherwise the whole buffer."
|
"Indent a region if selected, otherwise the whole buffer."
|
||||||
(interactive)
|
(interactive)
|
||||||
|
|
|
@ -229,13 +229,13 @@
|
||||||
"fyy" 'spacemacs/copy-file-path)
|
"fyy" 'spacemacs/copy-file-path)
|
||||||
;; frame ----------------------------------------------------------------------
|
;; frame ----------------------------------------------------------------------
|
||||||
(spacemacs/set-leader-keys
|
(spacemacs/set-leader-keys
|
||||||
"Ff" 'find-file-other-frame
|
"Ff" 'spacemacs/find-file-other-frame
|
||||||
"Fd" 'delete-frame
|
"Fd" 'delete-frame
|
||||||
"FD" 'delete-other-frames
|
"FD" 'delete-other-frames
|
||||||
"Fb" 'switch-to-buffer-other-frame
|
"Fb" 'spacemacs/switch-to-buffer-other-frame
|
||||||
"FB" 'display-buffer-other-frame
|
"FB" 'spacemacs/display-buffer-other-frame
|
||||||
"Fo" 'other-frame
|
"Fo" 'other-frame
|
||||||
"FO" 'dired-other-frame
|
"FO" 'spacemacs/dired-other-frame
|
||||||
"Fn" 'make-frame)
|
"Fn" 'make-frame)
|
||||||
;; help -----------------------------------------------------------------------
|
;; help -----------------------------------------------------------------------
|
||||||
(spacemacs/set-leader-keys
|
(spacemacs/set-leader-keys
|
||||||
|
|
|
@ -72,7 +72,7 @@
|
||||||
|
|
||||||
(defun spacemacs-defaults/init-dired ()
|
(defun spacemacs-defaults/init-dired ()
|
||||||
(spacemacs/set-leader-keys
|
(spacemacs/set-leader-keys
|
||||||
"ad" 'dired
|
"ad" 'spacemacs/dired
|
||||||
"fj" 'dired-jump
|
"fj" 'dired-jump
|
||||||
"jd" 'dired-jump
|
"jd" 'dired-jump
|
||||||
"jD" 'dired-jump-other-window))
|
"jD" 'dired-jump-other-window))
|
||||||
|
|
Loading…
Reference in a new issue