You are not logged in.
Hi,
I'm trying to learn to write completion functions for zsh, and started by writing one for unison, which looks in the profiles directory to tab-complete profiles. So far, I've got a _unison file containing the following:
#compdef unison
#typeset -A opt_args
local profiles
profiles=~/.unison
_files -W ${profiles} -g '*.prf' && return 0
return 1
Which works relatively well:
% unison <tab>
default.prf documents.prf photographs.prf
Just for the fun of it really, I'd like to remove the .prf bit and just have it complete the basename. Any idea how I can achieve this?
Thanks :-)
"Cared thou not, thou would have abstained." - Xyne
Offline
I don't think 'basename' is the right word.
This works for bash:
for i in *.txt; do echo ${i%%.*}; done
Now you have to somehow add it to your workflow.
Offline
@karol
are you solved?
I'm very interested ...
I have never bought on ebay, the macbook I do not like, I do not need facebook or myspace or secondlife
I am not a nerd or lamer or troll or geek or hacker or cracker
and I have never voted to elect berlusconi
Offline