Fast way to find file file in Emacs?

Each time I use find in Aquamacs or Emacs, it automatically shows the previous directory, for example ~ / Work / abc / cdf. However, if I want to open something from the ~ directory, I must click Delete all paths to the first character. Is there a quick way to replace the entire string with one or two keys?

Thanks in advance.

+4
source share
6 answers

Yes, while still in the mini-buffer, press Ctrl-A to go to the beginning of the file name path, and Ctrl-K to delete it to the end of the line, now your file path is empty and you can just type "~"

+2
source

No, no (you need to click Delete). Just type ~ and emacs will ignore everything before it. Same thing with /.

+11
source

As already noted, only the introduction ~ will do the job of quickly switching to the home directory. More generally, you can get many improvements for faster navigation in the find file by activating ido-mode .

+1
source

how about M-<DEL> (back-kill-word)

One click at directory level

Cx <DEL> (backward-kill-sentence)

works, but also destroys ~ /

You can, of course, define your own commands and emacs lisp for their implementation.

As an alternative approach, many unixes allow you to simply type ~ / after a pre-populated path and after that put your desired path, ~ / redefining everything that was before.

0
source

There are packages that do this for you, for example:

http://www.emacswiki.org/emacs/minibuf-electric-gnuemacs.el

0
source
 (defun foo () "Clear the minibuffer" (interactive) (delete-minibuffer-contents)) (define-key minibuffer-local-map [(meta ?k)] 'foo) 
0
source

Source: https://habr.com/ru/post/1341404/


All Articles