1
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 1 year has passed since last update.

NTemacs でうろ覚えのディレクトリ、ファイル名から開く

Posted at

やりたいこと

ディレクトリ名、ファイル名、うろ覚えしているときでも、emacs上でファイルを探して開きたい。しかも高速に。

課題1

find-file-in-project (https://github.com/redguardtoo/find-file-in-project ) という、サブディレクトリも検索して曖昧検索可能lispがあるが、標準でfindコマンドを使うらしく低速で待ち時間が長く辛すぎる。

対策1

findの代わりに fd ( https://github.com/sharkdp/fd ) を使おう。windowsなので、chocoで入れる。

課題2

fdを使うようにinit.elに設定したが、見つけたファイルをうまくひらくことができない。なぜだ。

init.el
(require ' find-file-in-project))
(setq ffip-project-root "c:¥¥¥¥projects")
(setq ffip-find-executable "c:¥¥¥¥ProgramData¥¥¥¥chocolatey¥¥¥¥bin¥¥¥¥fd")
(seta ffip-use-rust-fd t)

対策2

find-file-in-project.el
ffip-select-and-open-file function内で、

(find-file file)

している箇所を、

(find-file (concat (ffip-get-project-root-directory) file))

にする。

結果

emacs 上で、M-x find-file-in-project を呼び出したら、
爆速でプロジェクトルート配下のファイルリストが表示され、
絞り込んで選択したら、ファイルが開くようになった。

所感

複数プロジェクト掛け持ちでソフトウェア開発している私みたいな人にはちょっとうれしいTIPSであって欲しい。

1
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?