zsh-users
 help / color / mirror / code / Atom feed
From: Aaron Schrab <aaron@schrab.com>
To: zsh-users@zsh.org
Subject: Re: Remove space added by completion
Date: Fri, 14 Feb 2014 19:49:07 -0500	[thread overview]
Message-ID: <20140215004907.GH10654@pug.qqx.org> (raw)
In-Reply-To: <16835.1392415885@thecus.kiddle.eu>

At 23:11 +0100 14 Feb 2014, Oliver Kiddle <okiddle@yahoo.co.uk> wrote:
>zzapper wrote:
>>
>> When you tab complete you get a trailing space for free which is mostly
>> what you want but is there a flag etc which can remove it?
>
>See the -q, -r and -R options to compadd in the documentation.
>
>I assume you don't want to disable it completely given that it is
>"mostly what you want". You should actually find that it gets removed if
>the next key you type is something that would imply the suffix wasn't
>wanted. I can't think of an example with a space but typing space after
>a / suffix from a completed directory will usually remove the trailing
>/.
>
>It might be useful to have a specific example of an unwanted space.

I don't know about the original poster, but one place where I often 
don't want a space after a completion is with git branch names, to make 
it easier to do commands like:

  # List commits in current branch but not in master
  git log master..
  # List commits from either branch which aren't in the other
  git log branch1...branch2

The completion for git already supports completing branches after those 
dots, but an unwanted space is automatically added after completing the 
first branch name.

Of course, I can't say for sure that I wouldn't get more annoyed by the 
space not being automatically added there in cases where I'm only going 
to be specifying a single branch.


  reply	other threads:[~2014-02-15  0:49 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-02-14 21:42 zzapper
2014-02-14 22:11 ` Oliver Kiddle
2014-02-15  0:49   ` Aaron Schrab [this message]
2014-02-15  2:33     ` Bart Schaefer
2014-02-15  4:45       ` Aaron Schrab
2014-02-18 16:54         ` Oliver Kiddle
2014-02-20  1:33           ` Aaron Schrab
2014-03-22 14:10           ` m0viefreak
2014-03-22 16:43             ` [PATCH] _git: auto-removable '..' suffix: remove at the end of lines m0viefreak
2014-03-22 17:37               ` Bart Schaefer
2014-03-23  3:41                 ` m0viefreak
2014-03-23  6:45                   ` Bart Schaefer
2014-03-23 18:38                     ` [PATCH] zle/completion: fix auto-removable suffix highlighting m0viefreak
2014-02-15 12:45   ` Remove space added by completion zzapper
2014-02-20 10:05     ` Oliver Kiddle

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20140215004907.GH10654@pug.qqx.org \
    --to=aaron@schrab.com \
    --cc=zsh-users@zsh.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).