diff options
author | Tom Ryder <tom@sanctum.geek.nz> | 2016-08-25 13:18:47 +1200 |
---|---|---|
committer | Tom Ryder <tom@sanctum.geek.nz> | 2016-08-25 13:18:47 +1200 |
commit | 6b83e4ac5fb95d8783748d458fc0ba6a3415e1a7 (patch) | |
tree | 70c197c6beb5a0472bc7aa146b1f576031d6a407 | |
parent | Prevent readline completing dotfiles without a dot (diff) | |
download | dotfiles-6b83e4ac5fb95d8783748d458fc0ba6a3415e1a7.tar.gz dotfiles-6b83e4ac5fb95d8783748d458fc0ba6a3415e1a7.zip |
Switch ls()/readline to horizontal list/complete
<https://github.com/izabera/libash/blob/9e709a56a148b4311792cc66cd21b61a73434573/extras/sample_inputrc#L33>
-rw-r--r-- | readline/inputrc | 3 | ||||
-rw-r--r-- | sh/profile.d/options.sh | 1 | ||||
-rw-r--r-- | sh/shrc.d/ls.sh | 4 |
3 files changed, 8 insertions, 0 deletions
diff --git a/readline/inputrc b/readline/inputrc index 84d35a43..116648c8 100644 --- a/readline/inputrc +++ b/readline/inputrc @@ -28,6 +28,9 @@ set match-hidden-files Off # Don't paginate possible completions set page-completions Off +# Goes nicely with ls(1) -x/--format=across +set print-completions-horizontally on + # Show multiple completions on first tab press set show-all-if-ambiguous On diff --git a/sh/profile.d/options.sh b/sh/profile.d/options.sh index d4dc45a3..4dadf5c3 100644 --- a/sh/profile.d/options.sh +++ b/sh/profile.d/options.sh @@ -50,6 +50,7 @@ options ls \ block-size \ classify \ color \ + format \ hide-control-chars \ human-readable \ time-style diff --git a/sh/shrc.d/ls.sh b/sh/shrc.d/ls.sh index 705936e6..a7a6e15f 100644 --- a/sh/shrc.d/ls.sh +++ b/sh/shrc.d/ls.sh @@ -18,6 +18,10 @@ ls() { [ "$({ tput colors || tput Co ; } 2>/dev/null)" -ge 8 ] && set -- --color=auto "$@" + # Add --format=horizontal to print entries in a saner way + [ -e "$HOME"/.cache/ls/format ] && + set -- --format=horizontal "$@" + # Add --hide-control-chars if present; we always want this interactively, # even if the output is to a pager; we shouldn't be trying to script ls(1) # output anyway |