zshell é uma aba completando opções ambíguas

3

Eu tenho tido um problema com a conclusão do zsh, que está se tornando um grande aborrecimento. Está completando opções além de onde há ambigüidade. Por exemplo, em um diretório com esses arquivos:

tilertest1x1-00_1408311424.log
tilertest1x1-00_1408311424.root
tilertest2x2-00_1408311501.log
tilertest2x2-00_1408311501.root
tilertest3x3-00_1408311527.log
tilertest3x3-00_1408311527.root

Se eu digitar "menos ti" e depois clicar na guia, o zsh será completado com "tilertest-00_1408311". ao contrário de parar onde eu quero ("tilertest"). Estranhamente, se eu fornecer qualquer tipo de caminho (ou seja, "menos ./ti"), parece funcionar muito bem. Como posso mudar isso para parar na primeira ambigüidade? Se isso ajudar, incluí meu arquivo .zshrc. Eu também devo notar que estou usando oh-my-zsh. Eu tenho a sensação de que a solução é trivial, mas não consigo encontrar nada procurando por aí. Qualquer ajuda seria apreciada.

# Path to your oh-my-zsh installation.
export ZSH=$HOME/.oh-my-zsh

# Set name of the theme to load.
# Look in ~/.oh-my-zsh/themes/
# Optionally, if you set this to "random", it'll load a random theme each
# time that oh-my-zsh is loaded.
ZSH_THEME="cmilke01"

# Example aliases
# alias zshconfig="mate ~/.zshrc"
# alias ohmyzsh="mate ~/.oh-my-zsh"

# Uncomment the following line to use case-sensitive completion.
 CASE_SENSITIVE="true"

# Uncomment the following line to disable bi-weekly auto-update checks.
# DISABLE_AUTO_UPDATE="true"

# Uncomment the following line to change how often to auto-update (in days).
# export UPDATE_ZSH_DAYS=13

 # Uncomment the following line to disable colors in ls.
 # DISABLE_LS_COLORS="true"

 # Uncomment the following line to disable auto-setting terminal title.
 # DISABLE_AUTO_TITLE="true"

 # Uncomment the following line to disable command auto-correction.
  DISABLE_CORRECTION="true"

 # Uncomment the following line to display red dots whilst waiting for     completion.
 # COMPLETION_WAITING_DOTS="true"

# Uncomment the following line if you want to disable marking untracked files
# under VCS as dirty. This makes repository status check for large repositories
# much, much faster.
# DISABLE_UNTRACKED_FILES_DIRTY="true"

# Uncomment the following line if you want to change the command execution time
# stamp shown in the history command output.
# The optional three formats: "mm/dd/yyyy"|"dd.mm.yyyy"|"yyyy-mm-dd"
# HIST_STAMPS="mm/dd/yyyy"

# Would you like to use another custom folder than $ZSH/custom?
# ZSH_CUSTOM=/path/to/new-custom-folder

# Which plugins would you like to load? (plugins can be found in ~/.oh-my-  zsh/plugins/*)
# Custom plugins may be added to ~/.oh-my-zsh/custom/plugins/
# Example format: plugins=(rails git textmate ruby lighthouse)
plugins=(git)

source $ZSH/oh-my-zsh.sh

# User configuration

export PATH="/usr/local/sbin:/usr/local/bin:/usr/bin:/usr/bin/core_perl"
# export MANPATH="/usr/local/man:$MANPATH"

# You may need to manually set your language environment
# export LANG=en_US.UTF-8

# Preferred editor for local and remote sessions
# if [[ -n $SSH_CONNECTION ]]; then
#   export EDITOR='vim'
# else
#   export EDITOR='mvim'
# fi

# Compilation flags
# export ARCHFLAGS="-arch x86_64"

# ssh
# export SSH_KEY_PATH="~/.ssh/dsa_id"
    
por cmilke 03.09.2014 / 02:49

1 resposta

2

A opção que controla uma parte desse comportamento é menu_complete . Então você precisa:

unsetopt menu_complete

(mas parece que o oh-my-zsh já faz isso). Se isso não for suficiente, no caso do oh-my-zsh fazer algo especial, você também pode tentar:

zstyle ':completion:*' completer _complete
bindkey '\t' expand-or-complete

Você também pode comparar o comportamento com zsh -f e no novo shell:

autoload -U compinit
compinit
bindkey -e

Se você obtiver o comportamento incorreto aqui, este é provavelmente um bug na sua versão do zsh. Caso contrário, tente ver qual alteração de oh-my-zsh (em seus arquivos) aciona o problema. Antes de pressionar a tecla Tab , você pode digitar Ctrl Xh para obter informações de contexto na conclusão a seguir (isso pode ajudá-lo a descobrir o que está acontecendo).

Uma vez que você encontrou a solução, para torná-la permanente, coloque-a em .zshrc após qualquer alteração feita por oh-my-zsh, normalmente no final do arquivo ou próximo dele .

    
por 03.09.2014 / 02:56