9

When you trigger minibuffer completion for a partial command/filename/etc., the *Completions* buffer lists possible completions aligned vertically (in columns) but sorted horizontally.

../                ./                   ajax-proj/         algorithms/
angular-phone/     angular/             annex/             archives/
blog-ideas/        clojure-koans/       ctags58/           diff-tryout/
encodings/         filters/             game-table/        git-grounds/
hartl/             invoice_angel/       jQuery-basics/     java/
making/            ng-fundamentals/     node-meetup/       pickaxe/

I find this much more difficult to scan than if they were sorted vertically, like Bash does.

../                annex/               encodings/         jQuery-basics/
./                 archives/            filters/           java/
ajax-proj/         blog-ideas/          game-table/        making/
algorithms/        clojure-koans/       git-grounds/       ng-fundamentals/
angular-phone/     ctags58/             hartl/             node-meetup/
angular/           diff-tryout/         invoice_angel/     pickaxe/

Is there a setting that controls this?

ivan
  • 1,948
  • 10
  • 20

2 Answers2

8

There is the variable completions-format (since Emacs 23.2). Just set it to 'vertical.

Harald Hanche-Olsen
  • 2,441
  • 13
  • 15
  • 1
    Holy cow! Despite Emacs' wealth of configurability, I keep running into really annoying aspects that don't have an easy solution. Happy to hear this is not one of them. completions-format is exactly what I was looking for, and setting it to 'vertical did the trick. Thank you! – ivan Oct 09 '16 at 18:54
  • Yes, I know the feeling … To be honest, I didn't know about this one myself. Ironically, I found out about it by browsing the documentation for icicles, pointed to by @Drew's answer. – Harald Hanche-Olsen Oct 10 '16 at 06:35
  • Hah, that really is ironic :) – ivan Oct 10 '16 at 12:41
  • i am used to the [tag:unix] ls command which sorts vertically by default; also this customizable variable is not in the existing completion group but in the minibuffer customization group (residing in minibuffer.el) acessible by customize-group minibuffer –  Jan 23 '19 at 10:07
1

You can easily do this if you use Icicles - see Vertical Layout.

You can make this the default behavior by customizing option icicle-completions-format to have the value vertical.

And you can toggle between horizontal and vertical layout anytime during completion, using C-M-^.

This affects all minibuffer completion, whether by completing-read or read-file-name (or anything else that uses these).

Drew
  • 77,472
  • 10
  • 114
  • 243