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"]
path = .config/nvim
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"]
path = .zsh/plugins/zsh-vim-mode
url = https://github.com/softmoth/zsh-vim-mode.git
@ -19,3 +16,6 @@
[submodule ".zsh/plugins/zsh-completions"]
path = .zsh/plugins/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

45
.zshrc
View file

@ -4,6 +4,8 @@ export ZSH="$HOME/.oh-my-zsh"
# Would you like to use another custom folder than $ZSH/custom?
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
# 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
@ -68,29 +70,34 @@ setopt HIST_IGNORE_DUPS
setopt HIST_IGNORE_ALL_DUPS
setopt COMPLETE_ALIASES
ZSH_AUTOSUGGEST_USE_ASYNC="true"
ZSH_AUTOSUGGEST_STRATEGY=(history)
if [[ -a $OH_MY_ZSH ]]; then
ZSH_AUTOSUGGEST_USE_ASYNC="true"
ZSH_AUTOSUGGEST_STRATEGY=(history)
MODE_CURSOR_DEFAULT="white blinking bar"
MODE_CURSOR_VICMD="magenta steady block"
MODE_CURSOR_VIINS="white blinking bar"
MODE_CURSOR_SEARCH="cyan steady underline"
MODE_CURSOR_REPLACE="red steady underline"
MODE_CURSOR_VISUAL="magenta steady block"
MODE_CURSOR_DEFAULT="white blinking bar"
MODE_CURSOR_VICMD="magenta steady block"
MODE_CURSOR_VIINS="white blinking bar"
MODE_CURSOR_SEARCH="cyan steady underline"
MODE_CURSOR_REPLACE="red steady underline"
MODE_CURSOR_VISUAL="magenta steady block"
# Which plugins would you like to load?
# Standard plugins can be found in ~/.oh-my-zsh/plugins/*
# Custom plugins may be added to ~/.oh-my-zsh/custom/plugins/
# Example format: plugins=(rails git textmate ruby lighthouse)
# Add wisely, as too many plugins slow down shell startup.
# plugins=(git)
plugins=(colored-man-pages colorize command-not-found git zsh-completions zsh-autosuggestions zsh-syntax-highlighting history-substring-search zsh-vim-mode)
# Which plugins would you like to load?
# Standard plugins can be found in ~/.oh-my-zsh/plugins/*
# Custom plugins may be added to ~/.oh-my-zsh/custom/plugins/
# Example format: plugins=(rails git textmate ruby lighthouse)
# Add wisely, as too many plugins slow down shell startup.
# plugins=(git)
plugins=(colored-man-pages colorize command-not-found git zsh-completions zsh-autosuggestions zsh-syntax-highlighting history-substring-search zsh-vim-mode)
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 '^J' history-substring-search-down
bindkey -M vicmd '^K' history-substring-search-up
bindkey -M vicmd '^J' history-substring-search-down
else
PS1=$'%b%n@%M %~
%(!.#.$) '
fi
gpg-connect-agent updatestartuptty /bye