Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
ZSH users (lovers?) thread
View unanswered posts
View posts from last 24 hours

Goto page Previous  1, 2, 3 ... 6, 7, 8 ... 11, 12, 13  Next  
Reply to topic    Gentoo Forums Forum Index Gentoo Chat
View previous topic :: View next topic  
Author Message
Shadow Skill
Veteran
Veteran


Joined: 04 Dec 2004
Posts: 1023

PostPosted: Sat Mar 18, 2006 5:51 am    Post subject: Reply with quote

type rehash hit entre and then try to execute gaim.
_________________
Ware wa mutekinari.
Wa ga kage waza ni kanau mono nashi.
Wa ga ichigeki wa mutekinari.

"First there was nothing, so the lord gave us light. There was still nothing, but at least you could see it."
Back to top
View user's profile Send private message
ePharaoh
n00b
n00b


Joined: 10 Dec 2005
Posts: 8

PostPosted: Sat Mar 18, 2006 5:57 am    Post subject: Reply with quote

my zshrc file, which has been fine tuned over them years:
http://pastebin.com/608652

particularly, try out the RPROMPT.
it hasn't too many comments, but it should be easy to figure it out.
Back to top
View user's profile Send private message
WladyX
Guru
Guru


Joined: 25 Nov 2004
Posts: 503
Location: Romania

PostPosted: Sat Mar 18, 2006 8:41 am    Post subject: Reply with quote

sobers_2002 wrote:
hi

i have this small issue with zsh. When i emerge something, i have to open a new terminal to see the completion for the new files. However that's not the case with bash. So what am i missing??. For eg if i emerge gaim, i can't run it from the same terminal that emerged it. I have to open up a new one for zsh to see gaim.

thanks
Saurabh


i guess you have to rehash :wink:
_________________
We are not alone.
Back to top
View user's profile Send private message
enrique
Guru
Guru


Joined: 03 Sep 2002
Posts: 342
Location: Denmark

PostPosted: Sat Mar 18, 2006 8:15 pm    Post subject: Reply with quote

Type "rehash" and look in the manual for more information, I don't have zsh installed on this box, so I can't tell you.
_________________
Kind regards, enrique
Workstation,HTPC,Powerbook
Back to top
View user's profile Send private message
jsosic
Guru
Guru


Joined: 02 Aug 2004
Posts: 510
Location: Split (Croatia)

PostPosted: Mon Mar 27, 2006 1:34 am    Post subject: Reply with quote

Hi guys!
I'm using zsh for over a year now... And I've found two good tips in this thread, so I'll post a one too. I've noticed nobody commented on compctl command, so here it goes:
Code:
compctl -g '*.(jpg|jpeg|gif|bmp|tiff|pcx|pbm|pgm|ppm|xpm|pm|xwd|ps|eps|png)' qiv

Note that qiv is image viewer ;)

Also, I've been trying to force 'eix' to complete just as 'emerge', but I haven't found a way to do it... If anyone knows, please share that info in this thread.

Z-shell is definitely one of the three unix stuff that deserve to be on the podium. Other two are Gentoo distribution and Fvwm.
Back to top
View user's profile Send private message
Treiks
Tux's lil' helper
Tux's lil' helper


Joined: 15 Apr 2004
Posts: 82

PostPosted: Thu Jun 08, 2006 11:34 am    Post subject: Reply with quote

I am using:
zsh-completion-20050120
zsh-4.3.2-r1
and
screen-4.0.2-r4

and my problem is history in zsh while running screen.

Without screen program in my zsh, UP and DOWN arrows browses history so when I write for example
P and press arrow (UP or DOWN) zsh search in history for command program start with capital P. And it's OK. I browse only commands with capital P.

But while running screen and writeing P and next UP/DOWN arrow it browse all history command (showing previous/next command). How define .screenrc or whatever zsh works in screen like without it.
Back to top
View user's profile Send private message
jsosic
Guru
Guru


Joined: 02 Aug 2004
Posts: 510
Location: Split (Croatia)

PostPosted: Thu Jun 08, 2006 11:47 am    Post subject: Reply with quote

Maybe you don't have this?
Code:
HISTSIZE=5000
HISTFILE=~/.zsh/history
SAVEHIST=5000
setopt APPEND_HISTORY           # append the new history to the old


Hope it helps.

BTW screen+zsh is a KILLER combination :) you can add func to your zshrc and then see name of the tabs in the screen tabline! :) I'll post a pic this weekend, it's fuckin' awesome!
Back to top
View user's profile Send private message
Treiks
Tux's lil' helper
Tux's lil' helper


Joined: 15 Apr 2004
Posts: 82

PostPosted: Thu Jun 08, 2006 4:51 pm    Post subject: Reply with quote

