zsh-users
 help / color / mirror / code / Atom feed
* history-search + a few new user question
@ 2005-12-04 16:26 karpi
  2005-12-04 17:15 ` Christian Taylor
                   ` (4 more replies)
  0 siblings, 5 replies; 7+ messages in thread
From: karpi @ 2005-12-04 16:26 UTC (permalink / raw)
  To: zsh-users


Hello, Ive just try switch from bash. zsh has plenty of amazing
features, but some, i am habit-dependent on, i can not found.

1) At first there was my mostly touched function:
-type some chars, which command begins, and then call completation from
history. Yes there is history-search-backward history-search-forward,
but they are "first word based" -->
gvim .z<touch-key_history-search-backward> do not complete .zshrc from
history, but offers: gvim something, gvim /something/other, gvim
/something/which/i/do/not/needs.now ...
I would like get only "gvim .z" based lines from history.
Im clear? Is there some function, or way to set this, plz..?

2) some way to set "ignorerece" so
cd downloads
interprets as too
cd DownLoads 

3) Some way to colorize wrong symliks differently from good pointed
symlinks (for example cyan-good/red-bad like gentoo default bash setting)? 

3) when I press Alt-backspace, cursor deletes all path. Is possible it
deletes only part of path limited by "/"

cd /q/w/e/r/some_bad<touch>
cd 
:( -- I would like:
cd /q/w/e/r/some_bad<touch>
cd /q/w/e/r/

                                    Thanx for your care,


--
karpi from
http://gismaster.liberix.cz


 


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

* Re: history-search + a few new user question
  2005-12-04 16:26 history-search + a few new user question karpi
@ 2005-12-04 17:15 ` Christian Taylor
  2005-12-04 17:49 ` Julius Plenz
                   ` (3 subsequent siblings)
  4 siblings, 0 replies; 7+ messages in thread
From: Christian Taylor @ 2005-12-04 17:15 UTC (permalink / raw)
  To: zsh-users

karpi wrote:

> 1) At first there was my mostly touched function:
> -type some chars, which command begins, and then call completation from
> history. Yes there is history-search-backward history-search-forward,
> but they are "first word based" -->
> gvim .z<touch-key_history-search-backward> do not complete .zshrc from
> history, but offers: gvim something, gvim /something/other, gvim
> /something/which/i/do/not/needs.now ...
> I would like get only "gvim .z" based lines from history.
> Im clear? Is there some function, or way to set this, plz..?

I dislike the history-search-Xward functions too. Luckily, there's:
history-beginning-search-backward (and ...-forward)
which does exactly the desired thing.

[...]

> 3) when I press Alt-backspace, cursor deletes all path. Is possible it
> deletes only part of path limited by "/"

That's because zsh by default considers "/" to be part of a word instead of a 
separator (defined in the WORDCHARS parameter). I remove "/" in my .zshrc:
WORDCHARS=${WORDCHARS//\/}
This also causes backward-word etc. to stop on "/".

hope this helps,

Christian


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

* Re: history-search + a few new user question
  2005-12-04 16:26 history-search + a few new user question karpi
  2005-12-04 17:15 ` Christian Taylor
@ 2005-12-04 17:49 ` Julius Plenz
  2005-12-05  6:35 ` Bart Schaefer
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 7+ messages in thread
From: Julius Plenz @ 2005-12-04 17:49 UTC (permalink / raw)
  To: zsh-users

* karpi <karpi.lists@email.cz> [2005-12-04 17:28]:
> 2) some way to set "ignorerece" so
> cd downloads
> interprets as too
> cd DownLoads 

Not exactly, but you can define a hash for that:

hash -d downloads=~/DownLoads
cd downloads -> ~/DownLoads

> 3) Some way to colorize wrong symliks differently from good pointed
> symlinks (for example cyan-good/red-bad like gentoo default bash
> setting)? 

That is done through the LS_COLORS variable, AFAIK.

Julius


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

* Re: history-search + a few new user question
  2005-12-04 16:26 history-search + a few new user question karpi
  2005-12-04 17:15 ` Christian Taylor
  2005-12-04 17:49 ` Julius Plenz
@ 2005-12-05  6:35 ` Bart Schaefer
  2005-12-05 10:30   ` Peter Stephenson
  2005-12-05  6:41 ` Thor Andreassen
  2005-12-05 11:22 ` karpi
  4 siblings, 1 reply; 7+ messages in thread
From: Bart Schaefer @ 2005-12-05  6:35 UTC (permalink / raw)
  To: karpi, zsh-users

On Dec 4,  5:26pm, karpi wrote:
} 
} Hello, Ive just try switch from bash.

You might want to look at

    autoload -U select-word-style
    select-word-style bash

and

    bashcompinit

I believe these are all mentioned in the manual.

} 1) At first there was my mostly touched function:
} -type some chars, which command begins, and then call completation from
} history.

Do you want words from the history completed, or entire lines from the
history found?  The term "completion" usually means individual words,
not whole lines.

I suspect what you want is history-beginning-search-* as Christian T.
already suggested.  However, also look for history-search-end in the
"ZLE Functions" section of "User Contributions" chapter in the manual.

} 2) some way to set "ignorerece" so

"rece"?  Hmm, must be Czech?

