4 ms·
The first bicycle skill I thought of for me when I read this: ZSH. I've seen people blaze through common tasks using ZSH that I do myself using an unholy combi
by unoti 14y ago
The first bicycle skill I thought of for me when I read this: ZSH. I've seen people blaze through common tasks using ZSH that I do myself using an unholy combination of backscroll, mouse cut and paste, and cutting and pasting into my daily work notes in another window. I've never used zsh because I never wanted to take the time to learn it.
vi is something I did take the time to learn, and it's paid off hugely over the last couple of decades.
- aangjie 14y agoAm just graduating from a novice to medium level user on vim. Consider myself a medium/novice user of the Bash shell (i.e: without awk/sed knowledge. but with find and grep). Is it worth switching to zsh at this point for me or can i just wait till i pick up awk/sed for text munging and progess on the shell usage??. I have come across zsh mentioned a few times, and given it a go too, but haven't been convinced/not understood what makes it better.
- ibotty 14y agoyes. it will be worth it. once you get past medium shell usage, you will appreciate many of zsh's features. you might have a harder time writing a posix compatible shell script though.
- aangjie 14y agoHmm.. posix compatibility is not high on my list. and hopefully, i won't need much in my future career. -- planning to learn some data analysis and mining.
- plorkyeran 14y agoPersonally I found zsh worth switching to even without spending any meaningful amount of time learning to use it. The better tab completion alone is enough to make up for the setup time and the occasional bashisms I try that don't work.
- elithrar 14y ago> Personally I found zsh worth switching to even without spending any meaningful amount of time learning to use it. Definitely. Smarter tab completion and smarter word deletion (Ctrl+W) are probably the two "most used" features for me. FWIW, after ~6 years using Bash, moving to zsh last week was a revelation. I swapped to tmux (after dabbling in screen) the week prior. Has been a good fortnight. [1] https://github.com/robbyrussell/oh-my-zsh/ https://github.com/robbyrussell/oh-my-zsh/ is a great source of zsh plug-ins and configs. I use the "simple" theme and the git, brew and gem plugins (amongst others): https://github.com/elithrar/dotfiles/blob/master/zshrc https://github.com/elithrar/dotfiles/blob/master/zshrc
- devgutt 14y agoCtrl-W works in bash too.
- djeikyb 14y agoFor this string with cursor at end: "cd /usr/share/gammu" Bash[1] deletes to the space. Zsh[2] deletes to the slash. I installed Zsh just now to find this out, and I love that Zsh appears to use ctl-w to delete words like vim does. [1]: GNU bash, version 4.2.37(2)-release (i686-pc-linux-gnu) [2]: zsh 5.0.0 (i686-pc-linux-gnu)
- devgutt 14y agoYou can use META-<Backspace> (Emacs mode)
- mej10 14y agoSort of as others said, the nice thing about switching to zsh is that you get a lot of benefit _just_ by switching, and it is very similar in basic functioning to bash. It isn't like vim or emacs where you can't do basic tasks until you learn a bunch of specific keys.
- dima55 14y agoAs others mentioned, zsh is compatible enough with bash to make switching relatively painless. There are many areas of zsh that are dramatically better, but the one that can make you fly is the fancy globbing that zsh has. More or less, you never need the 'find' tool when using zsh. For example, if I want to find all the Makefiles in this or child directories that have the string 'abc' and have been modified less than 1 hour ago, I can do $ grep -l abc **/Makefile(mh-1) If I want to look at the most-recently-modified file, I can $ less *(om[1]) If I have a symlink 'dir' that points to a directory and I want to cd to the pointed-to directory, I can $ cd dir(:A) Clearly, there are lots of codes, but you don't need to remember them, since the tab-completion gives you online help. I can type the '(' then press 'tab', and it'll give me a list of the various codes that can follow and what they mean. There are tons of others. If I want all * EXCEPT *.h I can use '*~*.h' Or for instance, say I have a directory of photos. I want to pick DSC00095.jpg through DSC00107.jpg. In bash, you cry; in zsh I say DSC<95-107>.jpg. After I've typed in the glob, I can press 'tab', and it'll expand the glob in-place, letting me know if the code worked without executing. I can then undo to get the code back and have it live in my history. There are plenty of other non-globbing-related features of zsh that make it worth looking at, but this is one that doesn't get as much press as it deserves.
- heretohelp 14y agoEmacs eliminates the need to learn a subset of the diaspora of bicycle-skills. The same shortcuts, the same skills transfer over to a wide variety of problem-solving approaches. One of those...is zsh. You just don't need it when you're an Emacs user. You get all the power of Emacs, but you can use it in the inferior shell. No need to remember weird arg registers.
- gecko 14y agoI'm a heavy Emacs user, and I don't agree with that statement. I can see three places you might be coming from and feel that way: you use Eshell; you use ansi-term mode with e.g. bash; or you simply barely ever hit shell, instead using things like dired-interactive to accomplish shell-like tasks. The last, to me, is a nonstarter. You can do many, many things using native Emacs tools, but not all. dired is not the right tool for quickly making a pile of nested directories and moving files into them based on file size, there is no Emacs take on top, etc. You can come back and say, "Fine, write some elisp for that," but to me, that's like saying you don't need to learn PowerShell because you have Explorer and VBScript. Just because there's overlapping functionality doesn't mean that one tool can substitute for the other. If you were thinking ansi-term, then learning the nuances of zsh (or fish or whatever) is still helpful. ansi-term, at most, frees you from memorizing keystrokes. Past that, you're still very much using whatever shell you're invoking. I'd want to learn zsh just as much, or as little, running in ansi-term as in Emacs. That just leaves Eshell. I like Eshell fine, but there are hard limits on what you can do with it as a shell, because it's not really a shell as much as an interactive elisp REPL with an alternative default syntax. Job management and piping are bizarre, you're still thrown into ansi-term for interactive tools (and yes, there are some tools I would prefer to use interactively), even non-interactive stuff sometimes displays incorrectly or bizarrely due to Eshell not really being a term, and so on. So while you can use Eshell most of the time, it's not a complete replacement for a real shell. Now, is it possible that Emacs tools like dired/VCS integration/etc., combined with Eshell, means you can use a "real" shell less if you want to? Yeah, sure--just like I can use folder actions and AppleScript on my desktop to replace some of my old cron jobs with on-demand drag-and-drop processing. But to say that learning zsh wouldn't be rewarding if I knew Emacs just strikes me as weird.