Don't use ido for sudo-edit of new files and bind key

This commit is contained in:
Christoph Paulik 2015-10-24 09:11:03 +02:00 committed by Eivind Fonn
parent 6887320420
commit 9726033515
3 changed files with 3 additions and 1 deletions

View file

@ -1588,6 +1588,7 @@ Files manipulation commands (start with ~f~):
| ~SPC f C d~ | convert file from unix to dos encoding |
| ~SPC f C u~ | convert file from dos to unix encoding |
| ~SPC f D~ | delete a file and the associated buffer (ask for confirmation) |
| ~SPC f E~ | open a file with elevated privileges (sudo edit) |
| ~SPC f f~ | open file with =helm= (or =ido=) |
| ~SPC f F~ | try to open the file under point =helm= |
| ~SPC f j~ | jump to the current buffer file in dired |

View file

@ -313,7 +313,7 @@ argument takes the kindows rotate backwards."
(defun spacemacs/sudo-edit (&optional arg)
(interactive "p")
(if (or arg (not buffer-file-name))
(find-file (concat "/sudo:root@localhost:" (ido-read-file-name "File: ")))
(find-file (concat "/sudo:root@localhost:" (read-file-name "File: ")))
(find-alternate-file (concat "/sudo:root@localhost:" buffer-file-name))))
;; found at http://emacswiki.org/emacs/KillingBuffers

View file

@ -130,6 +130,7 @@ Ensure that helm is required before calling FUNC."
"fg" 'rgrep
"fj" 'dired-jump
"fl" 'find-file-literally
"fE" 'spacemacs/sudo-edit
"fo" 'spacemacs/open-in-external-app
"fR" 'spacemacs/rename-current-buffer-file
"fS" 'evil-write-all