However, I see what you're getting at, and the answer is no, there is
not in general a way to make zsh behave that way unless the underlying
filesystem does so (like in cygwin).

} cd downloads
} interprets as too
} cd DownLoads 

For specific cases, such as "cd", you can fix it:

    function cd {
	emulate -LR zsh
	setopt extendedglob nonomatch
	local -a opts
	zparseopts -D -a opts s L P
	if [[ $# -eq 2 ]]
	then builtin cd $opts $1 $2
	else builtin cd $opts (#i)$*
	fi
    }

} 3) Some way to colorize wrong symliks differently from good pointed
} symlinks (for example cyan-good/red-bad like gentoo default bash setting)? 

Look in the manual for "The zsh/complist Module".

} 3) when I press Alt-backspace, cursor deletes all path. Is possible it
} deletes only part of path limited by "/"

See "select-word-style bash" as mentioned above.


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

* Re: history-search + a few new user question
  2005-12-04 16:26 history-search + a few new user question karpi
                   ` (2 preceding siblings ...)
  2005-12-05  6:35 ` Bart Schaefer
@ 2005-12-05  6:41 ` Thor Andreassen
  2005-12-05 11:22 ` karpi
  4 siblings, 0 replies; 7+ messages in thread
From: Thor Andreassen @ 2005-12-05  6:41 UTC (permalink / raw)
  To: zsh-users

On Sun, Dec 04, 2005 at 05:26:59PM +0100, karpi wrote:
[snip]
> 2) some way to set "ignorerece" so
> cd downloads
> interprets as too
> cd DownLoads 

Use the following line, it makes all completions case-insensitive:
zstyle ':completion:*' matcher-list 'm:{a-zA-Z}={A-Za-z}'

[snip]

-- 
Thor Andreassen


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

* Re: history-search + a few new user question
  2005-12-05  6:35 ` Bart Schaefer
@ 2005-12-05 10:30   ` Peter Stephenson
  0 siblings, 0 replies; 7+ messages in thread
From: Peter Stephenson @ 2005-12-05 10:30 UTC (permalink / raw)
  To: karpi.lists, zsh-users

Bart Schaefer <schaefer@brasslantern.com> wrote:
> } 2) some way to set "ignorerece" so
> 
> "rece"?  Hmm, must be Czech?
> 
> However, I see what you're getting at, and the answer is no, there is
> not in general a way to make zsh behave that way unless the underlying
> filesystem does so (like in cygwin).

Well, there's the option "nocaseglob", which interprets patterns that way,
but the problem is "downloads" is a simple string which isn't treated as a
pattern (which is why Bart didn't bother mentioning the option).  You can
use tricks to force it to be a pattern, but you'll probably think they're
too clumsy to use:

% setopt nocaseglob
% echo downloads(/)
DownLoads

Basically, anything which (1) is a pattern of some sort (2) only matches
the thing you want will do the trick.  The pattern here picks out all
directories called downloads, but using the normal globbing rules, so
"nocaseglob" is applied.

> } cd downloads
> } interprets as too
> } cd DownLoads 
> 
> For specific cases, such as "cd", you can fix it:

Another useful thing to know about (again, not quite what you asked for) is
completion's matching control, which allows it to match case-insenstively.
Assuming you are using the new completion system, try this setting:

zstyle ':completion:*' matcher-list '' 'm:{a-zA-Z}={A-Za-z}'

(You don't need "nocaseglob" for this).  Now you can type:

% cd downloads<TAB>

and the completion system will work out that the file you want is called
DownLoads and change it.  This will work for any file, indeed any form of
completion that doesn't replace the matcher list.

-- 
Peter Stephenson <pws@csr.com>                  Software Engineer
CSR PLC, Churchill House, Cambridge Business Park, Cowley Road
Cambridge, CB4 0WZ, UK                          Tel: +44 (0)1223 692070


This message has been scanned for viruses by BlackSpider MailControl - www.blackspider.com


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

* Re: history-search + a few new user question
  2005-12-04 16:26 history-search + a few new user question karpi
                   ` (3 preceding siblings ...)
  2005-12-05  6:41 ` Thor Andreassen
@ 2005-12-05 11:22 ` karpi
  4 siblings, 0 replies; 7+ messages in thread
From: karpi @ 2005-12-05 11:22 UTC (permalink / raw)
  To: zsh-users


Really tanks to you all for helpfull advices. Now im ready to work and
study on my own. (mainly thanks to history-beginning-search-*)
Sorry for my "czenglish" and typos.. ;)
Thanx for patient with me.

04/12/05 17:26, karpi.lists@email.cz napsal(a):
> 
> Hello, Ive just try switch from bash. zsh has plenty of amazing
> features, but some, i am habit-dependent on, i can not found.
> 

-- 
karpi from
http://gismaster.liberix.cz



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

end of thread, other threads:[~2005-12-05 11:22 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-12-04 16:26 history-search + a few new user question karpi
2005-12-04 17:15 ` Christian Taylor
2005-12-04 17:49 ` Julius Plenz
2005-12-05  6:35 ` Bart Schaefer
2005-12-05 10:30   ` Peter Stephenson
2005-12-05  6:41 ` Thor Andreassen
2005-12-05 11:22 ` karpi

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