oh-my-zsh config file not loading
I figured this out. It was due to my config file. The part of the zsh config that wasn’t loading needed to be moved down after the plugins load. After moving that it all worked as expected.
I figured this out. It was due to my config file. The part of the zsh config that wasn’t loading needed to be moved down after the plugins load. After moving that it all worked as expected.
If you’re using a recent version of zsh you can use an anonymous function: function () { local xyz=abc # whatever } The function will be automatically executed and then thrown away, it exists only for scoping purposes. This works for any sourced file, not only zshrc.
You can modify the second line of this file: ~/.oh-my-zsh/themes/robbyrussell.zsh-theme Which looks like this: PROMPT+=’ %{$fg[cyan]%}%c%{$reset_color%} $(git_prompt_info)’ # ^ replace c with ~ Then source theme again: source ~/.zshrc It will now show the path relative to your home directory (~). For example: # BEFORE ➜ sqlboiler git:(master) # AFTER ➜ ~/open-source/sqlboiler git:(master)
You can edit your ~/.zshrc and change/add the variable: ZSH_AUTOSUGGEST_HIGHLIGHT_STYLE=’fg=value’ I have just tested the value from fg=8 to fg=5. I think fg stands for Foreground. ZSH_AUTOSUGGEST_HIGHLIGHT_STYLE=’fg=5′ **OBS: Add the above line at the end of your zshrc (after loading the plugin) ** I have found another reference here.
if you do a very simple alias in zsh, does it work? open your .zshrc file, and add the following line: alias ls=”ls -GpF” after adding that line, type this line in your Terminal: source ~/.zshrc tell us what happens. Also, just for shiggles, make sure you are using single quotes vs. double quotes, I … Read more
Changing your Theme: To edit your prompt in oh-my-zsh you need to edit a PROMPT variable in your theme instead of PS1. In your .zshrc file you will find a line that looks something like this: ZSH_THEME=”themename” oh-my-zsh stores these themes in the ~/.oh-my-zsh/themes folder. If you ls ~/.oh-my-zsh/themes you will see a list of … Read more
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
zsh uses env profile ~/.zshrc, not ~/.bashrc. so you need to append your env settings to .zshrc file and then source ~/.zshrc It must work. rbenv github link
Open ~/.zshrc, and at the very bottom of the file, add the following: if [ -f ~/.bash_profile ]; then . ~/.bash_profile; fi Every time you open the terminal, it will load whatever is defined in ~/.bash_profile (if the file exist). With that, you can keep your custom settings for zsh (colors, and etc). And you … Read more
While lhunath’s answer pushed me in the right direction, zsh does not seem to source .profile automatically. Lot’s of good info on this topic can be found on this superuser post. The adaption I’m using is putting common aliases and functions in .profile and manually sourcing them as follows: In ~/.bashrc: source ~/.profile In ~/.zshrc: … Read more