I have this but I think you do not understand my problem (sorry for my english).
For exemple.
1) zsh without screen
in zsh I write 'p' and next I'll use UP arrow - zsh will find in .zhistory file I was uning 'p'ine and add after my p - 'ine' - when I press UP arrow again zsh again will find in history I was uning 'p's aux (and 's aux' add after my p)... and so...

2) zsh+screen
after i write p and press UP arrow - zsh clear my 'p' and insert last command from history file (exit) after another UP arrow display command from history (before last one)...
Back to top
View user's profile Send private message
jsosic
Guru
Guru


Joined: 02 Aug 2004
Posts: 510
Location: Split (Croatia)

PostPosted: Thu Jun 08, 2006 5:40 pm    Post subject: Reply with quote

It seems that screen somehow interferes with pageup/down keys... I've had a similar problem with delete, wich was producing tildas in screen (~). I've solved it with modifying screen termcap.

type cat in zsh, and see the output for page up and page down.
then, enter screen zsh, and do it again (cat <return>, <pageup><pagedown>).

If it's the same then I don't have a clue. If it's not, than you must set up your .zshrc accordinly (for example, test if $TERM is screen, if it is use second pair of keybindings, if it's not, use first pair).

Hepe this helps.
Back to top
View user's profile Send private message
Treiks
Tux's lil' helper
Tux's lil' helper


Joined: 15 Apr 2004
Posts: 82

PostPosted: Thu Jun 08, 2006 7:37 pm    Post subject: Reply with quote

jsosic wrote:

type cat in zsh, and see the output for page up and page down.
then, enter screen zsh, and do it again (cat <return>, <pageup><pagedown>).


$TERM is screen and output in both cases is the same :(


In .zshrc I have thos bingings:
Code:

#v+
bindkey `tput khome` beginning-of-line >/dev/null 2>&1
bindkey `tput kend` end-of-line >/dev/null 2>&1
bindkey `tput kdch1` delete-char >/dev/null 2>&1
bindkey `tput kpp` up-history >/dev/null 2>&1
bindkey `tput knp` end-of-history >/dev/null 2>&1
bindkey `tput kcuu1` history-beginning-search-backward >/dev/null 2>&1
bindkey `tput kcud1` history-beginning-search-forward >/dev/null 2>&1
#v-

But in screen it do not work.

Without screen:

Code:

[treiks@wolfi~]$ bindkey | grep history
"^N" down-line-or-history
"^O" accept-line-and-down-history
"^P" up-history
"^R" history-incremental-search-backward
"^S" history-incremental-search-forward
"^Xr" history-incremental-search-backward
"^Y" end-of-history
"^[ " expand-history
"^[!" expand-history
"^[," _history-complete-newer
"^[/" _history-complete-older
"^[<" beginning-of-buffer-or-history
"^[>" end-of-buffer-or-history
"^[N" history-search-forward
"^[OA" up-line-or-history
"^[OB" down-line-or-history
"^[P" history-search-backward
"^[[5~" up-history
"^[[6~" end-of-history
"^[[A" history-beginning-search-backward
"^[[B" history-beginning-search-forward
"^[n" history-search-forward
"^[p" history-search-backward
[treiks@wolfi~]$


Inside screen:
Code:

[treiks@wolfi~]$  bindkey | grep history
"^N" down-line-or-history
"^O" accept-line-and-down-history
"^P" up-history
"^R" history-incremental-search-backward
"^S" history-incremental-search-forward
"^Xr" history-incremental-search-backward
"^Y" end-of-history
"^[ " expand-history
"^[!" expand-history
"^[," _history-complete-newer
"^[/" _history-complete-older
"^[<" beginning-of-buffer-or-history
"^[>" end-of-buffer-or-history
"^[N" history-search-forward
"^[OA" history-beginning-search-backward
"^[OB" history-beginning-search-forward
"^[P" history-search-backward
"^[[5~" up-history
"^[[6~" end-of-history
"^[[A" up-line-or-history
"^[[B" down-line-or-history
"^[n" history-search-forward
"^[p" history-search-backward
[teiks@wolfi~]$


But here - history-beginning-search-backward and history-beginning-search-forward - do not work.
I do not know how to bind it correct.


Last edited by Treiks on Thu Jun 08, 2006 8:08 pm; edited 3 times in total
Back to top
View user's profile Send private message
jsosic
Guru
Guru


Joined: 02 Aug 2004
Posts: 510
Location: Split (Croatia)

PostPosted: Thu Jun 08, 2006 7:57 pm    Post subject: Reply with quote

Try this:
Code:
# <PageUp> & <PageDown>
bindkey "^[[5~" history-beginning-search-backward
bindkey "^[[6~" history-beginning-search-forward
Back to top
View user's profile Send private message
Treiks
Tux's lil' helper
Tux's lil' helper


Joined: 15 Apr 2004
Posts: 82

PostPosted: Thu Jun 08, 2006 8:13 pm    Post subject: Reply with quote

This helped:
Code:

bindkey "^[[A" 'history-beginning-search-backward'
bindkey "^[[B" 'history-beginning-search-forward'


Thanks for clue :)
Back to top
View user's profile Send private message
opentaka
l33t
l33t


