zsh-users
 help / color / mirror / code / Atom feed
* cd - not expanding to dirs
@ 2012-11-19 17:43 zzapper
  2012-11-19 21:35 ` Bart Schaefer
  0 siblings, 1 reply; 6+ messages in thread
From: zzapper @ 2012-11-19 17:43 UTC (permalink / raw)
  To: zsh-users

Hi
(posting to new thread as I cant see the old thread for some reason)
 
[root@isx01linux03]/var# dirs
/var /etc /var/www/html ~


autopushd is set

but

cd -<tab> does not expand to dirs

zsh 4.2.6 (x86_64-redhat-linux-gnu)


-- 
zzapper
http://zzapper.co.uk/ Technical Tips


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: cd - not expanding to dirs
  2012-11-19 17:43 cd - not expanding to dirs zzapper
@ 2012-11-19 21:35 ` Bart Schaefer
  2012-11-19 22:05   ` zzapper
  2012-11-20 13:46   ` zzapper
  0 siblings, 2 replies; 6+ messages in thread
From: Bart Schaefer @ 2012-11-19 21:35 UTC (permalink / raw)
  To: zsh-users

On Nov 19,  5:43pm, zzapper wrote:
}
} [root@isx01linux03]/var# dirs
} /var /etc /var/www/html ~
} 
} autopushd is set
} 
} but
} 
} cd -<tab> does not expand to dirs
} 
} zsh 4.2.6 (x86_64-redhat-linux-gnu)

Are you sure you've run "compinit" ?

CentOS 5.x (i386 but that shouldn't matter):

[schaefer@pip2]~% echo $ZSH_VERSION 
4.2.6
[schaefer@pip2]/var/www/htdocs% dirs
/var/www/htdocs /etc /var ~
[schaefer@pip2]/var/www/htdocs% setopt autopushd 
[schaefer@pip2]/var/www/htdocs% cd -<TAB>
0 -- /home/schaefer
1 -- /var
2 -- /etc


(Actually autopushd is irrelevant to the completion.)

I see you're running a root shell --  perhaps compaudit objected to
something and didn't load the completions, or perhaps the zsh/parameter
module is not loaded?


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: cd - not expanding to dirs
  2012-11-19 21:35 ` Bart Schaefer
@ 2012-11-19 22:05   ` zzapper
  2012-11-20  3:48     ` Bart Schaefer
  2012-11-20 13:46   ` zzapper
  1 sibling, 1 reply; 6+ messages in thread
From: zzapper @ 2012-11-19 22:05 UTC (permalink / raw)
  To: zsh-users

Bart Schaefer wrote in news:121119133528.ZM4445@torch.brasslantern.com:

> On Nov 19,  5:43pm, zzapper wrote:
> }
> } [root@isx01linux03]/var# dirs
> } /var /etc /var/www/html ~
> } 
> } autopushd is set
> } 
> } but
> } 
> } cd -<tab> does not expand to dirs
> } 
> } zsh 4.2.6 (x86_64-redhat-linux-gnu)
> 
> Are you sure you've run "compinit" ?
> 
> (Actually autopushd is irrelevant to the completion.)
> 
> I see you're running a root shell --  perhaps compaudit objected to
> something and didn't load the completions, or perhaps the zsh/parameter
> module is not loaded?
> 
Bart
Thanks -How embarrassing, because it's only a remote server I haven't 
bothered with a full setup - hence no compinit.
But how should I have known that "cd -" depended on this ? How should I have 
approached searching the doc? 



-- 
zzapper
http://zzapper.co.uk/ Technical Tips


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: cd - not expanding to dirs
  2012-11-19 22:05   ` zzapper
@ 2012-11-20  3:48     ` Bart Schaefer
  2012-11-20 13:50       ` zzapper
  0 siblings, 1 reply; 6+ messages in thread
From: Bart Schaefer @ 2012-11-20  3:48 UTC (permalink / raw)
  To: zsh-users

On Nov 19, 10:05pm, zzapper wrote:
}
} But how should I have known that "cd -" depended on [compinit] ?

Osmosis?

More seriously, attempting to answer this question (and similar ones about
how to introduce novice users to the zsh feature set) is what led to the
creation of the zsh/newuser module and zsh-newuser-install function.

Ideally the first time you ran the shell you should have been prompted by
the newuser subsystem to initialize completion and various other setup.
If you aren't the first root user, or the OS packager includes a default
setup for root, then you miss out on this.

} How should I have approached searching the doc? 

In this case it's less how you should have approached searching it than
how you should have approached browsing it.

The third section of the documentation is entitled "Roadmap".  There is
a subsection therein called "Completion".  The second paragraph of that
section says:

  Zsh has two completion systems, an old, so called compctl completion
  (named after the builtin command that serves as its complete and only
  user interface), and a new one, referred to as compsys, organized as
  library of builtin and user-defined functions.  The two systems differ
  in their interface for specifying the completion behavior.  The new
  system is more customizable and is supplied with completions for many
  commonly used commands; it is therefore to be preferred.

  The completion system must be enabled explicitly when the shell starts.
  For more information see Completion System.

Those last two words are a link to the twentieth (!) section, which
rambles a bit about contexts and styles and dispatchers, and then moves
on with a section "Initialization" which explains compinit.


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: cd - not expanding to dirs
  2012-11-19 21:35 ` Bart Schaefer
  2012-11-19 22:05   ` zzapper
@ 2012-11-20 13:46   ` zzapper
  1 sibling, 0 replies; 6+ messages in thread
From: zzapper @ 2012-11-20 13:46 UTC (permalink / raw)
  To: zsh-users

> 
> (Actually autopushd is irrelevant to the completion.)
> 
> 
I needed both:-
autoload compinit
setopt autopushd

to be able to use cd -<tab> and cp ~+<tab>

(remember to visit a few directories before using it of course)



-- 
zzapper
http://zzapper.co.uk/ Technical Tips


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: cd - not expanding to dirs
  2012-11-20  3:48     ` Bart Schaefer
@ 2012-11-20 13:50       ` zzapper
  0 siblings, 0 replies; 6+ messages in thread
From: zzapper @ 2012-11-20 13:50 UTC (permalink / raw)
  To: zsh-users

Bart Schaefer wrote in news:121119194806.ZM4576@torch.brasslantern.com:

> creation of the zsh/newuser module and zsh-newuser-install function.
> 
> 
Thanks this is new to me as well: 

Guess I ought to a have a trawl thru the doc!


-- 
zzapper
http://zzapper.co.uk/ Technical Tips


^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2012-11-20 13:55 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-11-19 17:43 cd - not expanding to dirs zzapper
2012-11-19 21:35 ` Bart Schaefer
2012-11-19 22:05   ` zzapper
2012-11-20  3:48     ` Bart Schaefer
2012-11-20 13:50       ` zzapper
2012-11-20 13:46   ` zzapper

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).