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, 4 ... 11, 12, 13  Next  
Reply to topic    Gentoo Forums Forum Index Gentoo Chat
View previous topic :: View next topic  
Author Message
Abraxas
l33t
l33t


Joined: 25 May 2003
Posts: 814

PostPosted: Sun Jun 27, 2004 3:36 am    Post subject: Reply with quote

I changed the characters, took the case statement out, and it worked. The only weird thing was "transpose words" . It messed everything else up so I just deleted that. I never use it anyway. FYI my keys were ^[[1, ^[[2, etc.
_________________
Time makes more converts than reason. - Thomas Paine
Travel is fatal to prejudice, bigotry, and narrow-mindedness, and many of our people need it sorely on these accounts. - Mark Twain
Back to top
View user's profile Send private message
laz-e-coyote
n00b
n00b


Joined: 25 Jun 2004
Posts: 6

PostPosted: Sun Jun 27, 2004 11:19 am    Post subject: Reply with quote

Dolio wrote:
For red:

RPROMPT="[%{$fg_bold[red]%}%T%{$reset_color%}]"



I tried this and I get this error:

Code:
 preexec:1: bad math expression: operand expected at `%{^[[0;31m%...'
Back to top
View user's profile Send private message
pindar
Apprentice
Apprentice


Joined: 30 Apr 2004
Posts: 220

PostPosted: Sun Jun 27, 2004 6:49 pm    Post subject: Reply with quote

I've been a zsh lover and user for quite while now. I started using zsh on OS X, and now, after reading this thread, I changed my default shell in gentoo as well. One question though: is it possible to have zsh display the prompt in a different color when I su to become root? I tried this in my .zshrc:
Code:
if [ `/usr/bin/whoami` = 'root' ]
then
export PS1="%t:%{${fg_bold[red]}%n%}@%{${fg_bold[blue]}%}%m:  %~ %{${fg[white]}%}%# "
else
export PS1="%t:%{${fg_bold[green]}%n%}@%{${fg_bold[blue]}%}%m: %~ %{${fg[white]}%}%# "
fi

It works when I issue
Code:
source .zshrc

after becoming root, but how can I make it happen automagically?
Back to top
View user's profile Send private message
laz-e-coyote
n00b
n00b


Joined: 25 Jun 2004
Posts: 6

PostPosted: Sun Jun 27, 2004 6:54 pm    Post subject: Reply with quote

copy the .zshrc to /root
if that doesn't work, then try doing
alias su="su --login"
so it would load it
Back to top
View user's profile Send private message
pindar
Apprentice
Apprentice


Joined: 30 Apr 2004
Posts: 220

PostPosted: Sun Jun 27, 2004 8:15 pm    Post subject: Reply with quote

Quote:
copy the .zshrc to /root

Great, that worked! Thanks a lot!
Back to top
View user's profile Send private message
citizen428
Retired Dev
Retired Dev


Joined: 10 Jun 2002
Posts: 317
Location: Vienna, Austria

PostPosted: Tue Jun 29, 2004 3:19 pm    Post subject: Re: awsom! Reply with quote

laz-e-coyote wrote:
Zsh is amazing, the autocomplete is absolutely incredible
and a smart autocomplete, if i do "cd<tab>" it will only show me directories (or symlinks to directories)

Bash does this too, just add

complete -d cd

to your .bashrc.

Anyway, I'm playing around with ZSH for month now, I guess I'll switch over sometime completely...
Back to top
View user's profile Send private message
alyent
n00b
n00b


Joined: 20 Nov 2002
Posts: 38
Location: Vancouver BC, Canada

PostPosted: Sat Jul 03, 2004 4:54 pm    Post subject: Reply with quote

I am trying to bind ctrl-del, but whenever I press it '^' gets printed. How do I fix that?
Code:
bindkey '\e[3^'    delete-word


I also cannot get shift-tab working
Code:
bindkey '\e[0Z' reverse-menu-complete
Any Ideas?
Back to top
View user's profile Send private message
rav
Tux's lil' helper
Tux's lil' helper


Joined: 24 Nov 2003
Posts: 114

PostPosted: Sun Jul 04, 2004 11:45 am    Post subject: Reply with quote

About the menu selection, is it possible to bypass the initial list, and jump straight into menuselection? Thus stoping it from ever doing this
Code:
zsh: do you wish to see all 704 possibilities (353 lines)?

Edit: Er.. looks like "setopt NO_AUTO_LIST" does that :oops:
Also, can you get it not to insert the text in the menuselection until i press enter? Thus if I typed
Code:
/bin/z<tab><tab><tab>
it would still say
Code:
/bin/z


alyent wrote:
I am trying to bind ctrl-del, but whenever I press it '^' gets printed. How do I fix that?
Code:
bindkey '\e[3^'    delete-word


I also cannot get shift-tab working
Code:
bindkey '\e[0Z' reverse-menu-complete
Any Ideas?

Check exactly what the key is bound to for you using <ctrl>v, and use that. eg.
<ctrl>v<shift><tab> gives me '^[[Z'
<ctrl>v<shift><delete> gives me '^[[3;2~'
Back to top
View user's profile Send private message
allucid
Veteran
Veteran


Joined: 02 Nov 2002
Posts: 1314
Location: atlanta

PostPosted: Sun Jul 18, 2004 8:53 am    Post subject: Reply with quote

I'm having problems with wildard matching in certain circumstances. For example, if I use a wild card with scp it will error out without even attempting a connection:
Code:
(root):(copperhead)# scp home:~allucid/tmp/*.conf .                    (Sun,18)
zsh: no matches found: home:~allucid/tmp/*.conf


here's the relevant part of my zhsrc:
Code:
set -o noclobber

## history settings ##
HISTFILE=~/.history_zsh
HISTSIZE=3000
SAVEHIST=3000

## Fancypants completion ##
autoload -U compinit
compinit

# completion for "man" by Gossamer <gossamer@tertius.net.au> 980827
# This is damn funky. I'm going to do something similar for pinfo,
# hopefully.
compctl -f -x 'S[1][2][3][4][5][6][7][8][9]' -k '(1 2 3 4 5 6 7 8 9)' \
  - 'R[[1-9nlo]|[1-9](|[a-z]),^*]' -K 'match-man' \
  - 's[-M],c[-1,-M]' -g '*(-/)' \
  - 's[-P],c[-1,-P]' -c \
  - 's[-S],s[-1,-S]' -k '( )' \
  - 's[-]' -k '(a d f h k t M P)' \
  - 'p[1,-1]' -c + -K 'match-man' \
  -- man

# Completition
compctl -b bindkey
compctl -v export
compctl -o setopt
compctl -v unset
compctl -o unsetopt
compctl -v vared
compctl -c which
compctl -c sudo

## set home, end, and delete (these may differ depeding on your system) ##
bindkey "\e[2~" transpose-words
bindkey "\e[3~" delete-char
case $HOSTNAME in (blackmamba)
bindkey "\e[7~" beginning-of-line
bindkey "\e[8~" end-of-line
esac
case $HOSTNAME in (copperhead)
bindkey "\e[1~" beginning-of-line
bindkey "\e[4~" end-of-line
esac

## copy/paste from X clipboard function ##
copy-to-clipboard ()
{
  if [ -n "$LBUFFER$RBUFFER" ]; then
    echo $LBUFFER$RBUFFER | xclip -i
  fi
}

paste-from-clipboard ()
{
  CLIPOUT=`xclip -o`
  BUFFER=$LBUFFER$CLIPOUT$RBUFFER
}

zle -N paste-from-clipboard paste-from-clipboard
zle -N copy-to-clipboard copy-to-clipboard
bindkey "^V" paste-from-clipboard
bindkey "^X" copy-to-clipboard

## use colordiff for cvs ##
function cvsdiff () { cvs diff $@ | colordiff |less -R; }
Back to top
View user's profile Send private message
mixa
Tux's lil' helper
Tux's lil' helper


Joined: 05 Mar 2004
Posts: 133
Location: Finland

PostPosted: Sun Jul 18, 2004 10:05 am    Post subject: Reply with quote

I installed zsh yesterday and I'm loving it.. I just love the tab completion that is way more advanced than in bash. And the prompt is cool too :D
Back to top
View user's profile Send private message
RaaR
Tux's lil' helper
Tux's lil' helper


Joined: 24 Jul 2003
Posts: 125

PostPosted: Sun Jul 18, 2004 10:33 am    Post subject: Reply with quote

[quote="allucid"]I'm having problems with wildard matching in certain circumstances. For example, if I use a wild card with scp it will error out without even attempting a connection:
Code:
(root):(copperhead)# scp home:~allucid/tmp/*.conf .                    (Sun,18)
zsh: no matches found: home:~allucid/tmp/*.conf


Try:
Code:
# scp 'home:~allucid/tmp/*.conf' .
Back to top
View user's profile Send private message
mrmodin
Apprentice
Apprentice


Joined: 24 Jan 2004
Posts: 216
Location: Stockholm, Sweden

PostPosted: Sun Jul 18, 2004 11:27 am    Post subject: Reply with quote

I like it. Really!
Back to top
View user's profile Send private message
allucid
Veteran
Veteran


Joined: 02 Nov 2002
Posts: 1314
Location: atlanta

PostPosted: Sun Jul 18, 2004 8:08 pm    Post subject: Reply with quote

RaaR wrote:
allucid wrote:
I'm having problems with wildard matching in certain circumstances. For example, if I use a wild card with scp it will error out without even attempting a connection:
Code:
(root):(copperhead)# scp home:~allucid/tmp/*.conf .                    (Sun,18)
zsh: no matches found: home:~allucid/tmp/*.conf

Try:
Code:
# scp 'home:~allucid/tmp/*.conf' .


That's more of a workaround then a fix. Can I get it to work the other way like it worked in bash?
Back to top
View user's profile Send private message
RaaR
Tux's lil' helper
Tux's lil' helper


Joined: 24 Jul 2003
Posts: 125

PostPosted: Sun Jul 18, 2004 9:35 pm    Post subject: Reply with quote

allucid wrote:
RaaR wrote:
allucid wrote:
I'm having problems with wildard matching in certain circumstances. For example, if I use a wild card with scp it will error out without even attempting a connection:
Code:
(root):(copperhead)# scp home:~allucid/tmp/*.conf .                    (Sun,18)
zsh: no matches found: home:~allucid/tmp/*.conf

Try:
Code:
# scp 'home:~allucid/tmp/*.conf' .


That's more of a workaround then a fix. Can I get it to work the other way like it worked in bash?


What you're seeing is globbing.

To not have that happening again you need to edit /etc/zsh/zshrc, ~/.zshrc or wherever you define your zsh options and make sure your setopt line has the options noglob and noextendedglob.

Here's mine:
Code:
# grep setopt /etc/zsh/zshrc
setopt autocd autopushd multios histfindnodups histexpiredupsfirst sharehistory correct
setopt nobeep pushdignoredups noglob noextendedglob noclobber noautomenu mailwarning extendedhistory
Back to top
View user's profile Send private message
shm
Advocate
Advocate


Joined: 09 Dec 2002
Posts: 2380
Location: Atlanta, Universe

PostPosted: Sun Jul 18, 2004 10:03 pm    Post subject: Reply with quote

I used zsh for a long time back when bash didn't have programmable completetion. Well, it does now, and it's almost as advanced as zsh's. Zsh does have other advantages however: a lot of it's syntax is a lot simplier than bash's. For example, to unzip some files, you can just do for x in *.zip; unzip $x. (if I recall right)
_________________
what up
Back to top
View user's profile Send private message
allucid
Veteran
Veteran


Joined: 02 Nov 2002
Posts: 1314
Location: atlanta

PostPosted: Sun Jul 18, 2004 11:10 pm    Post subject: Reply with quote

RaaR wrote:
What you're seeing is globbing.

To not have that happening again you need to edit /etc/zsh/zshrc, ~/.zshrc or wherever you define your zsh options and make sure your setopt line has the options noglob and noextendedglob.

Here's mine:
Code:
# grep setopt /etc/zsh/zshrc
setopt autocd autopushd multios histfindnodups histexpiredupsfirst sharehistory correct
setopt nobeep pushdignoredups noglob noextendedglob noclobber noautomenu mailwarning extendedhistory

Can I set it to always glob except on remote hosts?
I want all of these to work:

1)
Code:
$ scp home:~/tmp/*.txt .

2)
Code:
$ scp *.txt home:~/tmp/

3)
Code:
$rm *.txt


with glob set, #1 fails, #2 and #3 work
with noglob set, #1 works, #2 and #3 fail.
I could set alias scp='noglob scp' but then #2 fails
Back to top
View user's profile Send private message
RaaR
Tux's lil' helper
Tux's lil' helper


Joined: 24 Jul 2003
Posts: 125

PostPosted: Mon Jul 19, 2004 8:41 am    Post subject: Reply with quote

Since you want some scp commands to glob and others not to, I guess you'll have to go with my first option, use the quotes to prevent globbing.

I've gotten so used to the quotes I even use them when they're not needed.
Back to top
View user's profile Send private message
allucid
Veteran
Veteran


Joined: 02 Nov 2002
Posts: 1314
Location: atlanta

PostPosted: Mon Jul 19, 2004 6:29 pm    Post subject: Reply with quote

RaaR wrote:
Since you want some scp commands to glob and others not to, I guess you'll have to go with my first option, use the quotes to prevent globbing.

I've gotten so used to the quotes I even use them when they're not needed.

I actually want them both to glob but zsh tries to glob remote directories on my local machine. Anyways, I guess that will have to do for now. I might look into functions later to see if I can write a function to handle it.

Thanks everyone for the help.
Back to top
View user's profile Send private message
kamagurka
Veteran
Veteran


Joined: 25 Jan 2004
Posts: 1026
Location: /germany/munich

PostPosted: Tue Jul 20, 2004 4:05 pm    Post subject: Reply with quote

good god, this shell rules. i especially love the 2 line prompt with the infobar on top!
2 problems, though:
1. when logging in, zsh comes up just fine.
but when i open a new aterm in X, it still comes up with bash. what do i have to change?
2. i'm using raoul's zshrc (thanks man), and i went through it and removed all of the stuff i could see i didn't need (like his cvs- and ssh-aliases), but i still have a little problem with the colors of the prompt, and it looks pretty complicated how to figure out (also because i don't want to put in or remove anything that would mess up raoul's presets); anyway:
right now i have +$USERNAME@$HOST$LOCATION, and it's all bold, and white, like so:
+kamagurka@kumquad~/data3 (only black=white)
what i want is
kamagurka:~/data3 (black still = white)
(i don't need the hostname as i only have one machine here)
the username color should also switch to red when su'ing.

now, i realize i shouldn't be troubling you like this, but the prompt part of my zshrc looks *really* complicated, and i don't know what i can leave out, what i sould modify and what i better leave alone...
if one of you gurus could tell me that, i'd be really grateful (i have a one-computer, one-user setup. no fancy stuff like "figuring out on which machine i am" is needed).

here is the prompt part of raoul's really nice zshrc:
Code:
## prompt
precmd () {
  local TERMWIDTH
  (( TERMWIDTH = ${COLUMNS} - 1 ))

  PR_FILLBAR=""
  PR_PWDLEN=""

  local promptsize=${#${(%):---(+%n@%m)---(%D{%H:%M})---}}
  local pwdsize=${#${(%):-%~}}

  if [[ "$promptsize + $pwdsize" -gt $TERMWIDTH ]]; then
    ((PR_PWDLEN=$TERMWIDTH - $promptsize))
  else
    PR_FILLBAR="\${(l.(($TERMWIDTH - ($promptsize + $pwdsize)))..${PR_HBAR}.)}"
  fi
  # print dir name in term title
  case $TERM in
    xterm*|rxvt|Eterm|Aterm)
    print -Pn "\e]0;%n@%m: %~\a"
    ;;
  esac
}

setprompt () {

  setopt prompt_subst

  autoload colors
  colors
  for color in BLACK RED GREEN YELLOW BLUE MAGENTA CYAN WHITE; do
    eval $color='%{$termcap[md]$fg[${(L)color}]%}'
    eval LIGHT_$color='%{$fg[${(L)color}]%}'
    (( count = $count + 1 ))
  done
  DEF="%{$termcap[me]%}"

  typeset -A altchar
  set -A altchar ${(s..)termcap[ac]}
  PR_SET_CHARSET="%{$termcap[eA]%}"
  PR_SHIFT_IN="%{$termcap[as]%}"
  PR_SHIFT_OUT="%{$termcap[ae]%}"
  PR_HBAR=${altchar[q]:--}
  PR_ULCORNER=${altchar[l]:--}
  PR_LLCORNER=${altchar[m]:--}
  PR_LRCORNER=${altchar[j]:--}
  PR_URCORNER=${altchar[k]:--}

  if [[ $LOCATION = HOME_LAPTOP ]]; then MCOLOR=$YELLOW
  elif [[ $LOCATION = HOME_MAIN ]]; then MCOLOR=$CYAN
  elif [[ $LOCATION = HOME_GATE ]]; then MCOLOR=$RED
  elif [[ $LOCATION = KB_NETBSD ]]; then MCOLOR=$GREEN
  elif [[ $LOCATION = KB_ALPHA ]]; then MCOLOR=$BLACK
  elif [[ $LOCATION = KB_SUN ]]; then MCOLOR=$MAGENTA
  else MCOLOR=$WHITE
  fi

  PROMPT='$PR_SET_CHARSET\
$BLACK$PR_SHIFT_IN$PR_ULCORNER$BLUE$PR_HBAR$PR_SHIFT_OUT(\
$MCOLOR+$WHITE%n$MCOLOR@$WHITE%m$MCOLOR%$PR_PWDLEN<...<%~%<<\
$BLUE)$PR_SHIFT_IN$PR_HBAR$BLACK$PR_HBAR${(e)PR_FILLBAR}$PR_HBAR$BLUE$PR_HBAR$PR_SHIFT_OUT(\
$WHITE%D{%H:%M}\
$BLUE)$PR_SHIFT_IN$PR_HBAR$BLACK$PR_URCORNER$PR_SHIFT_OUT\

$PR_SHIFT_IN$PR_LLCORNER$BLUE$PR_HBAR$PR_SHIFT_OUT%(!.#.$)$DEF '

  RPROMPT=' $BLACK$PR_SHIFT_IN$PR_HBAR$BLUE$PR_HBAR$PR_SHIFT_OUT\
($MCOLOR%(?,$GREEN\\o/,$RED\\o_ $WHITE%139(?,Seg fault,\
%130(?,Interrupt,%138(?,Bus Error,%?)))$RED _o/)\
$BLUE)$PR_SHIFT_IN$PR_HBAR$BLACK$PR_LRCORNER$PR_SHIFT_OUT$DEF'

  SPROMPT='zsh: correct $MCOLOR%R$DEF to $MCOLOR%r$DEF%b ? ([${MCOLOR}Y$DEF]es/\
[${MCOLOR}N$DEF]o/[${MCOLOR}E$DEF]dit/[${MCOLOR}A$DEF]bort) '

  PS2='$BLACK$PR_SHIFT_IN$PR_HBAR$PR_SHIFT_OUT\
$BLUE$PR_SHIFT_IN$PR_HBAR$PR_SHIFT_OUT(\
$MCOLOR%_$BLUE)$PR_SHIFT_IN$PR_HBAR$PR_SHIFT_OUT\
$BLACK$PR_SHIFT_IN$PR_HBAR$PR_SHIFT_OUT$DEF '
}

LISTPROMPT=''

setprompt


thanks for pointing this bad boy out!
_________________
If you loved me, you'd all kill yourselves today.
--Spider Jerusalem, the Word
Back to top
View user's profile Send private message
Legoguy
Apprentice
Apprentice


Joined: 22 Dec 2003
Posts: 166
Location: Edmonton, Alberta, Canada

PostPosted: Tue Jul 20, 2004 10:25 pm    Post subject: Reply with quote

I just started using this today - But I'm having a problem with the colors...

Whenever there are colors in the prompt, the completion scrwes up the width of the prompt...

For example...
Code:

legoguy@legobase / % cat <tab>

Then it gets all ugly...
Code:

legoguy@legobase / % cat bin/                  cat bin/
---- file
bin/      dev/      lib/      opt/      root/     shared/   tmp/      var/      winxp/
boot/     cvs/      etc/      home/     mnt/      proc/     sbin/     sys/      usr/     


Note the doubled cat /bin...

I try to remove this doubled thing, but can't delete past the second cat /bin, essentially making everything until the "c" in the second cat /bin part of the prompt...
I think it has something to do with some sort of problem with escaped chars...I'm researching it now...

Found it.
Whoever manages the "Gentoo" prompt theme for zsh:
You need to enclose colors in %{ <color> %}, not just ${ <color> }. I know that you do not use %{ %} because the problem I explained above happens with the Gentoo prompt...
Back to top
View user's profile Send private message
AngusYoung
Retired Dev
Retired Dev


Joined: 20 Dec 2002
Posts: 473
Location: Czech Republic

PostPosted: Wed Jul 21, 2004 12:29 am    Post subject: Reply with quote

Another converted here 8) zsh is great!
Here a small tip for my brazillians friends that may have an ABNT-2 keyboard. For your home/end key work you can try this:
Code:

# Terms
if [[ $TERM == "rxvt" || $TERM == "Eterm" ]]
then
  bindkey "^[[7~" beginning-of-line     # Home
  bindkey "^[[8~" end-of-line           # End
# Console
else
  bindkey "^[[1~" beginning-of-line     # Home
  bindkey "^[[4~" end-of-line           # End
fi
Back to top
View user's profile Send private message
allucid
Veteran
Veteran


Joined: 02 Nov 2002
Posts: 1314
Location: atlanta

PostPosted: Wed Jul 21, 2004 1:19 am    Post subject: Reply with quote

kamagurka wrote:

what i want is
kamagurka:~/data3 (black still = white)
(i don't need the hostname as i only have one machine here)
the username color should also switch to red when su'ing.


Here is all you need for the prompt you described (I included a bunch of colors you don't need just for reference). It's really not that hard, I don't know any shell programming and I can usually figure stuff out by looking at other people's examples. I am not sure if I got the bold right, I don't use bold on any terminals. You need to have this prompt set for your user and for root if you want the colors to change right (i think). I also added a little dollar sign/pound sign to the end of the promt. If you don't want it just remove $PRMT from the PROMPT= statement.
Code:
## Define some colors for easy use ##                                           
## Bold colors in caps...i think##                                             
local black=$'%{\e[0;30m%}'
local BLACK=$'%{\e[1;30m%}'
local red=$'%{\e[0;31m%}'
local RED=$'%{\e[1;31m%}'
local green=$'%{\e[0;32m%}'
local GREEN=$'%{\e[1;32m%}'
local yellow=$'%{\e[0;33m%}'
local YELLOW=$'%{\e[1;33m%}'
local blue=$'%{\e[0;34m%}'
local BLUE=$'%{\e[1;34m%}'
local purple=$'%{\e[0;35m%}'
local PURPLE=$'%{\e[1;35m%}'
local cyan=$'%{\e[0;36m%}'
local CYAN=$'%{\e[1;36m%}'
local WHITE=$'%{\e[1;37m%}'
local white=$'%{\e[0;37m%}'
local NC=$'%{\e[0m%}' # no color                                               


if [ `/usr/bin/whoami` = 'root' ] ; then
    local NAME=$GREEN'%n'$NC; local PRMT='$'
else
    local NAME=$RED'%n'$NC; local PRMT='#'
fi

PROMPT=$NAME$white':%~ '$GREEN$PRMT$NC' '
Back to top
View user's profile Send private message
asph
l33t
l33t


Joined: 25 Aug 2003
Posts: 741
Location: Barcelona, Spain

PostPosted: Wed Jul 21, 2004 10:00 am    Post subject: Reply with quote

another ksh user, when you get used to it you can't live without it
_________________
gentoo sex is updatedb; locate; talk; date; cd; strip; look; touch; finger; unzip; uptime; gawk; head; emerge --oneshot condom; mount; fsck; gasp; more; yes; yes; yes; more; umount; emerge -C condom; make clean; sleep
Back to top
View user's profile Send private message
allucid
Veteran
Veteran


Joined: 02 Nov 2002
Posts: 1314
Location: atlanta

PostPosted: Sat Jul 24, 2004 9:02 am    Post subject: Reply with quote

allucid wrote:
RaaR wrote:
What you're seeing is globbing.

To not have that happening again you need to edit /etc/zsh/zshrc, ~/.zshrc or wherever you define your zsh options and make sure your setopt line has the options noglob and noextendedglob.

Here's mine:
Code:
# grep setopt /etc/zsh/zshrc
setopt autocd autopushd multios histfindnodups histexpiredupsfirst sharehistory correct
setopt nobeep pushdignoredups noglob noextendedglob noclobber noautomenu mailwarning extendedhistory

Can I set it to always glob except on remote hosts?
I want all of these to work:

1)
Code:
$ scp home:~/tmp/*.txt .

2)
Code:
$ scp *.txt home:~/tmp/

3)
Code:
$rm *.txt


with glob set, #1 fails, #2 and #3 work
with noglob set, #1 works, #2 and #3 fail.
I could set alias scp='noglob scp' but then #2 fails

I found out I can set 'setop nonomatch' to ignore glob errors from the mailing list.
Back to top
View user's profile Send private message
oberyno
Guru
Guru


Joined: 15 Feb 2004
Posts: 467
Location: /bin/zsh

PostPosted: Sat Jul 24, 2004 12:01 pm    Post subject: Reply with quote

Great find alucid :) nonomatch also fixes my dislike of using quotes for emerging specific versions, i.e.
Code:
oberyno> emerge -p =nvidia-kernel-1.0.5336-r4                                 ~
zsh: nvidia-kernel-1.0.5336-r4 not found
oberyno> emerge -p "=nvidia-kernel-1.0.5336-r4"                               ~
                                               
These are the packages that I would merge, in order:

Calculating dependencies ...done!
[ebuild     UD] media-video/nvidia-kernel-1.0.5336-r4 [1.0.6106]
but with nonomatch
Code:
oberyno> emerge -p =nvidia-kernel-1.0.5336-r4                                 ~       
             
These are the packages that I would merge, in order:

Calculating dependencies ...done!
[ebuild     UD] media-video/nvidia-kernel-1.0.5336-r4 [1.0.6106]

Of course, zsh doesn't complete exact version emerges. I think I'll write a patch for that. Edit: The patch is done and on bugzilla. https://bugs.gentoo.org/show_bug.cgi?id=58198


Last edited by oberyno on Sat Jul 31, 2004 6:22 pm; edited 1 time in total
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, 4 ... 11, 12, 13  Next
Page 3 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