Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

A quick way to do find-file in Emacs?

Tags:

emacs

editing

Every time I use find-file in Aquamacs or Emacs, it auto shows the previous directory, for example ~/Work/abc/cdf. However, if I want to open something from the ~ directory, I have to press Delete all the ways down to the first character. Is there any quick way to replace all the string with just one or two keys?

Thank you in advance.

like image 313
Dzung Hong Avatar asked Dec 09 '22 10:12

Dzung Hong


2 Answers

No, you don't (have to press Delete). Just type ~ and emacs will ignore everything before it. Same with /.

like image 86
harpo Avatar answered Jan 14 '23 10:01

harpo


Yes, while still in the mini buffer press Ctrl-A to go to the start 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 "~"

like image 30
Bogatyr Avatar answered Jan 14 '23 09:01

Bogatyr