13
11

More than 5 years have passed since last update.

Emacs の dired でディレクトリを先に表示する

Posted at

これについてWebを調べると、大抵

(setq ls-lisp-dirs-first t)

を .emacs に書くという情報が見つかるが,これは Windows で ls をエミュレートするための ls-lisp の機能であり,Ubuntu などでは動かない.

ls が使える環境でディレクトリを先に表示したいなら,以下のように .emacs に書く.

(setq dired-listing-switches "-AFl --group-directories-first")

dired の ls オプションは dired-listing-switches で変更でき,--group-directories-first によってディレクトリを先に表示できる.-AFl は好みと環境に合わせて設定する.

また,ディレクトリのシンボリックリンクがファイル側に表示するのが嫌なら -L を追加すればよい.

13
11
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
13
11