4 ms·
What I like best about zsh is how easy it makes normal tasks. * dont know the full name of the folder you want to cd into? Type the 1st few characters, and pre
by shantnutiwari 5y ago
What I like best about zsh is how easy it makes normal tasks.
* dont know the full name of the folder you want to cd into? Type the 1st few characters, and press tab, zsh will let you select which one you want
* Oh, and search is case insensitive. No more spending hours banging at the tab, wondering why autocomplete isnt working, just because you typed "projects" instead of "Projects"
* history search is great-- type the 1st few lines of a command and press up, it will take you to the last time the command was used
* Oh my zsh gives you a lot of cool utilities-- instead of
git commit -a -m "message"
I can do
gcam "message"
Moving to zsh was the best decision I made.
- yjftsjthsd-h 5y agoI feel obligated to point out that this is mostly doable with BASH. * I don't understand how this is different than usual tab-completion; might just be missing something. You can stick `set show-all-if-ambiguous on` in .inputrc to make it activate on 1 tab instead of 2. * `set completion-ignore-case on` in .inputrc * https://askubuntu.com/questions/59846/bash-history-search-partial-up-arrow https://askubuntu.com/questions/59846/bash-history-search-pa... * `alias gcam='git commit -a -m'`, although I assume you're pointing out that it gives you a bunch of default aliases?
- wener 5y agoWait, are you talking about zsh or bash, because my bash have them all, what's next ?
- freeplay 5y agoI use zsh as well but most of what you highlighted is easily done in bash > Oh, and search is case insensitive. No more spending hours banging at the tab, wondering why autocomplete isnt working echo 'set completion-ignore-case On' >> ~/.inputrc > history search is great-- type the 1st few lines of a command and press up, it will take you to the last time the command was used CTRL+R and begin typing. CTRL+R again to go to next result. > instead of git commit -a -m "message" I can do gcam "message" echo 'alias gcam="git commit -a -m"' >> ~/.bashrc
- jdhendrickson 5y agoI'm glad you like ZSH, for those wondering if you can do similar things in Bash (lots of non technical folks on the site these days). * I have to admit I tend to run mlocate on my systems and grep for full file paths instead of using tab completion if I don't know what the directory path is. However if you want auto complete with a list to pick from like ZSH bind 'set show-all-if-ambiguous on' bind 'TAB:menu-complete' in your inputrc will do the trick. * echo set completion-ignore-case on | sudo tee -a /etc/inputrc (use .bashrc instead of input if you only want to set this for your own user) * ctrl + r type part of your command history search in bash * alias gcam='git commit -a -m' ZSH definitely has a lot of cool things (globbing is really nice for instance), but Bash is ubiquitous and it's good to know how to make your life easier if you are working on a server that doesn't have your fave shell installed. Happy hacking! When I started typing this there were no replies, I got distracted by a work slack, and came back to hit submit, and there are two basically duplicates. An excellent reminder that none of us are actually the main character so to speak.
- arp242 5y agoControl+r is search and not quite the same, since it matches everywhere rather than just at the start (maybe there's a way to do it, but I never liked the way C-r behaved in the first place so I never checked). However, you can use "history-search-backward" (and -forward) in your inputrc to get it.