Joined: 18 Feb 2005
Posts: 840
Location: Japan

PostPosted: Fri Jul 28, 2006 10:40 am    Post subject: Reply with quote

oh man..
zsh seriously rocks!!

ps:
I just emerge --sync'd and I felt like updating cache was faster than bash...

well, maybe it really is

zsh

Code:

pappie ~ # zsh
pappie# time emerge metadata
*** Deprecated use of action 'metadata', use '--metadata' instead
skipping sync

>>> Updating Portage cache:  100%

emerge metadata  6.44s user 1.46s system 94% cpu 8.348 total
pappie#


bash
Code:

pappie ~ # time emerge metadata
*** Deprecated use of action 'metadata', use '--metadata' instead
skipping sync

>>> Updating Portage cache:  100%


real    0m8.296s
user    0m6.458s
sys     0m1.412s
pappie ~ # 

_________________
"Being defeated is often a temporary condition. Giving up is what makes it permanent" - Marilyn vos Savant
Back to top
View user's profile Send private message
sn4ip3r
Guru
Guru


Joined: 14 Dec 2002
Posts: 325
Location: Tallinn, Estonia

PostPosted: Fri Jul 28, 2006 11:01 am    Post subject: Reply with quote

opentaka wrote:

emerge metadata 6.44s user 1.46s system 94% cpu 8.348 total
...
real 0m8.296s
user 0m6.458s
sys 0m1.412s


Zsh took 8.348s and bash took 8.296s, bash seems to be faster :P
Back to top
View user's profile Send private message
opentaka
l33t
l33t


Joined: 18 Feb 2005
Posts: 840
Location: Japan

PostPosted: Fri Jul 28, 2006 11:47 am    Post subject: Reply with quote

sn4ip3r wrote:
opentaka wrote:

emerge metadata 6.44s user 1.46s system 94% cpu 8.348 total
...
real 0m8.296s
user 0m6.458s
sys 0m1.412s


Zsh took 8.348s and bash took 8.296s, bash seems to be faster :P


oops was looking at the wrong stuff.
but I still feel like so :)
_________________
"Being defeated is often a temporary condition. Giving up is what makes it permanent" - Marilyn vos Savant
Back to top
View user's profile Send private message
Necoro
Veteran
Veteran


Joined: 18 Dec 2005
Posts: 1912
Location: München (Germany)

PostPosted: Wed Oct 18, 2006 10:10 pm    Post subject: Reply with quote

So ... at the moment I am just playing around a little bit with zsh :) ... seems quite nice (though i don't know whether all the nice things I learn(ed) while reading the user's guide will be accessible in a few weeks ^^) ...

However: I just wondered if anyone of the zsh-gurus in this forum might post his/her zshrc somewhere. There were some at the very beginning of this thread, but all links now bring a 404 :)

So far,
Nec

(and btw: is there something similar to the "Ctrl-R"-history-search function of bash i used quite often?)
_________________
Inter Deum Et Diabolum Semper Musica Est.
Back to top
View user's profile Send private message
ppurka
Advocate
Advocate


Joined: 26 Dec 2004
Posts: 3067

PostPosted: Tue Oct 24, 2006 9:03 pm    Post subject: Reply with quote

Necoro_dM wrote:
(and btw: is there something similar to the "Ctrl-R"-history-search function of bash i used quite often?)
It is still CTRL-R in zsh.

If CTRL-R does not work by default, try adding this to your zshrc:
Code:
bindkey "^R"                history-incremental-search-backward
bindkey "^S"                history-incremental-search-forward
Back to top
View user's profile Send private message
Necoro
Veteran
Veteran


Joined: 18 Dec 2005
Posts: 1912
Location: München (Germany)

PostPosted: Tue Oct 24, 2006 9:36 pm    Post subject: Reply with quote

Okay :) thanks
_________________
Inter Deum Et Diabolum Semper Musica Est.
Back to top
View user's profile Send private message
Allix
n00b
n00b


Joined: 13 Sep 2006
Posts: 69

PostPosted: Tue Oct 24, 2006 11:40 pm    Post subject: Reply with quote

Necoro_dM wrote:


I just wondered if anyone of the zsh-gurus in this forum might post his/her zshrc somewhere.


here is mine, its not really showing off zsh uniqueness at all...

Quote:
#!/bin/zsh
#
## completion
autoload -U compinit
compinit

