Commit Graph

112 Commits

Author SHA1 Message Date
Marc Cornellà a87e9c715b
fix(init): fix definition order for `$ZSH_CUSTOM`
Tipped about this in https://github.com/ohmyzsh/ohmyzsh/commit/6754b7e67#commitcomment-143280115
2024-06-20 19:51:51 +02:00
Mayu Laierlence 6754b7e67b
feat(init): add custom functions and completions to `$fpath` (#5644)
Closes #5644

Co-authored-by: Marc Cornellà <marc@mcornella.com>
2024-06-12 12:30:03 +02:00
vladislav doster 1d09c6bb0a
style: remove trailing whitespace (#12303) 2024-03-26 09:55:16 +01:00
Marc Cornellà 30f0d59188
fix(init): exit gracefully if on non-zsh emulation mode (#11874)
Fixes #11686
2023-09-04 19:32:38 +02:00
LuckyWindsck dfe2f04de7
refactor(init): rename variable (#11851) 2023-08-21 18:09:02 +02:00
Carlo Sala b22593cf17 fix(init): avoid overwriting existing aliases
Fix regression introduced in #11550. If an existing alias was present in
the moment of sourcing, and oh-my-zsh aliases were disabled for that
file, it'd be overwritten aswell. See #11658.
2023-05-01 22:52:13 +02:00
Marc Cornellà 9233ef75f2
fix(init): don't use digits in parameter modifiers for compatibility (#11598)
Digit modifiers were introduced in zsh 5.7.1 [1]. This commit uses readily available
alternatives for backwards compatibility.

[1] https://github.com/zsh-users/zsh/commit/b8dc5a7f6d

Fixes #11598
2023-04-03 23:36:44 +02:00
Marc Cornellà 1ad167dfac
feat(init)!: allow turning off aliases for libs and plugins (#11550)
BREAKING CHANGE: the previous zstyle setting to disable `lib/directories.zsh` aliases has
been changed to the new syntax: `zstyle ':omz:lib:directories' aliases no`. See
https://github.com/ohmyzsh/ohmyzsh#skip-aliases to see other ways you can use this setting.
    
Co-authored-by: Carlo Sala <carlosalag@protonmail.com>
2023-04-03 23:14:36 +02:00
Marc Cornellà d342b353e3
fix(init): set completion colors on theme load, not with `precmd`
This fixes an edge case where the user actually sets

  zstyle ':completion:*' list-colors

in their zshrc, but the previous code used a precmd hook, which would
override the user changes. With this change our modifications will be
set in the init script, after the theme loads, so that later changes
can affect our defaults.

Note that this will not be run for users on plugin managers, as these
don't generally run our init script.
2023-03-07 18:54:06 +01:00
Carlo Sala 5b9de6a530 fix(init): remove duplicated check
It was added due to #9039. See https://github.com/ohmyzsh/ohmyzsh/pull/11400#pullrequestreview-1223587420
2023-01-17 12:48:05 +01:00
Carlo d93f317450
fix(init): prevent multiple compdump compilations (#11345)
Closes #11341
2022-11-20 08:36:20 +01:00
Giovanni Squillero 7dcabbe682
chore(init): ignore any aliases when running `rm` (#11156) 2022-09-10 16:57:23 +02:00
Monson Shao 875a455320
perf: `zrecompile` the compdump file to speed up startup (#8802) 2022-09-07 19:03:45 +02:00
Carlo Sala a26d72baa2
fix(init): check for unsafe directories in `fpath` (#10672) 2022-04-19 19:23:54 +02:00
Carlo Sala eabec36586
style(init): use consistent code style in init script (#10601) 2022-01-28 23:28:19 +01:00
Marc Cornellà a54148a43e
fix(init): rename function `f` due to clash with `f` alias (#10260)
Fixes #10260
2021-10-04 17:51:22 +02:00
Marc Cornellà 7152a94280
feat(init): show error and process tree if OMZ is loaded from non-zsh shells (#10234) 2021-10-04 10:34:13 +02:00
Marc Cornellà 33c86fe80b
fix(init): detect and abort on non-zsh shell execution of Oh My Zsh 2021-09-28 11:29:42 +02:00
Marc Cornellà 2ea1fa6cbf
fix(init): fix `division by 0` error (#10213)
Fixes #10213
2021-09-24 16:50:00 +02:00
Marc Cornellà 93b557e291
style(core): make alternative cache directory equivalent to Arch Linux package
The oh-my-zsh-git package sets the cache directory to `$HOME/.cache/oh-my-zsh`, so
Oh My Zsh will be compatible with it.
2021-09-15 20:45:26 +02:00
Marc Cornellà 8784e88552
fix(core): use `$HOME/.cache` if default cache dir is non-writable (#10193)
Fixes #10193
2021-09-15 20:38:54 +02:00
Marc Cornellà d2269180b0
fix(core): move plugin-generated completion files to `$ZSH_CACHE_DIR/completions`
Fixes #10183
2021-09-15 18:41:44 +02:00
Marc Cornellà 28ee5846bb init: define $ZSH if not defined
Closes #9223
2020-09-04 21:50:00 +02:00
Ye Shu 5ffc0d036c
init: don't run update check if DISABLE_AUTO_UPDATE (#9040)
skip the update check at initialization if DISABLE_AUTO_UPDATE is set to true
2020-06-18 10:07:13 +02:00
Marc Cornellà 3f6e87df15
init: run update check in the same zsh process (#9019) 2020-06-17 11:23:52 +02:00
Marc Cornellà 3c777ebf1b
update: refactor and fix logic in check_for_upgrade.sh (#8939) 2020-06-09 19:38:08 +02:00
Marc Cornellà aee9e603b4 init: reapply hack for invalid ZSH_COMPDUMP filenames (b8761985) 2020-06-03 17:50:53 +02:00
Marc Cornellà c58572d5fe init: oops 2020-06-02 12:06:40 +02:00
Marc Cornellà 0e12ebb42d init: use grep for zcompdump metadata check
Closes #8981
2020-06-02 11:45:50 +02:00
Jacob Menke 582c8cb291
Prefix cd calls with `builtin` (#8937) 2020-05-20 11:30:11 +02:00
Marc Cornellà b876198575 init: silence zcompdump metadata write for invalid ZSH_COMPDUMP filenames
If `$SHORT_HOST` contains invalid filename characters, the compinit call doesn't
error, but the zcompdump metadata write does. Use `tee` instead so we can silence
the error.

See dd1a72696f (commitcomment-38984764)
2020-05-07 11:28:10 +02:00
Marc Cornellà ff987384cf core: fix cmp invocation in BSD systems
BSD cmp doesn't have the option of reading from stdin, so use process
substitution instead.
2020-05-05 12:13:45 +02:00
Marc Cornellà dd1a72696f
core: refresh zcompdump cache file in init script (#8878) 2020-05-04 16:51:16 +02:00
Marc Cornellà 173d4ca68f core: move core folder to lib, for now 2020-05-01 19:15:14 +02:00
Marc Cornellà 07bcf041c0
core: add basic Oh My Zsh CLI (#8876) 2020-05-01 19:02:29 +02:00
Willy Weiskopf 6adad5c300 Move random theme functionality into "random" theme
The statements for selecting a random theme in oh-my-zsh.sh and the themes
plugin are duplicate. Most people eventually settle on a theme, making those
lines in oh-my-zsh.sh superfluous. To address those, it may makes sense to put
the random theme functionality into a theme of its own (since themes are just
zsh scripts.
2020-02-19 18:20:28 +01:00
Marc Cornellà a04728f168 init: force use of builtin test in is_plugin
Fixes #8545
2020-01-19 17:52:15 +01:00
Marc Cornellà ea3e666e04 init: run compinit before loading lib/ files 2019-05-07 21:30:06 +02:00
Greg 3a6bf6bd26 init: more informative warning if plugin not found (#7727) 2019-04-03 13:20:16 +02:00
Avi ד 1e11a3c112 init: fix erroneous plugin not found warning (#7686)
Co-authored-by: Se De <Sede7473@gmail.com>
2019-03-22 19:37:08 +01:00
SomeDer 779ff24c2d init: notify user if plugin isn't found (#7679) 2019-03-21 20:25:41 +01:00
Marc Cornellà 4cdffcd485 init: cut down on the number of compaudit calls 2019-02-25 21:30:00 +01:00
Chao Du e96a7b728a migrate .zsh-update file 2018-06-15 23:43:21 +02:00
Chao Du de8299d6c4 Fixed Issue #4550: Move ~/.zsh-update file to $ZSH_CACHE_DIR 2018-06-15 23:43:21 +02:00
Marc Cornellà b91659951e Always load secure completion directories 2018-05-26 21:33:49 +02:00
Marc Cornellà afba4f6b9f
Load insecure completion files if compfix is disabled
We have to assume that if people disabled the compfix system they really want
their completion to work, ignoring any permission issues.

Fixes #5651
Fixes #5957
Fixes #6461
2018-05-15 21:22:47 +02:00
Robby Russell a1d13aa0b4 Merge branch 'Random_Theme_From_List' of https://github.com/Gnouc/oh-my-zsh into Gnouc-Random_Theme_From_List 2017-11-01 05:35:37 -07:00
Mason f94d4e6a40 Change from OSX to macOS in README (#5545) 2016-10-18 20:42:27 +02:00
Marc Cornellà d8b03f3f95 init script: remove trailing slash from $ZSH_CACHE_DIR 2016-08-25 02:05:25 +02:00
LE Manh Cuong 5e77e00ad5 Some improvements
- Adding documentation
 - Note the effect empty array
 - Fix spelling
 - Using new test `[[...]]`
2015-12-18 14:15:38 +07:00