2

To quickly and temporarily append a directory to my PATH environment variable I usually do export PATH=$PATH:/some/other/dir however zsh does not tab-complete the part after the colon typing :/so<tab>. Typing export PATH=/so <tab> expands to export PATH=/some/

In zsh the tab-completion works after the = but not after the :. How can I make zsh treat the colon as start of a new word where tab-completion can take place?

edit-update: I just found out that it is not the = or : that prevent tab-complete. When trying to expand cmake -DCMAKE_TOOLCHAIN_FILE=~/Foo<tab> the path is also not expanded.

I know about the vared path and I think its cool but my often enough my old bash habits kick in...

Here is the zsh-part of my ~/.zshrc:

# The following lines were added by compinstall

zstyle ':completion:*' completer _complete _ignored
zstyle ':completion:*' max-errors 1
zstyle :compinstall filename '/home/ruschi/.zshrc'

autoload -U promptinit && promptinit
autoload -Uz colors && colors
autoload -Uz compinit && compinit


# Lines configured by zsh-newuser-install
HISTFILE=~/.histfile
HISTSIZE=1000
SAVEHIST=1000
setopt appendhistory extendedglob notify
#make zsh use emacs-style keybindings
bindkey -e
# End of lines configured by zsh-newuser-install

# fix <ALT>arrow combinations
bindkey ";3D" emacs-backward-word                       
bindkey ";3C" emacs-forward-word 
truschival
  • 303
  • 1
  • 2
  • 7
  • Such completions work for me; I'm afraid I don't know what options or styles I might have (or you don't have) that make it so, but it is possible. – chepner Oct 24 '16 at 17:23
  • Try starting with an unconfigured zsh by running zsh -f. Then add your configuration. At least the compinit line. That line should be the only thing needed to make it work. Perhaps there's something in a system /etc/zshrc. – okapi Oct 27 '16 at 10:23

0 Answers0