跳转到emacs中的某个文件

时间:2013-12-14 05:50:39

标签: emacs

我想知道如何以直接模式跳转到emacs中的某个文件或文件夹?

让我说我输入一个包含数百个文件和文件夹的文件夹,我知道我想要的文件位于列表中间,因为它以“G”开头,例如。

是否有命令让插入符号直接转到以“G”开头的第一个文件/文件夹,这样我可以缩小搜索范围?

3 个答案:

答案 0 :(得分:1)

尝试使用dired-jump

(autoload 'dired-jump "dired-x" "Jump to dired corresponding current buffer.")
(autoload 'dired-jump-other-window "dired-x" "jump to dired in other window.")

然后致电:

M-x dired-jump

M-x dired-jump-other-window

答案 1 :(得分:1)

我假设您只想跳转到dired缓冲区中的文件名,而不是实际打开文件本身。为此,您只需使用isearch搜索文件名:

C-s G...

答案 2 :(得分:1)

你显然可以使用isearch,但内置函数更好。

(eval-after-load "dired"
  '(progn
    (define-key dired-mode-map (kbd "C-s") 'dired-isearch-filenames)
    (define-key dired-mode-map (kbd "C-M-s") 'dired-isearch-filenames-regexp)
))
相关问题