Insert conditional for when no oh-my-zsh script is found, which provides the user with a minimal prompt

This commit is contained in:
David Holland 2020-01-24 01:31:55 +01:00
parent 77bf134492
commit cd19ed53e4
Signed by: DustVoice
GPG key ID: 47068995A14EDCA9
2 changed files with 29 additions and 22 deletions

6
.gitmodules vendored
View file

@ -4,9 +4,6 @@
[submodule ".config/nvim"] [submodule ".config/nvim"]
path = .config/nvim path = .config/nvim
url = git@github.com:DustVoice/nvim.git url = git@github.com:DustVoice/nvim.git
[submodule ".oh-my-zsh"]
path = .oh-my-zsh
url = https://github.com/ohmyzsh/ohmyzsh.git
[submodule ".zsh/plugins/zsh-vim-mode"] [submodule ".zsh/plugins/zsh-vim-mode"]
path = .zsh/plugins/zsh-vim-mode path = .zsh/plugins/zsh-vim-mode
url = https://github.com/softmoth/zsh-vim-mode.git url = https://github.com/softmoth/zsh-vim-mode.git
@ -19,3 +16,6 @@
[submodule ".zsh/plugins/zsh-completions"] [submodule ".zsh/plugins/zsh-completions"]
path = .zsh/plugins/zsh-completions path = .zsh/plugins/zsh-completions
url = https://github.com/zsh-users/zsh-completions url = https://github.com/zsh-users/zsh-completions
[submodule ".oh-my-zsh"]
path = .oh-my-zsh
url = https://github.com/ohmyzsh/ohmyzsh.git

9
.zshrc
View file

@ -4,6 +4,8 @@ export ZSH="$HOME/.oh-my-zsh"
# Would you like to use another custom folder than $ZSH/custom? # Would you like to use another custom folder than $ZSH/custom?
ZSH_CUSTOM="$HOME/.zsh" ZSH_CUSTOM="$HOME/.zsh"
OH_MY_ZSH="$ZSH/oh-my-zsh.sh"
# Set name of the theme to load --- if set to "random", it will # Set name of the theme to load --- if set to "random", it will
# load a random theme each time oh-my-zsh is loaded, in which case, # load a random theme each time oh-my-zsh is loaded, in which case,
# to know which specific one was loaded, run: echo $RANDOM_THEME # to know which specific one was loaded, run: echo $RANDOM_THEME
@ -68,6 +70,7 @@ setopt HIST_IGNORE_DUPS
setopt HIST_IGNORE_ALL_DUPS setopt HIST_IGNORE_ALL_DUPS
setopt COMPLETE_ALIASES setopt COMPLETE_ALIASES
if [[ -a $OH_MY_ZSH ]]; then
ZSH_AUTOSUGGEST_USE_ASYNC="true" ZSH_AUTOSUGGEST_USE_ASYNC="true"
ZSH_AUTOSUGGEST_STRATEGY=(history) ZSH_AUTOSUGGEST_STRATEGY=(history)
@ -88,9 +91,13 @@ plugins=(colored-man-pages colorize command-not-found git zsh-completions zsh-au
autoload -U compinit && compinit autoload -U compinit && compinit
source $ZSH/oh-my-zsh.sh source $OH_MY_ZSH
bindkey -M vicmd '^K' history-substring-search-up bindkey -M vicmd '^K' history-substring-search-up
bindkey -M vicmd '^J' history-substring-search-down bindkey -M vicmd '^J' history-substring-search-down
else
PS1=$'%b%n@%M %~
%(!.#.$) '
fi
gpg-connect-agent updatestartuptty /bye gpg-connect-agent updatestartuptty /bye