From 531c41cdfee9e3bbba16d0bf19ca973ad4bb4af5 Mon Sep 17 00:00:00 2001 From: LE Manh Cuong Date: Tue, 1 Dec 2015 11:50:55 +0700 Subject: Allow loading themes from predefined list --- templates/zshrc.zsh-template | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'templates') diff --git a/templates/zshrc.zsh-template b/templates/zshrc.zsh-template index 44e8b0d1b..baedf0675 100644 --- a/templates/zshrc.zsh-template +++ b/templates/zshrc.zsh-template @@ -7,6 +7,12 @@ export ZSH=$HOME/.oh-my-zsh # time that oh-my-zsh is loaded. ZSH_THEME="robbyrussell" +# Set list of themes to load +# Setting this variable when ZSH_THEME=random +# cause zsh load theme from this variable instead of +# looking in ~/.oh-my-zsh/themes/ +# ZSH_THEME_RANDOM_CANDICATES=() + # Uncomment the following line to use case-sensitive completion. # CASE_SENSITIVE="true" -- cgit v1.2.3-70-g09d2 From 5e77e00ad522a5d6a84067d22015b85b0080a19f Mon Sep 17 00:00:00 2001 From: LE Manh Cuong Date: Tue, 1 Dec 2015 12:03:00 +0700 Subject: Some improvements - Adding documentation - Note the effect empty array - Fix spelling - Using new test `[[...]]` --- README.markdown | 8 ++++++++ oh-my-zsh.sh | 6 +++--- templates/zshrc.zsh-template | 3 ++- 3 files changed, 13 insertions(+), 4 deletions(-) (limited to 'templates') diff --git a/README.markdown b/README.markdown index 9d7210f77..0d3144dde 100644 --- a/README.markdown +++ b/README.markdown @@ -88,6 +88,14 @@ If you're feeling feisty, you can let the computer select one randomly for you e ZSH_THEME="random" # (...please let it be pie... please be some pie..) ``` +And if you want to pick random theme from a list of your favorite themes: + +```shell +ZSH_THEM_RANDOM_CANDIDATES=( + "robbyrussell" + "agnoster" +) +``` ## Advanced Topics diff --git a/oh-my-zsh.sh b/oh-my-zsh.sh index 0324543d5..4517a2ba0 100644 --- a/oh-my-zsh.sh +++ b/oh-my-zsh.sh @@ -93,9 +93,9 @@ done unset config_file # Load the theme -if [ "$ZSH_THEME" = "random" ]; then - if [ "${(t)ZSH_THEME_RANDOM_CANDICATES}" = "array" ] && [ "${#ZSH_THEME_RANDOM_CANDICATES[@]}" -gt 0 ]; then - themes=($ZSH/themes/${^ZSH_THEME_RANDOM_CANDICATES}.zsh-theme) +if [[ "$ZSH_THEME" == "random" ]]; then + if [[ "${(t)ZSH_THEME_RANDOM_CANDIDATES}" = "array" ]] && [[ "${#ZSH_THEME_RANDOM_CANDIDATES[@]}" -gt 0 ]]; then + themes=($ZSH/themes/${^ZSH_THEME_RANDOM_CANDIDATES}.zsh-theme) else themes=($ZSH/themes/*zsh-theme) fi diff --git a/templates/zshrc.zsh-template b/templates/zshrc.zsh-template index baedf0675..2f39308a9 100644 --- a/templates/zshrc.zsh-template +++ b/templates/zshrc.zsh-template @@ -11,7 +11,8 @@ ZSH_THEME="robbyrussell" # Setting this variable when ZSH_THEME=random # cause zsh load theme from this variable instead of # looking in ~/.oh-my-zsh/themes/ -# ZSH_THEME_RANDOM_CANDICATES=() +# An empty array have no effect +# ZSH_THEME_RANDOM_CANDIDATES=( "robbyrussell" "agnoster" ) # Uncomment the following line to use case-sensitive completion. # CASE_SENSITIVE="true" -- cgit v1.2.3-70-g09d2 From b94d9e26e534c9729e8a9401a37e7a5b0906f0d5 Mon Sep 17 00:00:00 2001 From: Timothy Blumberg Date: Wed, 2 Nov 2016 12:53:54 -0400 Subject: Changed dsa --> rsa in zshrc.zsh-template file (#5603) --- templates/zshrc.zsh-template | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'templates') diff --git a/templates/zshrc.zsh-template b/templates/zshrc.zsh-template index 00d25bc93..af42e5b9f 100644 --- a/templates/zshrc.zsh-template +++ b/templates/zshrc.zsh-template @@ -73,7 +73,7 @@ source $ZSH/oh-my-zsh.sh # export ARCHFLAGS="-arch x86_64" # ssh -# export SSH_KEY_PATH="~/.ssh/dsa_id" +# export SSH_KEY_PATH="~/.ssh/rsa_id" # Set personal aliases, overriding those provided by oh-my-zsh libs, # plugins, and themes. Aliases can be placed here, though oh-my-zsh -- cgit v1.2.3-70-g09d2 From fbc878cb66cbe0067998034c2d2e383b2742c0de Mon Sep 17 00:00:00 2001 From: Rob Freiburger Date: Sat, 18 Feb 2017 04:31:36 -0600 Subject: Adds option to disable auto update prompt I noticed this option was missing from the template. When I followed the directions in README to enable it, I put it below line 59 without noticing it wouldn't have any effect by then. Prevent others from making a rookie mistake like mine. --- templates/zshrc.zsh-template | 3 +++ 1 file changed, 3 insertions(+) (limited to 'templates') diff --git a/templates/zshrc.zsh-template b/templates/zshrc.zsh-template index af42e5b9f..93bbf36aa 100644 --- a/templates/zshrc.zsh-template +++ b/templates/zshrc.zsh-template @@ -19,6 +19,9 @@ ZSH_THEME="robbyrussell" # Uncomment the following line to disable bi-weekly auto-update checks. # DISABLE_AUTO_UPDATE="true" +# Uncomment the following line to automatically update without prompting. +# DISABLE_UPDATE_PROMPT="true" + # Uncomment the following line to change how often to auto-update (in days). # export UPDATE_ZSH_DAYS=13 -- cgit v1.2.3-70-g09d2 From 7a7480b987c00bd916e2abf7179f92164ac44362 Mon Sep 17 00:00:00 2001 From: Robby Russell Date: Wed, 8 Nov 2017 10:46:40 -0800 Subject: Updating template and README to list plugins on individual lines vs one long one. Easier scanning for you and me. --- README.md | 22 +++++++++++++++++----- templates/zshrc.zsh-template | 4 +++- 2 files changed, 20 insertions(+), 6 deletions(-) (limited to 'templates') diff --git a/README.md b/README.md index df5ef48be..541f48d40 100644 --- a/README.md +++ b/README.md @@ -10,7 +10,7 @@ __Oh My Zsh will not make you a 10x developer...but you might feel like one.__ Once installed, your terminal shell will become the talk of the town _or your money back!_ With each keystroke in your command prompt, you'll take advantage of the hundreds of powerful plugins and beautiful themes. Strangers will come up to you in cafés and ask you, _"that is amazing! are you some sort of genius?"_ -Finally, you'll begin to get the sort of attention that you have always felt you deserved. ...or maybe you'll use the time that you're saving to start flossing more often. +Finally, you'll begin to get the sort of attention that you have always felt you deserved. ...or maybe you'll use the time that you're saving to start flossing more often. 😬 To learn more, visit [ohmyz.sh](http://ohmyz.sh) and follow [@ohmyzsh](https://twitter.com/ohmyzsh) on Twitter. @@ -51,10 +51,22 @@ Oh My Zsh comes with a shitload of plugins to take advantage of. You can take a Once you spot a plugin (or several) that you'd like to use with Oh My Zsh, you'll need to enable them in the `.zshrc` file. You'll find the zshrc file in your `$HOME` directory. Open it with your favorite text editor and you'll see a spot to list all the plugins you want to load. -For example, this line might begin to look like this: +```shell +vi ~/.zshrc +``` + +For example, this might begin to look like this: ```shell -plugins=(git bundler osx rake ruby) +plugins=( + git + bundler + dotenv + osx + rake + rbenv + ruby +) ``` #### Using Plugins @@ -69,7 +81,7 @@ We'll admit it. Early in the Oh My Zsh world, we may have gotten a bit too theme _Robby's theme is the default one. It's not the fanciest one. It's not the simplest one. It's just the right one (for him)._ -Once you find a theme that you want to use, you will need to edit the `~/.zshrc` file. You'll see an environment variable (all caps) in there that looks like: +Once you find a theme that you'd like to use, you will need to edit the `~/.zshrc` file. You'll see an environment variable (all caps) in there that looks like: ```shell ZSH_THEME="robbyrussell" @@ -193,7 +205,7 @@ If you'd like to upgrade at any point in time (maybe someone just released a new upgrade_oh_my_zsh ``` -Magic! +Magic! 🎉 ## Uninstalling Oh My Zsh diff --git a/templates/zshrc.zsh-template b/templates/zshrc.zsh-template index 966d7a975..bba2d370d 100644 --- a/templates/zshrc.zsh-template +++ b/templates/zshrc.zsh-template @@ -58,7 +58,9 @@ ZSH_THEME="robbyrussell" # 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=( + git +) source $ZSH/oh-my-zsh.sh -- cgit v1.2.3-70-g09d2 From d3e3b2dd0d7c7574d2a47c0d3a0d79583c58b2b8 Mon Sep 17 00:00:00 2001 From: Cristian Consonni Date: Fri, 13 Jul 2018 13:14:15 +0200 Subject: Add support for custom timestamp format in history (#6770) --- lib/history.zsh | 3 ++- templates/zshrc.zsh-template | 5 ++++- 2 files changed, 6 insertions(+), 2 deletions(-) (limited to 'templates') diff --git a/lib/history.zsh b/lib/history.zsh index 7d4e59d00..62e02648b 100644 --- a/lib/history.zsh +++ b/lib/history.zsh @@ -23,7 +23,8 @@ case $HIST_STAMPS in "mm/dd/yyyy") alias history='omz_history -f' ;; "dd.mm.yyyy") alias history='omz_history -E' ;; "yyyy-mm-dd") alias history='omz_history -i' ;; - *) alias history='omz_history' ;; + "") alias history='omz_history' ;; + *) alias history="omz_history -t '$HIST_STAMPS'" ;; esac ## History file configuration diff --git a/templates/zshrc.zsh-template b/templates/zshrc.zsh-template index bba2d370d..5f98fb211 100644 --- a/templates/zshrc.zsh-template +++ b/templates/zshrc.zsh-template @@ -48,7 +48,10 @@ ZSH_THEME="robbyrussell" # Uncomment the following line if you want to change the command execution time # stamp shown in the history command output. -# The optional three formats: "mm/dd/yyyy"|"dd.mm.yyyy"|"yyyy-mm-dd" +# You can set one of the optional three formats: +# "mm/dd/yyyy"|"dd.mm.yyyy"|"yyyy-mm-dd" +# or set a custom format using the strftime function format specifications, +# see 'man strftime' for details. # HIST_STAMPS="mm/dd/yyyy" # Would you like to use another custom folder than $ZSH/custom? -- cgit v1.2.3-70-g09d2 From 77d75d7fcdcc7978246b84e6b3f0e95a0595c452 Mon Sep 17 00:00:00 2001 From: Samuel Lelièvre Date: Wed, 29 Aug 2018 20:50:52 +0200 Subject: Clarify random theme setting (#7090) Clarify random theme setting, in particular how to know which theme was loaded if picked at random. --- templates/zshrc.zsh-template | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) (limited to 'templates') diff --git a/templates/zshrc.zsh-template b/templates/zshrc.zsh-template index 5f98fb211..7cd2a873b 100644 --- a/templates/zshrc.zsh-template +++ b/templates/zshrc.zsh-template @@ -4,23 +4,23 @@ # Path to your oh-my-zsh installation. export ZSH=$HOME/.oh-my-zsh -# Set name of the theme to load. Optionally, if you set this to "random" -# it'll load a random theme each time that oh-my-zsh is loaded. +# 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 # See https://github.com/robbyrussell/oh-my-zsh/wiki/Themes ZSH_THEME="robbyrussell" -# Set list of themes to load -# Setting this variable when ZSH_THEME=random -# cause zsh load theme from this variable instead of -# looking in ~/.oh-my-zsh/themes/ -# An empty array have no effect +# Set list of themes to pick from when loading at random +# Setting this variable when ZSH_THEME=random will cause zsh to load +# a theme from this variable instead of looking in ~/.oh-my-zsh/themes/ +# If set to an empty array, this variable will have no effect. # ZSH_THEME_RANDOM_CANDIDATES=( "robbyrussell" "agnoster" ) # Uncomment the following line to use case-sensitive completion. # CASE_SENSITIVE="true" -# Uncomment the following line to use hyphen-insensitive completion. Case -# sensitive completion must be off. _ and - will be interchangeable. +# Uncomment the following line to use hyphen-insensitive completion. +# Case-sensitive completion must be off. _ and - will be interchangeable. # HYPHEN_INSENSITIVE="true" # Uncomment the following line to disable bi-weekly auto-update checks. @@ -57,7 +57,8 @@ ZSH_THEME="robbyrussell" # Would you like to use another custom folder than $ZSH/custom? # ZSH_CUSTOM=/path/to/new-custom-folder -# Which plugins would you like to load? (plugins can be found in ~/.oh-my-zsh/plugins/*) +# 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. -- cgit v1.2.3-70-g09d2 From b9670d04092a461ae1db41080263b5a82bc1f958 Mon Sep 17 00:00:00 2001 From: Rehan Mahmood Date: Sun, 20 Jan 2019 14:31:23 -0500 Subject: template: change plugins definition to single line (#7498) --- templates/zshrc.zsh-template | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'templates') diff --git a/templates/zshrc.zsh-template b/templates/zshrc.zsh-template index 7cd2a873b..abd2c8812 100644 --- a/templates/zshrc.zsh-template +++ b/templates/zshrc.zsh-template @@ -62,9 +62,7 @@ ZSH_THEME="robbyrussell" # 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=(git) source $ZSH/oh-my-zsh.sh -- cgit v1.2.3-70-g09d2 From 9981479900e3d3ff86bff0b3313c8e45891e880c Mon Sep 17 00:00:00 2001 From: Marc Cornellà Date: Mon, 8 Apr 2019 17:34:59 +0200 Subject: zshrc: remove SSH_KEY_PATH comment Fixes #5741 --- templates/zshrc.zsh-template | 3 --- 1 file changed, 3 deletions(-) (limited to 'templates') diff --git a/templates/zshrc.zsh-template b/templates/zshrc.zsh-template index abd2c8812..bc892ff38 100644 --- a/templates/zshrc.zsh-template +++ b/templates/zshrc.zsh-template @@ -83,9 +83,6 @@ source $ZSH/oh-my-zsh.sh # Compilation flags # export ARCHFLAGS="-arch x86_64" -# ssh -# export SSH_KEY_PATH="~/.ssh/rsa_id" - # Set personal aliases, overriding those provided by oh-my-zsh libs, # plugins, and themes. Aliases can be placed here, though oh-my-zsh # users are encouraged to define aliases within the ZSH_CUSTOM folder. -- cgit v1.2.3-70-g09d2 From 486fa1010df847bfd8823b4492623afc7c935709 Mon Sep 17 00:00:00 2001 From: Marc Cornellà Date: Sat, 11 May 2019 13:42:38 +0200 Subject: lib: add ability to disable magic functions MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Fixes #5499 Fixes #5569 Fixes #6338 Fixes #6654 Fixes #6255 Fixes #7632 Closes #7763 Co-authored-by: Daniel Galán y Martins --- lib/misc.zsh | 6 +++--- templates/zshrc.zsh-template | 3 +++ 2 files changed, 6 insertions(+), 3 deletions(-) (limited to 'templates') diff --git a/lib/misc.zsh b/lib/misc.zsh index b30822b50..40ffa479d 100644 --- a/lib/misc.zsh +++ b/lib/misc.zsh @@ -1,7 +1,7 @@ -## Load smart urls if available -# bracketed-paste-magic is known buggy in zsh 5.1.1 (only), so skip it there; see #4434 autoload -Uz is-at-least -if [[ $ZSH_VERSION != 5.1.1 ]]; then + +# *-magic is known buggy in some versions; disable if so +if [[ $DISABLE_MAGIC_FUNCTIONS != true ]]; then for d in $fpath; do if [[ -e "$d/url-quote-magic" ]]; then if is-at-least 5.1; then diff --git a/templates/zshrc.zsh-template b/templates/zshrc.zsh-template index 453daf8a2..3cc5ad46c 100644 --- a/templates/zshrc.zsh-template +++ b/templates/zshrc.zsh-template @@ -32,6 +32,9 @@ ZSH_THEME="robbyrussell" # Uncomment the following line to change how often to auto-update (in days). # export UPDATE_ZSH_DAYS=13 +# Uncomment the following line if pasting URLs and other text is messed up. +# DISABLE_MAGIC_FUNCTIONS=true + # Uncomment the following line to disable colors in ls. # DISABLE_LS_COLORS="true" -- cgit v1.2.3-70-g09d2