From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 16460 invoked by alias); 15 Feb 2014 00:49:24 -0000 Mailing-List: contact zsh-users-help@zsh.org; run by ezmlm Precedence: bulk X-No-Archive: yes List-Id: Zsh Users List List-Post: List-Help: X-Seq: 18456 Received: (qmail 26987 invoked from network); 15 Feb 2014 00:49:09 -0000 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,SPF_HELO_PASS autolearn=ham version=3.3.2 Date: Fri, 14 Feb 2014 19:49:07 -0500 From: Aaron Schrab To: zsh-users@zsh.org Subject: Re: Remove space added by completion Message-ID: <20140215004907.GH10654@pug.qqx.org> Mail-Followup-To: zsh-users@zsh.org References: <16835.1392415885@thecus.kiddle.eu> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Disposition: inline In-Reply-To: <16835.1392415885@thecus.kiddle.eu> User-Agent: Mutt/1.5.22+66 (g5d1ab39) (2013-10-16) At 23:11 +0100 14 Feb 2014, Oliver Kiddle 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.