Forums

Skip to content

Advanced search
  • Quick links
    • Unanswered topics
    • Active topics
    • Search
  • FAQ
  • Login
  • Register
  • Board index Assistance Other Things Gentoo
  • Search

autocomplete aliased 'emerge' command in zsh [Solved]

Still need help with Gentoo, and your question doesn't fit in the above forums? Here is your last bastion of hope.
Post Reply
Advanced search
8 posts • Page 1 of 1
Author
Message
ppurka
Advocate
Advocate
Posts: 3257
Joined: Sun Dec 26, 2004 5:05 pm

autocomplete aliased 'emerge' command in zsh [Solved]

  • Quote

Post by ppurka » Sun Aug 20, 2006 1:56 am

I have the following command (using cfg-update here) aliased to emerge in my ~/.zshrc

Code: Select all

alias emerge='emerge_with_indexing_for_cfg-update'
However, whenever I try to autocomplete the options of emerge or package names (as usual, by typing <tab> after a half-complete name/option), the autocomplete does not work. I think zsh internally expands the emerge command to its actual command and so does not find any autocompletions for that actual command.

Is there a way of disabling this "internally_replace_the_alias_by_its_command" only for the 'emerge' alias? FYI, the autocomplete works fine in bash (so bash obviously does not internally replace the alias name by the actual command).

TIA.
Last edited by ppurka on Mon Aug 21, 2006 12:53 am, edited 1 time in total.
Top
sfragis
Tux's lil' helper
Tux's lil' helper
User avatar
Posts: 95
Joined: Thu Mar 24, 2005 5:28 pm
Location: RE < IT < Europe
Contact:
Contact sfragis
Website

  • Quote

Post by sfragis » Sun Aug 20, 2006 9:17 am

Hi ppurka, try this easy test:

Code: Select all

% alias emerge="myemerge"
% setopt complete_aliases
% emerge -<TAB>        # press <TAB> in order to autocomplete
When I press <TAB> zsh shows the list of options as if emerge was not an alias.
From "man zshall":
COMPLETE_ALIASES
Prevents aliases on the command line from being internally substituted before completion is
attempted. The effect is to make the alias a distinct command for completion purposes.
Regards
Fabio Strozzi
Top
ppurka
Advocate
Advocate
Posts: 3257
Joined: Sun Dec 26, 2004 5:05 pm

  • Quote

Post by ppurka » Sun Aug 20, 2006 8:45 pm

Excellent! It works. The command is (without the underscore) :

Code: Select all

setopt completealiases
Thank you!
Top
sfragis
Tux's lil' helper
Tux's lil' helper
User avatar
Posts: 95
Joined: Thu Mar 24, 2005 5:28 pm
Location: RE < IT < Europe
Contact:
Contact sfragis
Website

  • Quote

Post by sfragis » Mon Aug 21, 2006 8:59 am

With or without the underscore makes no difference 8) . From the great zshoptions man pages:
SPECIFYING OPTIONS
Options are primarily referred to by name. These names are case insensitive and
underscores are ignored. For example, `allexport' is equivalent to `A__lleXP_ort'.
Regards
Fabio Strozzi
Top
ppurka
Advocate
Advocate
Posts: 3257
Joined: Sun Dec 26, 2004 5:05 pm

  • Quote

Post by ppurka » Mon Aug 21, 2006 5:14 pm

I didn't know about this property of zsh that you have mentioned. I just used the superb autocompletion of zsh to complete my setopt command, and it spit out completealiases, without the underscore.

The more I use zsh, the more I love this shell :D
Top
sfragis
Tux's lil' helper
Tux's lil' helper
User avatar
Posts: 95
Joined: Thu Mar 24, 2005 5:28 pm
Location: RE < IT < Europe
Contact:
Contact sfragis
Website

  • Quote

Post by sfragis » Mon Aug 21, 2006 7:31 pm

Yeah, I like it too, very powerful. It's a pity that it's not widely known. At now I use Bash only for those (few) scripts I publish online.
If you're interested, I've put my zsh dot-files on my web site.
Regards
Fabio Strozzi
Top
ppurka
Advocate
Advocate
Posts: 3257
Joined: Sun Dec 26, 2004 5:05 pm

  • Quote

Post by ppurka » Mon Aug 21, 2006 9:38 pm

sfragis wrote:Yeah, I like it too, very powerful. It's a pity that it's not widely known. At now I use Bash only for those (few) scripts I publish online.
If you're interested, I've put my zsh dot-files on my web site.
Thanks. Those dot-files are heavily customized! I haven't been able to look completely into the power of zsh yet. I had created a .zshrc more than a year back, and I have not done any modificiation to it since. Some day when I have ample time, I will study your dot-files :)
Top
lateralus__
Tux's lil' helper
Tux's lil' helper
User avatar
Posts: 100
Joined: Fri May 19, 2006 10:02 am
Location: Belgium
Contact:
Contact lateralus__
Website

  • Quote

Post by lateralus__ » Tue Aug 22, 2006 10:06 am

sfragis wrote: If you're interested, I've put my zsh dot-files on my web site.
Thanks for sharing :wink:
I didn't change my config since a long time and these custom files will help me improve my zsh usage !!!
There are a lot of lies going around.... and half of them are true.
-- Winston Churchill
Top
Post Reply

8 posts • Page 1 of 1

Return to “Other Things Gentoo”

Jump to
  • Assistance
  • ↳   News & Announcements
  • ↳   Frequently Asked Questions
  • ↳   Installing Gentoo
  • ↳   Multimedia
  • ↳   Desktop Environments
  • ↳   Networking & Security
  • ↳   Kernel & Hardware
  • ↳   Portage & Programming
  • ↳   Gamers & Players
  • ↳   Other Things Gentoo
  • ↳   Unsupported Software
  • Discussion & Documentation
  • ↳   Documentation, Tips & Tricks
  • ↳   Gentoo Chat
  • ↳   Gentoo Forums Feedback
  • ↳   Duplicate Threads
  • International Gentoo Users
  • ↳   中文 (Chinese)
  • ↳   Dutch
  • ↳   Finnish
  • ↳   French
  • ↳   Deutsches Forum (German)
  • ↳   Diskussionsforum
  • ↳   Deutsche Dokumentation
  • ↳   Greek
  • ↳   Forum italiano (Italian)
  • ↳   Forum di discussione italiano
  • ↳   Risorse italiane (documentazione e tools)
  • ↳   Polskie forum (Polish)
  • ↳   Instalacja i sprzęt
  • ↳   Polish OTW
  • ↳   Portuguese
  • ↳   Documentação, Ferramentas e Dicas
  • ↳   Russian
  • ↳   Scandinavian
  • ↳   Spanish
  • ↳   Other Languages
  • Architectures & Platforms
  • ↳   Gentoo on ARM
  • ↳   Gentoo on PPC
  • ↳   Gentoo on Sparc
  • ↳   Gentoo on Alternative Architectures
  • ↳   Gentoo on AMD64
  • ↳   Gentoo for Mac OS X (Portage for Mac OS X)
  • Board index
  • All times are UTC
  • Delete cookies

© 2001–2026 Gentoo Foundation, Inc.

Powered by phpBB® Forum Software © phpBB Limited

Privacy Policy

 

 

magic