zsh-users
 help / color / mirror / code / Atom feed
* 'ignore-line yes' style semantics?
@ 2011-05-08 19:52 Ole Jørgen Brønner
  2011-05-08 20:09 ` Mikael Magnusson
  0 siblings, 1 reply; 6+ messages in thread
From: Ole Jørgen Brønner @ 2011-05-08 19:52 UTC (permalink / raw)
  To: zsh-users

[-- Attachment #1: Type: text/plain, Size: 1472 bytes --]

Why does 'ignore-line yes' ignore the _current_ word too? If this is somehow useful in some cases, could we get another option ignoring all words except the current one?

I'm almost burned myself when using
     zstyle ':completion:*:(mv|rm|kill|diff):*' ignore-line yes
and doing
     rm someprefix<tab>
in a directory with files 'someprefix' and 'someprefix_important'. In this case someprefix will expand to someprefix_important

(minimal rc file inclued)


> ignore-line
>
> 	This is tested for each tag valid for the current completion. If it is
> 	set to true, none of the words that are already on the line will be
> 	considered as possible completions. If it is set to current, the word
> 	the cursor is on will not be considered as a possible completion. The
> 	value current-shown is similar but only applies if the list of
> 	completions is currently shown on the screen.  Finally, if the style is
> 	set to other, no word apart from the current one will be considered as a
> 	possible completion.
> 	The values current and current-shown are a bit like the opposite of the
> 	accept-exact style: only strings with missing characters will be
> 	completed.
>
> 	Note that you almost certainly dont want to set this to true or other
> 	for a general context such as :completion:*. This is because it would
> 	disallow completion of, for example, options multiple times even if the
> 	command in question accepts the option more than once.

-- 
Ole Jørgen Brønner

[-- Attachment #2: ignore-line-yes.zsh --]
[-- Type: application/octet-stream, Size: 190 bytes --]


autoload -Uz compinit
compinit

zstyle ':completion:*:(mv|rm|kill|diff):*' ignore-line yes

cd /tmp
touch prefix
touch prefix_important

ls prefix*

echo "now do"
echo "rm prefix<tab>"tab


^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2011-05-13  6:56 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-05-08 19:52 'ignore-line yes' style semantics? Ole Jørgen Brønner
2011-05-08 20:09 ` Mikael Magnusson
2011-05-08 22:45   ` Ole Jørgen Brønner
2011-05-08 22:46   ` Ole Jørgen Brønner
2011-05-12 17:45     ` Mikael Magnusson
2011-05-13  6:50       ` Ole Jørgen Brønner

Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).