Change tmux default to zsh

From man tmux: default-shell path Specify the default shell. This is used as the login shell for new windows when the default-command option is set to empty, and must be the full path of the executable. When started tmux tries to set a default value from the first suitable of the SHELL environment variable, the … Read more

How to iterate through string one word at a time in zsh

In order to see the behavior compatible with Bourne shell, you’d need to set the option SH_WORD_SPLIT: setopt shwordsplit # this can be unset by saying: unsetopt shwordsplit things=”one two” for one_thing in $things; do echo $one_thing done would produce: one two However, it’s recommended to use an array for producing word splitting, e.g., things=(one … Read more

Add newline to Oh My ZSH Theme

I was actually searching for the same answer. But my needs was a little more specific since I only wanted to add a newline in the agnoster theme, the one I’m using now. In my research, I find a lot of forked themes that already do it, but I thought that this was an overkill … Read more

Unable to have Bash-like C-x-e in Zsh

I’m using it with VIM mode. Basically ESC-v (or simply v if already in command mode) opens the terminal. It is setup by: autoload -U edit-command-line zle -N edit-command-line bindkey -M vicmd v edit-command-line Here is how to setup it in emacs mode: autoload edit-command-line zle -N edit-command-line bindkey ‘^Xe’ edit-command-line Use ‘bindkey -e’ to … Read more

Can I use autocompletion for kubectl in zsh?

Both bash and zsh supports scripts that completes printed command when you press <TAB>. The feature is called Programmable completion, and you can find more details about that here: zsh completion. Fortunately, you don’t need to write your own script – kubectl provides it for zsh > 5.2. Try running this command: source <(kubectl completion … Read more

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