Skip to content

Commit

Permalink
chore: run prettier
Browse files Browse the repository at this point in the history
  • Loading branch information
carlosala committed Dec 22, 2024
1 parent 284d1a3 commit e925ca0
Show file tree
Hide file tree
Showing 24 changed files with 615 additions and 473 deletions.
2 changes: 2 additions & 0 deletions Articles.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<!-- prettier-ignore-start -->
> _This wiki is automatically published from [ohmyzsh/wiki](https://github.com/ohmyzsh/wiki). To edit this page,_
> _go to [ohmyzsh/wiki](https://github.com/ohmyzsh/wiki), make your changes and submit a Pull Request._
<!-- prettier-ignore-end -->
Here are a collection of blog posts and articles that mention Oh My Zsh.

Expand Down
58 changes: 30 additions & 28 deletions Cheatsheet.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
<!-- prettier-ignore-start -->
> _This wiki is automatically published from [ohmyzsh/wiki](https://github.com/ohmyzsh/wiki). To edit this page,_
> _go to [ohmyzsh/wiki](https://github.com/ohmyzsh/wiki), make your changes and submit a Pull Request._
> **If you're coming from the Internet, this section has been edited to only show main**
> **Oh My Zsh tricks. Documentation for each plugin can be found in each [[Plugins]] README.**
<!-- prettier-ignore-end -->
Quick reference:

Expand All @@ -14,34 +16,34 @@ Quick reference:

## Commands

| Command | Description |
| :-------------- | :----------------------------------------------------------------------------------------- |
| `alias` | List all aliases |
| `mkcd` | Create a new directory and change to it, will create intermediate directories as required. |
| `take` | Like `mkcd`, but also knows how to handle remote URLs. When given an argument that looks like a URL (something that ends in `.git` or `.tar.(gz\|bz2\|xz)`), download the remote resource and extract it (if necessary) into the current directory. Then change to the newly extracted/downloaded/cloned directory. |
| `zsh_stats` | Get a list of the top 20 commands and how many times they have been run. |
| Command | Description |
| :---------- | :------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| `alias` | List all aliases |
| `mkcd` | Create a new directory and change to it, will create intermediate directories as required. |
| `take` | Like `mkcd`, but also knows how to handle remote URLs. When given an argument that looks like a URL (something that ends in `.git` or `.tar.(gz\|bz2\|xz)`), download the remote resource and extract it (if necessary) into the current directory. Then change to the newly extracted/downloaded/cloned directory. |
| `zsh_stats` | Get a list of the top 20 commands and how many times they have been run. |

## Directory

| Alias | Command |
| :--------- | :----------------------------------------- |
| `md` | `mkdir -p` |
| `rd` | `rmdir` |
| `~` | `cd` (change to home directory) |
| `..` | `cd ..` |
| `...` | `cd ../..` |
| `....` | `cd ../../..` |
| `.....` | `cd ../../../..` |
| `/` | `cd /` |
| `d` | `dirs -v` (lists last visited directories) |
| `cd +n` | Switch to directory number `n` |
| `-` | `cd` to last visited directory |
| `1` | `cd -1` |
| `2` | `cd -2` |
| `3` | `cd -3` |
| `4` | `cd -4` |
| `5` | `cd -5` |
| `6` | `cd -6` |
| `7` | `cd -7` |
| `8` | `cd -8` |
| `9` | `cd -9` |
| Alias | Command |
| :------ | :----------------------------------------- |
| `md` | `mkdir -p` |
| `rd` | `rmdir` |
| `~` | `cd` (change to home directory) |
| `..` | `cd ..` |
| `...` | `cd ../..` |
| `....` | `cd ../../..` |
| `.....` | `cd ../../../..` |
| `/` | `cd /` |
| `d` | `dirs -v` (lists last visited directories) |
| `cd +n` | Switch to directory number `n` |
| `-` | `cd` to last visited directory |
| `1` | `cd -1` |
| `2` | `cd -2` |
| `3` | `cd -3` |
| `4` | `cd -4` |
| `5` | `cd -5` |
| `6` | `cd -6` |
| `7` | `cd -7` |
| `8` | `cd -8` |
| `9` | `cd -9` |
8 changes: 5 additions & 3 deletions Code-Style-Guide.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<!-- prettier-ignore-start -->
> _This wiki is automatically published from [ohmyzsh/wiki](https://github.com/ohmyzsh/wiki). To edit this page,_
> _go to [ohmyzsh/wiki](https://github.com/ohmyzsh/wiki), make your changes and submit a Pull Request._
<!-- prettier-ignore-end -->
## General Code Style

Expand Down Expand Up @@ -27,15 +29,15 @@ long_string_1="I am an exceptionalllllllllllly loooooooooooooooooooooooooooooooo

```shell
cat <<END;
I am an exceptionalllllllllllly
I am an exceptionalllllllllllly
looooooooooooooooooooooooooooooooooooooooong string.
END
```

##### _Good:_

```shell
long_string_2="I am an exceptionalllllllllllly
long_string_2="I am an exceptionalllllllllllly
looooooooooooooooooooooooooooooooooooooooong string."
```

Expand Down Expand Up @@ -175,7 +177,7 @@ Ensure that local variables are only seen inside a function and its children by
```shell
function func_bad() {
global_var=37 # Visible only within the function block
# before the function has been called.
# before the function has been called.
}

echo "global_var = $global_var" # Function "func_bad" has not yet been called,
Expand Down
2 changes: 2 additions & 0 deletions Contribution-Technical-Practices.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<!-- prettier-ignore-start -->
> _This wiki is automatically published from [ohmyzsh/wiki](https://github.com/ohmyzsh/wiki). To edit this page,_
> _go to [ohmyzsh/wiki](https://github.com/ohmyzsh/wiki), make your changes and submit a Pull Request._
<!-- prettier-ignore-end -->
Oh My Zsh is a community-driven project and contributions are welcome, but it all works best with a proper setup. Here follow the best practices for setting up a fork and getting started for contributing.

Expand Down
6 changes: 4 additions & 2 deletions Customization.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<!-- prettier-ignore-start -->
> _This wiki is automatically published from [ohmyzsh/wiki](https://github.com/ohmyzsh/wiki). To edit this page,_
> _go to [ohmyzsh/wiki](https://github.com/ohmyzsh/wiki), make your changes and submit a Pull Request._
<!-- prettier-ignore-end -->
Oh My Zsh is fully configurable to your needs with the help of the `$ZSH_CUSTOM` variable, whether you want to change its internals, plugins or the rich theme set – and all that **without forking**!

Expand Down Expand Up @@ -30,11 +32,11 @@ $ZSH_CUSTOM

Also follow these steps if you want to override plugins that ship with your Oh My Zsh installation. To override a plugin with a custom version, put your custom version at `$ZSH_CUSTOM/plugins/<plugin_name>/`. For example, if it's the rvm plugin you want to override, create the directory `custom/plugins/rvm` and place a file called `rvm.plugin.zsh` inside of it.

This method will override the entire plugin: your custom plugin files will be loaded *instead* of the files from the original plugin.
This method will override the entire plugin: your custom plugin files will be loaded _instead_ of the files from the original plugin.

### Partially overriding an existing plugin

To partially customize a plugin by redefining individual functions or variables from it, use a "patch" plugin. Create a custom "patch" plugin with a different name that has definitions for just the items you wish to override, and load that after the base plugin by putting your patch plugin in `$plugins` *after* the base plugin it customizes. (This is necessary because user custom files are loaded before any plugins are loaded.) Make sure it doesn't have the same name as any other base plugin, either.
To partially customize a plugin by redefining individual functions or variables from it, use a "patch" plugin. Create a custom "patch" plugin with a different name that has definitions for just the items you wish to override, and load that after the base plugin by putting your patch plugin in `$plugins` _after_ the base plugin it customizes. (This is necessary because user custom files are loaded before any plugins are loaded.) Make sure it doesn't have the same name as any other base plugin, either.

This may or may not work, depending on how the plugin is written: your redefinitions only take effect after the plugin has been loaded by `source`-ing its definition file. If any of the things you redefine are called or referenced during the plugin's initialization, they will not see your redefinitions.

Expand Down
24 changes: 13 additions & 11 deletions Design.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<!-- prettier-ignore-start -->
> _This wiki is automatically published from [ohmyzsh/wiki](https://github.com/ohmyzsh/wiki). To edit this page,_
> _go to [ohmyzsh/wiki](https://github.com/ohmyzsh/wiki), make your changes and submit a Pull Request._
<!-- prettier-ignore-end -->
This page is a description of the current architecture and design of Oh My Zsh.

Expand All @@ -25,7 +27,7 @@ It seems that plugins can get arbitrarily powerful and do whatever they want, so

## Variables

These are variables that base OMZ (excluding any plugins) uses. I've read through .oh-my-zsh so far, but not the lib/*.zsh files. More may be on the way.
These are variables that base OMZ (excluding any plugins) uses. I've read through .oh-my-zsh so far, but not the lib/\*.zsh files. More may be on the way.

### Variables OMZ reads

Expand All @@ -39,8 +41,8 @@ In oh-my-zsh.sh:
- `ZSH_THEME` – theme to load at startup
- `CASE_SENSITIVE` – controls zsh completion matching
- `COMPLETION_WAITING_DOTS`
- `DISABLE_AUTO_UPDATE` – ("true"/*)
- `DISABLE_AUTO_PROMPT` – ("true"/*)
- `DISABLE_AUTO_UPDATE` – ("true"/\*)
- `DISABLE_AUTO_PROMPT` – ("true"/\*)
- `DISABLE_LS_COLORS` – in lib/theme-and-appearance
- `ENABLE_CORRECTION`
- `ZSH_CACHE_DIR`
Expand All @@ -67,13 +69,13 @@ At init:
- `POST_1_7_2_GIT`
- `PAGER`
- `LESS`
- `FX` – special terminal control "effects" (reset/bold/no-bold/etc)
- `FX` – special terminal control "effects" (reset/bold/no-bold/etc)
- `FG`
- `BG`

At init (defaults if not provided):

- `ZSH_CUSTOM` - defaults to `$ZSH/custom`
- `ZSH_CUSTOM` - defaults to `$ZSH/custom`
- `ZSH_CACHE_DIR` - defaults to `$ZSH/cache`
- `ZSH_COMPDUMP`
- `ZSH_SPECTRUM_TEXT`
Expand Down Expand Up @@ -117,7 +119,7 @@ The initialization steps in detail:
- Discovers and sources all lib files, in alphabetical order, respecting custom overrides
- Load custom user code
- Source each `$ZSH_CUSTOM/*.zsh` file, in alphabetical order
- Pre-load plugins (add to `$fpath`, but don't source)
- Pre-load plugins (add to `$fpath`, but don't source)
- Set `$SHORT_HOST`
- Initialize Completion support
- Set `$ZSH_COMPDUMP`
Expand All @@ -130,16 +132,16 @@ The initialization steps in detail:

In Oh My Zsh terms, _customization_ means adding or overriding zsh code, including its internals and implementation. It's not just a term for user-specified configuration.

Overriding internals can be done by adding `*.zsh` files to the `$ZSH_CUSTOM` root directory. All `*.zsh` files there will be sourced after OMZ loads and sources its own lib/* files. This allows you to redefine functions after the fact. (This will take place after any setup has called OMZ functions.) These are referred to as "config files" in oh-my-zsh.sh.
Overriding internals can be done by adding `*.zsh` files to the `$ZSH_CUSTOM` root directory. All `*.zsh` files there will be sourced after OMZ loads and sources its own lib/\* files. This allows you to redefine functions after the fact. (This will take place after any setup has called OMZ functions.) These are referred to as "config files" in oh-my-zsh.sh.

It's not documented in the _Customization_ page, but `$ZSH_CUSTOM/lib/*.zsh` do override the corresponding internals lib files. If a custom one is present, it is sourced instead of the one in the distribution.

So, you can:

- Override lib/* files on a per-file basis (loaded instead of the base file of the same name)
- Override lib/\* files on a per-file basis (loaded instead of the base file of the same name)
- Add arbitrary customization code that runs later and can redefine any function or variable from the core
- Override plugins and themes on a per-plugin/theme basis (loaded instead of base)
- Override parts of plugins by defining an additional "patch" plugin and including it in `$plugins` *after* the base plugin
- Override parts of plugins by defining an additional "patch" plugin and including it in `$plugins` _after_ the base plugin

`$ZSH_CUSTOM` controls where the custom override files are found; defaults to `$ZSH/custom` (under the main OMZ installation).

Expand Down Expand Up @@ -169,7 +171,7 @@ Themes control the appearance of the `zsh` prompt, the appearance of certain oth

OMZ turns on the `prompt_subst` shell option, and OMZ themes assume it is enabled.

Themes set a variety of variables to control the appearance of the zsh prompt. They may also install hook functions. These variables are read by core OMZ functions like `git_prompt_info()` and used to modify their behavior and style their output.
Themes set a variety of variables to control the appearance of the zsh prompt. They may also install hook functions. These variables are read by core OMZ functions like `git_prompt_info()` and used to modify their behavior and style their output.

Things themes do:

Expand All @@ -183,7 +185,7 @@ These variables are set by themes to control the prompt's appearance and other c

- `PROMPT`
- `DEFAULT_USER`
- `ZSH_THEME_SCM_PROMPT_PREFIX` – used in `bzr_prompt_info()` from `lib/bzr.sh`
- `ZSH_THEME_SCM_PROMPT_PREFIX` – used in `bzr_prompt_info()` from `lib/bzr.sh`

git_prompt_info():

Expand Down
5 changes: 4 additions & 1 deletion External-plugins.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
> _This wiki is automatically published from [ohmyzsh/wiki](https://github.com/ohmyzsh/wiki). To edit this page, go to [ohmyzsh/wiki](https://github.com/ohmyzsh/wiki), make your changes and submit a Pull Request._
<!-- prettier-ignore-start -->
> _This wiki is automatically published from [ohmyzsh/wiki](https://github.com/ohmyzsh/wiki). To edit this page,_
> _go to [ohmyzsh/wiki](https://github.com/ohmyzsh/wiki), make your changes and submit a Pull Request._
<!-- prettier-ignore-end -->
## Non-Bundled Plugins

Expand Down
Loading

0 comments on commit e925ca0

Please sign in to comment.