export HISTSIZE=2000
export HISTFILE="$HOME/.history"
export SAVEHIST=$HISTSIZE

zstyle ':completion:*:descriptions' format '%U%B%d%b%u'
zstyle ':completion:*:warnings' format '%BSorry, no matches for: %d%b'
## correction
setopt correctall
setopt hist_ignore_all_dups
setopt autocd
setopt extendedglob
## prompt
autoload -U promptinit
promptinit
prompt gentoo

alias ls="ls --color=auto"
alias l="ls -la --color=auto"
alias l.='ls -d .[a-zA-Z]* --color=auto'
alias ll="ls -l --color=auto"
alias lsd="find . -maxdepth 1 -type d|columnize"
alias d="find . -maxdepth 1 -type d|columnize"

eval `dircolors -b`
export ZLS_COLORS=$LS_COLORS
Back to top
View user's profile Send private message
Bapt
Veteran
Veteran


Joined: 14 Apr 2003
Posts: 1152
Location: Paris

PostPosted: Wed Oct 25, 2006 1:21 pm    Post subject: Reply with quote

jsosic wrote:
Also, I've been trying to force 'eix' to complete just as 'emerge', but I haven't found a way to do it... If anyone knows, please share that info in this thread.


Hi you can't comple eix with comctl like you've done with qiv.
You should have a look at zsh-completion package.

and write your own _eix completion function using the _gentoo_package function to get available completions :
Code:
 Usage: _gentoo_packages installed|available|installed_versions|available_versions|binary|category|useflag


The last one I added is _portage_utils which is quite simple.

If you do it, please don't forget to file a bug, in order to get it in zsh-completion

for the emerge completion, the function is in _portage.
Back to top
View user's profile Send private message
Gogiel
Guru
Guru


Joined: 11 Nov 2004
Posts: 347

PostPosted: Thu Nov 02, 2006 10:32 pm    Post subject: Reply with quote

My PROMPT is
Code:
PROMPT=$'%{\e[0;32m%}%B[%b%{\e[0m%}%n%{\e[0;32m%}@%{\e[0m%}%(4c,./%1~,%~)%{\e[0;32m%}%B]%b% %(?,%{\e[0;32m%}:%)%{\e[0m%},%{\e[0;31m%}:(%{\e[0m%}) %# '

Last part is tricky. When previous program exit with error there's red ':(' in prompt. Otherwise there's green ':)'.
_________________
Jabber: gogiel@gmail.com
Back to top
View user's profile Send private message
ppurka
Advocate
Advocate


Joined: 26 Dec 2004
Posts: 3067

PostPosted: Fri Nov 03, 2006 1:47 am    Post subject: Reply with quote

Gogiel wrote:
My PROMPT is
Code:
PROMPT=$'%{\e[0;32m%}%B[%b%{\e[0m%}%n%{\e[0;32m%}@%{\e[0m%}%(4c,./%1~,%~)%{\e[0;32m%}%B]%b% %(?,%{\e[0;32m%}:%)%{\e[0m%},%{\e[0;31m%}:(%{\e[0m%}) %# '

Last part is tricky. When previous program exit with error there's red ':(' in prompt. Otherwise there's green ':)'.
That is a very interesting prompt!
Back to top
View user's profile Send private message
Shadow Skill
Veteran
Veteran


Joined: 04 Dec 2004
Posts: 1023

PostPosted: Fri Nov 03, 2006 6:06 am    Post subject: Reply with quote

Does anyone know a way to get portage to automatically "rehash" so that users don't have to type that manually for zsh to find a newly installed app?
_________________
Ware wa mutekinari.
Wa ga kage waza ni kanau mono nashi.
Wa ga ichigeki wa mutekinari.

"First there was nothing, so the lord gave us light. There was still nothing, but at least you could see it."
Back to top
View user's profile Send private message
Bapt
Veteran
Veteran


Joined: 14 Apr 2003
Posts: 1152
Location: Paris

PostPosted: Fri Nov 03, 2006 10:35 am    Post subject: Reply with quote

Have a look at this : http://www.zsh.org/mla/workers/1998/msg00566.html
Back to top
View user's profile Send private message
benol
n00b
n00b


Joined: 22 Oct 2005
Posts: 26

PostPosted: Sat Nov 18, 2006 8:21 pm    Post subject: Reply with quote

Hi!

I edited my /etc/zsh/zshrc file to load the complist module, but at the same time I wanted to make my own .zshrc universal and load the module from there, just to make sure it gets loaded (in case I switch to another computer). Now ZSH complains, that
Code:
zmodload:2: module zsh/complist already loaded.

How can I check if the module has already been loaded in my .zshrc?
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Gentoo Chat All times are GMT
Goto page Previous  1, 2, 3 ... 6, 7, 8 ... 11, 12, 13  Next
Page 7 of 13

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum