Fix key settings (Home/End/Insert/Delete) in .zshrc when running Zsh in Terminator Terminal Emulator

To know the code of a key, execute cat, press enter, press the key, then Ctrl+C. For me, Home sends ^[[H and End ^[[F, so i can put i my .zshrc in my home dir bindkey “^[[H” beginning-of-line bindkey “^[[F” end-of-line bindkey “^[[3~” delete-char These codes could change with the terminal emulator you use. autoload … Read more

How to automatically activate virtualenvs when cd’ing into a directory

Add following in your .bashrc or .zshrc function cd() { builtin cd “$@” if [[ -z “$VIRTUAL_ENV” ]] ; then ## If env folder is found then activate the vitualenv if [[ -d ./.env ]] ; then source ./.env/bin/activate fi else ## check the current folder belong to earlier VIRTUAL_ENV folder # if yes then … Read more

Which shell I am using in mac

To see what shell is currently running – which may or may not be your default shell – use: # Prints something like ‘/bin/ksh’ or ‘-zsh’ # See bottom section if you always need the full path. ps -o comm= $$ The above assumes that the running shell is a POSIX-compatible shell. If the running … Read more

oh my zsh showing weird character ‘?’ on terminal

Installing a powerline patched font will solve this. This official documentation provides description about installing poweline fonts. There are two ways to enable powerline patched font in iTerm2. Set a powerline patched font as default. Set a powerline patched font for only Non-ASCII characters and use another font for code. Bonus: Collection of powerline patched … Read more

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