可能な一致が入力されていても、zshにオートコンプリートオプションを表示させます。

可能な一致が入力されていても、zshにオートコンプリートオプションを表示させます。

現在のシステム(zsh 5.0.2を含むopenSUSE 12.3)では、すでに入力している場合は、オートコンプリート機能で可能な完成一致を選択することはできません。

たとえば、次の2つのファイルがあるディレクトリにある場合文書そしてファイル2私は次のように入力します:

cat file<TAB>

その後、スペースが追加され、その内容は表示されません。ファイル2また可能な一致です。この動作を変更できますか?この場合、Bashはよりうまく機能します。文書そしてファイル2スペースを追加せずに)、可能な一致を隠さない解決策も興味深いでしょう。

ベストアンサー1

zstyle ':completion:*' accept-exact false

~からzshcompsys(1)

accept-exact
              This  is  tested for the default tag in addition to the tags valid for the current context.  If it is set to `true' and any of the trial matches is the
              same as the string on the command line, this match will immediately be accepted (even if it would otherwise be considered ambiguous).

すべての完成タイプに影響を与えることなくzstyleのコンテキストをより具体的にすることもできます。

おすすめ記事