From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 25353 invoked by alias); 10 Nov 2014 21:10:10 -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: 19365 Received: (qmail 16316 invoked from network); 10 Nov 2014 21:09:57 -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=-2.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.2 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.co.uk; s=s2048; t=1415653428; bh=p/DTqCHx+fvZ/yK81Rgwen1uOmHtm06iMFAg7ioBONY=; h=cc:In-reply-to:From:References:To:Subject:Date:From:Subject; b=SsLqbXnoZmdCFGva4NwCkhMsDVu+BMPiCIIaDOoz5xDja32fvDZkRrMXnxLqikQi1dQ4gPbMAoHdK44tjLUAeQeYAF0Lfe9qaGLPc+GKdrKLvRJV+Jfp71SPFkAF3tcGhLFmdn49nGPbGRlgUw0JeOI7SdIUz/hN/8Ccgfp5YunXLcRYeMefSnKGG2VaAUxQK1LomG3EiOAPqqDZaU8Wt+/w60VlTBIl56qUsCr3jhbs59KpcIPOivoxbq4OYcvEfV4B3zPclZ0bDf0BdzQ2qaSJJhAMftYefXF2uw6ORpU90j9RvEZN6+G7cctrKV1kHdFV7zr4yd/EJzYCDU0KxQ== DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=s2048; d=yahoo.co.uk; b=fre4jO+/qho9PQzHhRY+UsmSanKIwzxORusNVr83oRb9kVIQ2dlmFCXqa6kwqhd3ankN68JxABHtitLzvN7YGbhK5o5oWvpEF2A+GftUxNmSnjxZ6/a84tcZwXwJRD9PFci2WmFWNXNBbxv7m7oxT2FLvhRX65B0o7GJu/rS84BtH9Pgoznsw6tJN26/j7Y/9YD/7WIIPFPHFT2c2fJzzzMjlMrgRXG5at2QGK08ua1XoPwuHBRYjK8FQo2ydIZuiRyCMRKjnhduh5XF2IWjgbejvi9Uj4FL5vj+hDKTHh/P0WsXuhJL7ecB7EFEGy0zbQno28l/ApTlyk+einKlLw==; X-Yahoo-Newman-Id: 560472.32670.bm@smtp109.mail.ir2.yahoo.com X-Yahoo-Newman-Property: ymail-3 X-YMail-OSG: A.4m3CkVM1kJbL5..A8WNC3zvcsoDKvDP5Nc9L__5Cm9EI0 .0CJGnsCujnLUACvUmgviVEKYk6qsJlJXNsDbZJlqqq7vkVhu5Q_3bXd7pz. JZruoWyC8uQzvySYIqtybr1KjQ_f1HxmEkf48fC7f0WbdlYZBvPXX1XSTWko Ya.naK8rj2s1SL4NWBM5FKHo7lpH3uOoyL33svnp5rjLkIvkcvSKYgVKyufH piiuPulEeqGoNXfsN73DHS06ORhvTvy2cTqxIUv30sp.RM2k2A26X2AxLVo. 8P_Qh0AF9_l8btaK57.CudJ1JEToaUDuyXJWRAXPl_7r_Oa74_UDEdxr6lH5 OdpbrvCEtuT0pmOnIlXum93JsuVrKTcZzNztMdOEkOkOtJh2vaPL5Uz_I6xn LOD.lqB9HZ6y.VOeENvMjcmFwY1RN4.tckdAhIPVVhZ_shIayTplhfebsDSL VX7lIu8SpaEhQAhQmD3Re1tJkfAgO8l8UnbGh1FbaYMUUI2WuNHDh_cdiTV7 rpdcykQz.TP.6Q0E__gnqBdBg0Fk- X-Yahoo-SMTP: opAkk_CswBAce_kJ3nIPlH80cJI- cc: zsh-users@zsh.org In-reply-to: <1415633542.1260.10.camel@gmail.com> From: Oliver Kiddle References: <1415617649.1260.4.camel@gmail.com> <20141110113136.34766361@pwslap01u.europe.root.pri> <20141110121802.6f9434c4@pwslap01u.europe.root.pri> <1415625666.1260.8.camel@gmail.com> <15435.1415627852@thecus.kiddle.eu> <1415633542.1260.10.camel@gmail.com> To: Death Jester Subject: Re: How to add a 'non-escaped' tilde to the completion list MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <17516.1415653425.1@thecus.kiddle.eu> Date: Mon, 10 Nov 2014 22:03:45 +0100 Message-ID: <17517.1415653425@thecus.kiddle.eu> Death Jester wrote: > The binding however was not the problem, but the type of > completion. Using menu completion is an improvement. You'll find that this now works on an empty word but fails when you have already typed a prefix (or suffix) of the directory. The problem with _generic is that _main_complete has special handling for tildes and equals. _history already works around this: you need to move the ~ back to $PREFIX from $IPREFIX. I've attached a fixed function that also has a replacement for the pidof that will work on Solaris. I think lsof can also be used on other platforms. Would be nice to support the BSDs. It may also be possible to better filter the processes: just those with a controlling tty perhaps? readlink is replaced by zsh's internal :A modifier and the current process is filtered out. It also enables partial completion for / and pattern matching so if you know that another shell is in a src directory, you can type *src and the widget will complete that to the right directory. > zstyle ':completion:term_list:*' completer _term_list I'd recommend changing that to the more specific zstyle ':completion:term_list::::' completer _term_list In at least my setup a different completer style would otherwise take precedence. > Btw, I'm not sure if "advertisement" is allowed here. I have submitted > the plugin to the oh-my-zsh project. But without any testers, they don't > want to merge it in to the mainline project. So if anybody is interested > you can test it... =) I'd have thought the function itself was something we could include in the main zsh distribution if people are agreeable? I'm not too sure on the name but am struggling to offer something better - foreign-pwds, external-pwds perhaps? For omz, you might want to consider a different keystroke. Ctrl-V has an existing purpose that some people might not be pleased to have replaced. Oliver #autoload local -a expl local -au dirs # undo work _main_complete did to remove the tilde PREFIX="$IPREFIX$PREFIX" IPREFIX= SUFFIX="$SUFFIX$ISUFFIX" ISUFFIX= [[ -o magicequalsubst ]] && compset -P '*=' case $OSTYPE in solaris*) dirs=( ${(M)${${(f)"$(pgrep -U $UID -x zsh|xargs pwdx)"}:#$$:*}%%/*} ) ;; linux*) dirs=( /proc/${^$(pidof zsh):#$$}/cwd(N:A) ) ;; esac dirs=( ${(D)dirs} ) compstate[pattern_match]='*' _wanted directories expl 'current directory from other shell' \ compadd -M "r:|/=* r:|=*" -f -a dirs