Is there anything in Zsh like .bash_profile?

Yes, it’s called ~/.zshenv. Here’s how I have $JAVA_HOME set in ~/.zshenv: export JAVA_HOME=”$(/usr/libexec/java_home)” Keep in mind, however, that zsh is not bash, so just ’cause you have to source your .bash_profile every time you open a terminal does not mean that you have to do that with zsh. With zsh, I only have to … Read more

Worth switching to zsh for casual use? [closed]

Personally, I love zsh. Generally, you probably won’t notice the difference between it and bash, until you want to quickly do things like recursive globbing: **/*.c for example. Or use suffix aliases to associate specific progs with different suffixes, so that you can “execute” them directly. The below alias lets you “run” a C source … Read more

How can I change the color of my prompt in zsh (different from normal text)?

Put this in ~/.zshrc: autoload -U colors && colors PS1=”%{$fg[red]%}%n%{$reset_color%}@%{$fg[blue]%}%m %{$fg[yellow]%}%~ %{$reset_color%}%% ” Supported Colors: red, blue, green, cyan, yellow, magenta, black, & white (from this answer) although different computers may have different valid options. Surround color codes (and any other non-printable chars) with %{….%}. This is for the text wrapping to work correctly. Additionally, … Read more

Looking for ALT+LeftArrowKey solution in zsh

Run cat then press keys to see the codes your shortcut send. (Press Ctrl+C to kill the cat when you’re done.) For me, (ubuntu, konsole, xterm) pressing Alt+← sends ^[[1;3D, so i would put in my .zshrc bindkey “^[[1;3C” forward-word bindkey “^[[1;3D” backward-word (Actually I prefer to use Ctrl + arrow to move word by … Read more

What does [nyae] mean in Zsh?

zsh has a powerful correction mechanism. If you type a command in the wrong way it suggests corrections. What happend here is that dir is an unknown command and zsh suggests gdir, while maybe ls was what you wanted. If you want to execute gdir hit y (yes) If you want to try to execute … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)