|
|
#41 |
|
All Star
Join Date: Jan 2002
Posts: 579
|
Hello,
Oh, I wasn't sure if that (2) was an error or not, but now it makes perfect sense. I'll keep it because it's a good idea, just didn't understand the logic of it originally. I'll be sure to read through the manpages to learn a bit more. Oh, and I fixed the .zprofile, just put the whole path in /sw/bin/fortune -a, duh ![]() Wohoo! it works, everything works! (knocks on wood). Now to the fun stuff, anyone else care to share their favorite tips and tricks? BTW paul, that lc is great! good visual indicator of what is a file and what is a folder very quickly. v |
|
|
|
|
|
#42 |
|
Moderator
Join Date: Jan 2002
Location: Singapore
Posts: 4,237
|
vonleigh,
Asi que de Venezuela, que lindo pais, linda gente y linda música. Parece que despacito, vamos descubriendo que en este foro se habla español tambien. Saludos... |
|
|
|
|
|
#43 |
|
Triple-A Player
Join Date: Jan 2002
Location: Madrid
Posts: 71
|
There you go, a little tip...
Use zmv to change the name of multiple files and several other things (using globbing); say you have a folder with files without an extension and you want to give them all the same extension... (this reminds me of something see this thread), then all you have to do is Code:
% zmv '(*)' '$1.mp3' If you want to see what it will do before really executing the command use zmv -n. I find it particularly useful for creating multiple symbolic links in one step (for example in my QTSS movies folder...) Of course, the function must be autoloaded first Code:
% autoload -U zmv Un saludo para todos. |
|
|
|
|
|
#44 |
|
Major Leaguer
Join Date: Jan 2002
Location: Adelaide, South Australia
Posts: 470
|
Hi Vonleigh,
good to hear that things are finally approaching equilibrium (and thanks for the kind words re "lc"). I've not got a lot to offer re functions and the like, but the following options do help make zsh fun for me. setopt AUTO_CD # if nothing else matches go to named directory [[This is quite cool: "~" to go home "/" to go to root etc etc, and it picks up the cdpath as well, so if you have a directory called "src" in your home directory you get there from anywhere with a simple "src" (as long as there's not a directory of that name in your current working directory, or a command with that name). A nice piece of sloppiness that you soon miss when working in tcsh. Renders aliases like ".." being expanded into "cd .." and so forth utterly redundant. That one becomes a simple side-effect of the AUTO_CD option. To be fair, you do occasionally have a 1-2 second head-scratch when auto-completing something (a command, mostly), until you realise that there's a candidate directory that's making multiple matches where you think there's only one. A minor growing pain!]] setopt EXTENDED_GLOB # much better brand of regexp setopt NO_HUP # don't throw away background jobs when quitting unsetopt promptcr # don't let the prompt overwrite output [[to my mind these just make zsh do the right things at the right time. Maybe they're contained above, I haven't checked carefully.]] Cheers, Paul Last edited by pmccann; 11-15-2002 at 06:37 PM. |
|
|
|
|
|
#45 | |||||||||||||||||||
|
Prospect
Join Date: Nov 2002
Posts: 1
|
I don't know if someone else has posted this because there are a lot of posts on the thread, but changing terminal's prefs is not the best way to change your shell. Use Applications/Utilities/NetInfo Managerm and the select "users" then your user id, and then change your shell in the list that shows up at the bottom. You'll probably have to click the lock and enter your admin password. This is the best way to go as you will get that shell when logging in remotely or starting up a terminal in XDarwin/OroborOSX. dan |
|||||||||||||||||||
|
|
|
|
|
#46 |
|
Triple-A Player
Join Date: Jan 2002
Location: Madrid
Posts: 71
|
I agree dboy, Netinfo is the best way to set the default shell.
Tip: Not zsh related, but cool: use w3m (fink install w3m) to quickly browse the web (I am in a dial-up connection, so speed matters), then when you get to an interesting page hit 'M' and it will open in your default browser. Additionally you can use w3m as a pager or to view man pages (w3mman). As always, take a look at the manpage for more info: Code:
% w3mman w3m |
|
|
|
|
|
#47 |
|
All Star
Join Date: Jan 2002
Posts: 579
|
Hello,
Sao, gracias por tus lindas palabras. De verdad extraño mi país y mi gente muchísimo al estar ahora en California estudiando. Que risa que todo el mundo habla español. Santin, the zmv is a great tip, thnx for sharing. Paul, Auto_CD is really good, I have taken out my .. to cd .. alias and have this instead, much better. Do you think you could explain a bit better what you mean by "better brand of regexp?" for extended glob? The others sound pretty reasonable and have added them, even though I'm not exactly sure what promptctr does. dboy, I have set it in Netinfo. If you read the thread you'll see that that is what solved my problem of sudo -s and screen dropping me in a tcsh shell. Now it seems pretty obvious, but for a while I wasn't sure what was going on. I didn't do it there first because I didn't want to commit to zsh until I had ironed out the kinks. Santin, I'll check out w3m, sounds good as I have been known to browse the web with links, just because it's quicker. Great tips guys! Hopefully we'll get more obscure ones so that you guys get something out of this thread too. ![]() v |
|
|
|
|
|
#48 |
|
Major Leaguer
Join Date: Jan 2002
Location: Adelaide, South Australia
Posts: 470
|
Hi again,
re EXTENDED_GLOB : zsh has some really nice globbing capabilities, but their capacity to confuse has led to a very restricted set of symbols being interpreted as "special" by default. For example, the use of "^" as an exclusion operator (ie, match everything *except* what's after the hat), the use of "~" as a "this and not that" (ie, match what's on the left of the tilde as long as it doesn't match what's on the right). There are others as well, but that'll do for now. If you routinely use these symbols in filenames the EXTENDED_GLOB option might trip you up on occasion, but for me the extra matching options are a welcome feature. I'm pretty sure we had a thread winding through some of these aspects relatively recently, so let's have a look... well there's a few bits and pieces about globbing here: http://forums.macosxhints.com/showth...&highlight=zsh and there's a very brief thread about extended globbing bits and pieces here: http://forums.macosxhints.com/showth...&threadid=6837 The unsetopt promptcr simply ensures that the rewriting of the prompt doesn't overwrite any screen output that you might have drawn (without a trailing carriage return). For example: ~ % setopt promptcr ~ % echo -n "Enter a number:" ~ % unsetopt promptcr ~ % echo -n "Enter a number:" Enter a number:~ % Unsurprisingly, I definitely prefer the latter behaviour. Seems that promptcr is "set" by default in order for people to be able to use fancy RHS-of-the-screen prompts. That ain't happenin' 'round here in a hurry! Cheers, Paul |
|
|
|
|
|
#49 |
|
Major Leaguer
Join Date: May 2002
Location: Sweden
Posts: 282
|
bash_completion
I just want to remind you people of the bash_completion project. It gives almost all *nix commands a reasonable completion default. Like ./configure, ssh, man, gzip ... you name it, bash_completion has it. Just put the bash_completion file in /etc and put simething like this in your /etc/bashrc:
Code:
. /etc/bash_completion http://www.caliban.org/bash/
__________________
/PEZ |
|
|
|
![]() |
|
|