spacemacs-defaults: add a keybind to open a file and replace buffer with it

Define an alias and use it internally so that (1) the name of the command will
be better to understand what it does than the original name and (2) Helm or Ivy
interface is invoked instead of Ido.

These are suggested in PR #11115.
This commit is contained in:
Masayuki Takemura 2018-07-31 16:49:47 +09:00 committed by Codruț Constantin Gușoi
parent ab5b171524
commit c2e377c902
3 changed files with 3 additions and 0 deletions

View File

@ -2369,6 +2369,7 @@ Files manipulation commands (start with ~f~):
| Key Binding | Description |
|-------------+--------------------------------------------------------------------------------------------------------|
| ~SPC f a~ | open a file and replace the current buffer with the new file |
| ~SPC f b~ | go to file bookmarks |
| ~SPC f c~ | copy current file to a different location |
| ~SPC f C d~ | convert file from unix to dos encoding |

View File

@ -100,6 +100,7 @@ automatically applied to."
(defalias 'spacemacs/switch-to-buffer-other-frame 'switch-to-buffer-other-frame)
(defalias 'spacemacs/insert-file 'insert-file)
(defalias 'spacemacs/display-buffer-other-frame 'display-buffer-other-frame)
(defalias 'spacemacs/find-file-and-replace-buffer 'find-alternate-file)
(defun spacemacs/indent-region-or-buffer ()
"Indent a region if selected, otherwise the whole buffer."

View File

@ -200,6 +200,7 @@
:evil-leader "e.")
;; file -----------------------------------------------------------------------
(spacemacs/set-leader-keys
"fa" 'spacemacs/find-file-and-replace-buffer
"fc" 'spacemacs/copy-file
"fD" 'spacemacs/delete-current-buffer-file
"fei" 'spacemacs/find-user-init-file