How do I reload ZSH config files without replacing the current shell?
Usually a source ~/.zshrc should do it.
Usually a source ~/.zshrc should do it.
${BASH_SOURCE[0]} equivalent in zsh is ${(%):-%N}, NOT $0(as OP said, the latter failed in .zshrc) Here % indicates prompt expansion on the value, %N indicates “The name of the script, sourced file, or shell function that zsh is currently executing, whichever was started most recently. If there is none, this is equivalent to the parameter … Read more
You need to update the environment path. Open terminal. vim $HOME/.zshrc Press “I” key for going to insert mode. add the following line in the opened file: export PATH=”$PATH:/YOUR_FLUTTER_DIR/flutter/bin” Press “Esc” then write :wq! in terminal and press enter to exit vim. Reopen the terminal and check “flutter doctor” If this solution did not work, … Read more
Try adding this at the beginning of the file: # set the trace prompt to include seconds, nanoseconds, script name and line number # This is GNU date syntax; by default Macs ship with the BSD date program, which isn’t compatible PS4=’+$(date “+%s:%N”) %N:%i> ‘ # save file stderr to file descriptor 3 and redirect … Read more
I added this line to the ~/.zshrc above the source $ZSH/oh-my-zsh.sh line: export ZSH_COMPDUMP=$ZSH/cache/.zcompdump-$HOST Then, when we source $ZSH/oh-my-zsh.sh, the compinit command dumps to that new location. Here’s where compinit is in oh-my-zsh.sh.
Download zsh with: wget -O zsh.tar.xz https://sourceforge.net/projects/zsh/files/latest/download mkdir zsh && unxz zsh.tar.xz && tar -xvf zsh.tar -C zsh –strip-components 1 cd zsh You can compile zsh yourself, for example: ./configure –prefix=$HOME make make install and then start it explicitly, or programmatically from your current shell’s startup file (put exec $HOME/bin/zsh -l in the right spot).
~/.npm is a cache that npm uses to avoid re-downloading the same package multiple times. There’s no harm in removing it. You can empty it with the command: npm cache clean
This is in fact possible without resorting to strange hacks. I’ve got this in my .zshrc RPROMPT='[%D{%L:%M:%S %p}]’ TMOUT=1 TRAPALRM() { zle reset-prompt } The TRAPALRM function gets called every TMOUT seconds (in this case 1), and here it performs a prompt refresh, and does so until a command starts execution (and it doesn’t interfere … Read more
You’d really need to use a shell function in order to accomplish that. For a simple script like that it should be pretty easy to have it working in both zsh and bash. Just place the following in a file: my_notify() { echo “exit code: $?” echo “PPID: $PPID” } Then source that file from … Read more
You can bind history-incremental-search-backward to any key, for example: bindkey -M vicmd ‘?’ history-incremental-search-backward