update oh my zsh

This commit is contained in:
vincent 2019-12-21 17:33:06 +01:00
parent 4764bc8f9e
commit 308c4ad023
20 changed files with 129 additions and 70 deletions

View File

@ -132,6 +132,10 @@ ZSH_THEME_RANDOM_CANDIDATES=(
) )
``` ```
### FAQ
If you have some more questions or issues, you might find a solution in our [FAQ](https://github.com/ohmyzsh/ohmyzsh/wiki/FAQ).
## Advanced Topics ## Advanced Topics
If you're the type that likes to get their hands dirty, these sections might resonate. If you're the type that likes to get their hands dirty, these sections might resonate.

View File

@ -2,4 +2,4 @@
**Maintainer:** [@emzar](https://github.com/emzar) **Maintainer:** [@emzar](https://github.com/emzar)
This plugin adds many useful aliases. This plugin adds many useful aliases for [arcanist](https://github.com/phacility/arcanist).

View File

@ -6,20 +6,41 @@ Colorize will highlight the content based on the filename extension. If it can't
method for a given extension, it will try to find one by looking at the file contents. If no highlight method method for a given extension, it will try to find one by looking at the file contents. If no highlight method
is found it will just cat the file normally, without syntax highlighting. is found it will just cat the file normally, without syntax highlighting.
To use it, add colorize to the plugins array of your zshrc file: ## Setup
To use it, add colorize to the plugins array of your `~/.zshrc` file:
``` ```
plugins=(... colorize) plugins=(... colorize)
``` ```
## Styles ## Configuration
### Requirements
This plugin requires that either of the following tools be installed:
* Chroma: [https://github.com/alecthomas/chroma](https://github.com/alecthomas/chroma)
* Pygments be installed: [pygments.org](https://pygments.org/)
### Colorize tool
Colorize supports `pygmentize` and `chroma` as syntax highlighter. By default colorize uses `pygmentize` unless it's not installed and `chroma` is. This can be overridden by the `ZSH_COLORIZE_TOOL` environment variable:
```
ZSH_COLORIZE_TOOL=chroma
```
### Styles
Pygments offers multiple styles. By default, the `default` style is used, but you can choose another theme by setting the `ZSH_COLORIZE_STYLE` environment variable: Pygments offers multiple styles. By default, the `default` style is used, but you can choose another theme by setting the `ZSH_COLORIZE_STYLE` environment variable:
`ZSH_COLORIZE_STYLE="colorful"` ```
ZSH_COLORIZE_STYLE="colorful"
```
## Usage ## Usage
* `ccat <file> [files]`: colorize the contents of the file (or files, if more than one are provided). * `ccat <file> [files]`: colorize the contents of the file (or files, if more than one are provided).
If no arguments are passed it will colorize the standard input or stdin. If no arguments are passed it will colorize the standard input or stdin.
* `cless <file> [files]`: colorize the contents of the file (or files, if more than one are provided) and * `cless <file> [files]`: colorize the contents of the file (or files, if more than one are provided) and
@ -29,7 +50,3 @@ Note that `cless` will behave as less when provided more than one file: you have
the commands `:n` for next and `:p` for previous. The downside is that less options are not supported. the commands `:n` for next and `:p` for previous. The downside is that less options are not supported.
But you can circumvent this by either using the LESS environment variable, or by running `ccat file1 file2|less --opts`. But you can circumvent this by either using the LESS environment variable, or by running `ccat file1 file2|less --opts`.
In the latter form, the file contents will be concatenated and presented by less as a single file. In the latter form, the file contents will be concatenated and presented by less as a single file.
## Requirements
You have to install Pygments first: [pygments.org](http://pygments.org/download.html)

View File

@ -3,21 +3,42 @@ alias ccat='colorize_via_pygmentize'
alias cless='colorize_via_pygmentize_less' alias cless='colorize_via_pygmentize_less'
colorize_via_pygmentize() { colorize_via_pygmentize() {
if ! (( $+commands[pygmentize] )); then local available_tools=("chroma" "pygmentize")
echo "package 'Pygments' is not installed!"
if [ -z "$ZSH_COLORIZE_TOOL" ]; then
if (( $+commands[pygmentize] )); then
ZSH_COLORIZE_TOOL="pygmentize"
elif (( $+commands[chroma] )); then
ZSH_COLORIZE_TOOL="chroma"
else
echo "Neither 'pygments' nor 'chroma' is installed!" >&2
return 1
fi
fi
if [[ ${available_tools[(Ie)$ZSH_COLORIZE_TOOL]} -eq 0 ]]; then
echo "ZSH_COLORIZE_TOOL '$ZSH_COLORIZE_TOOL' not recognized. Available options are 'pygmentize' and 'chroma'." >&2
return 1
elif (( $+commands["$ZSH_COLORIZE_TOOL"] )); then
echo "Package '$ZSH_COLORIZE_TOOL' is not installed!" >&2
return 1 return 1
fi fi
# If the environment varianle ZSH_COLORIZE_STYLE # If the environment variable ZSH_COLORIZE_STYLE
# is set, use that theme instead. Otherwise, # is set, use that theme instead. Otherwise,
# use the default. # use the default.
if [ -z $ZSH_COLORIZE_STYLE ]; then if [ -z "$ZSH_COLORIZE_STYLE" ]; then
ZSH_COLORIZE_STYLE="default" # Both pygmentize & chroma support 'emacs'
ZSH_COLORIZE_STYLE="emacs"
fi fi
# pygmentize stdin if no arguments passed # pygmentize stdin if no arguments passed
if [ $# -eq 0 ]; then if [ $# -eq 0 ]; then
pygmentize -O style="$ZSH_COLORIZE_STYLE" -g if [[ "$ZSH_COLORIZE_TOOL" == "pygmentize" ]]; then
pygmentize -O style="$ZSH_COLORIZE_STYLE" -g
else
chroma --style="$ZSH_COLORIZE_STYLE"
fi
return $? return $?
fi fi
@ -27,11 +48,15 @@ colorize_via_pygmentize() {
local FNAME lexer local FNAME lexer
for FNAME in "$@" for FNAME in "$@"
do do
lexer=$(pygmentize -N "$FNAME") if [[ "$ZSH_COLORIZE_TOOL" == "pygmentize" ]]; then
if [[ $lexer != text ]]; then lexer=$(pygmentize -N "$FNAME")
pygmentize -O style="$ZSH_COLORIZE_STYLE" -l "$lexer" "$FNAME" if [[ $lexer != text ]]; then
pygmentize -O style="$ZSH_COLORIZE_STYLE" -l "$lexer" "$FNAME"
else
pygmentize -O style="$ZSH_COLORIZE_STYLE" -g "$FNAME"
fi
else else
pygmentize -O style="$ZSH_COLORIZE_STYLE" -g "$FNAME" chroma --style="$ZSH_COLORIZE_STYLE" "$FNAME"
fi fi
done done
} }

View File

@ -32,17 +32,21 @@ plugins=(... extract)
| `tar` | Tarball | | `tar` | Tarball |
| `tar.bz2` | Tarball with bzip2 compression | | `tar.bz2` | Tarball with bzip2 compression |
| `tar.gz` | Tarball with gzip compression | | `tar.gz` | Tarball with gzip compression |
| `tar.lz` | Tarball with lzip compression |
| `tar.xz` | Tarball with lzma2 compression | | `tar.xz` | Tarball with lzma2 compression |
| `tar.zma` | Tarball with lzma compression | | `tar.zma` | Tarball with lzma compression |
| `tar.zst` | Tarball with zstd compression |
| `tbz` | Tarball with bzip compression | | `tbz` | Tarball with bzip compression |
| `tbz2` | Tarball with bzip2 compression | | `tbz2` | Tarball with bzip2 compression |
| `tgz` | Tarball with gzip compression | | `tgz` | Tarball with gzip compression |
| `tlz` | Tarball with lzma compression | | `tlz` | Tarball with lzma compression |
| `txz` | Tarball with lzma2 compression | | `txz` | Tarball with lzma2 compression |
| `tzst` | Tarball with zstd compression |
| `war` | Web Application archive (Java-based) | | `war` | Web Application archive (Java-based) |
| `xpi` | Mozilla XPI module file | | `xpi` | Mozilla XPI module file |
| `xz` | LZMA2 archive | | `xz` | LZMA2 archive |
| `zip` | Zip archive | | `zip` | Zip archive |
| `zst` | Zstandard file (zstd) |
See [list of archive formats](https://en.wikipedia.org/wiki/List_of_archive_formats) for See [list of archive formats](https://en.wikipedia.org/wiki/List_of_archive_formats) for
more information regarding archive formats. more information regarding archive formats.

View File

@ -3,5 +3,5 @@
_arguments \ _arguments \
'(-r --remove)'{-r,--remove}'[Remove archive.]' \ '(-r --remove)'{-r,--remove}'[Remove archive.]' \
"*::archive file:_files -g '(#i)*.(7z|Z|apk|aar|bz2|deb|gz|ipsw|jar|lzma|rar|rpm|sublime-package|tar|tar.bz2|tar.gz|tar.xz|tar.zma|tbz|tbz2|tgz|tlz|txz|war|whl|xpi|xz|zip)(-.)'" \ "*::archive file:_files -g '(#i)*.(7z|Z|apk|aar|bz2|deb|gz|ipsw|jar|lzma|rar|rpm|sublime-package|tar|tar.bz2|tar.gz|tar.lz|tar.xz|tar.zma|tar.zst|tbz|tbz2|tgz|tlz|txz|tzst|war|whl|xpi|xz|zip|zst)(-.)'" \
&& return 0 && return 0

View File

@ -40,7 +40,12 @@ extract() {
tar --lzma --help &> /dev/null \ tar --lzma --help &> /dev/null \
&& tar --lzma -xvf "$1" \ && tar --lzma -xvf "$1" \
|| lzcat "$1" | tar xvf - ;; || lzcat "$1" | tar xvf - ;;
(*.tar.zst|*.tzst)
tar --zstd --help &> /dev/null \
&& tar --zstd -xvf "$1" \
|| zstdcat "$1" | tar xvf - ;;
(*.tar) tar xvf "$1" ;; (*.tar) tar xvf "$1" ;;
(*.tar.lz) (( $+commands[lzip] )) && tar xvf "$1" ;;
(*.gz) (( $+commands[pigz] )) && pigz -dk "$1" || gunzip -k "$1" ;; (*.gz) (( $+commands[pigz] )) && pigz -dk "$1" || gunzip -k "$1" ;;
(*.bz2) bunzip2 "$1" ;; (*.bz2) bunzip2 "$1" ;;
(*.xz) unxz "$1" ;; (*.xz) unxz "$1" ;;
@ -59,6 +64,7 @@ extract() {
cd ..; rm *.tar.* debian-binary cd ..; rm *.tar.* debian-binary
cd .. cd ..
;; ;;
(*.zst) unzstd "$1" ;;
(*) (*)
echo "extract: '$1' cannot be extracted" >&2 echo "extract: '$1' cannot be extracted" >&2
success=1 success=1

View File

@ -5,7 +5,7 @@
To use it, add `fasd` to the plugins array in your zshrc file: To use it, add `fasd` to the plugins array in your zshrc file:
```zsh ```zsh
plugins=(... fd) plugins=(... fasd)
``` ```
## Installation ## Installation

View File

@ -12,6 +12,7 @@ function setup_using_base_dir() {
"${HOME}/.fzf" "${HOME}/.fzf"
"/usr/local/opt/fzf" "/usr/local/opt/fzf"
"/usr/share/fzf" "/usr/share/fzf"
"/usr/local/share/examples/fzf"
) )
for dir in ${fzfdirs}; do for dir in ${fzfdirs}; do
if [[ -d "${dir}" ]]; then if [[ -d "${dir}" ]]; then
@ -67,7 +68,10 @@ function setup_using_debian_package() {
# NOTE: There is no need to configure PATH for debian package, all binaries # NOTE: There is no need to configure PATH for debian package, all binaries
# are installed to /usr/bin by default # are installed to /usr/bin by default
local completions="/usr/share/zsh/vendor-completions/_fzf" # Determine completion file path: first bullseye/sid, then buster/stretch
local completions="/usr/share/doc/fzf/examples/completion.zsh"
[[ -f "$completions" ]] || completions="/usr/share/zsh/vendor-completions/_fzf"
local key_bindings="/usr/share/doc/fzf/examples/key-bindings.zsh" local key_bindings="/usr/share/doc/fzf/examples/key-bindings.zsh"
# Auto-completion # Auto-completion

View File

@ -4,26 +4,21 @@ from __future__ import print_function
import os import os
import sys import sys
import re import re
import shlex
from subprocess import Popen, PIPE, check_output from subprocess import Popen, PIPE, check_output
def get_tagname_or_hash(): def get_tagname_or_hash():
"""return tagname if exists else hash""" """return tagname if exists else hash"""
cmd = 'git log -1 --format="%h%d"'
output = check_output(shlex.split(cmd)).decode('utf-8').strip()
hash_, tagname = None, None
# get hash # get hash
m = re.search('\(.*\)$', output) hash_cmd = ['git', 'rev-parse', '--short', 'HEAD']
if m: hash_ = check_output(hash_cmd).strip()
hash_ = output[:m.start()-1]
# get tagname
m = re.search('tag: .*[,\)]', output)
if m:
tagname = 'tags/' + output[m.start()+len('tag: '): m.end()-1]
if tagname: # get tagname
return tagname.replace(' ', '') tags_cmd = ['git', 'for-each-ref', '--points-at=HEAD', '--count=2', '--sort=-version:refname', '--format=%(refname:short)', 'refs/tags']
tags = check_output(tags_cmd).split()
if tags:
return tags[0] + ('+' if len(tags) > 1 else '')
elif hash_: elif hash_:
return hash_ return hash_
return None return None

View File

@ -15,7 +15,7 @@ function _start_agent() {
zstyle -a :omz:plugins:keychain options options zstyle -a :omz:plugins:keychain options options
# start keychain... # start keychain...
keychain ${^options:-} --agents ${agents:-gpg} ${^identities} keychain ${^options:-} --agents ${agents:-gpg} ${^identities} --host $SHORT_HOST
# Get the filenames to store/lookup the environment from # Get the filenames to store/lookup the environment from
_keychain_env_sh="$HOME/.keychain/$SHORT_HOST-sh" _keychain_env_sh="$HOME/.keychain/$SHORT_HOST-sh"

View File

@ -17,16 +17,16 @@ plugins=(... sbt)
| sbcln | `sbt clean` | Deletes all generated files | | sbcln | `sbt clean` | Deletes all generated files |
| sbcc | `sbt clean compile` | Deletes generated files, compiles the main sources | | sbcc | `sbt clean compile` | Deletes generated files, compiles the main sources |
| sbco | `sbt console` | Starts Scala with the compiled sources and all dependencies | | sbco | `sbt console` | Starts Scala with the compiled sources and all dependencies |
| sbcq | `sbt console-quick` | Starts Scala with all dependencies | | sbcq | `sbt consoleQuick` | Starts Scala with all dependencies |
| sbcp | `sbt console-project` | Starts Scala with sbt and the build definitions | | sbcp | `sbt consoleProject` | Starts Scala with sbt and the build definitions |
| sbd | `sbt doc` | Generates API documentation for Scala source files | | sbd | `sbt doc` | Generates API documentation for Scala source files |
| sbdc | `sbt dist:clean` | Deletes the distribution packages | | sbdc | `sbt dist:clean` | Deletes the distribution packages |
| sbdi | `sbt dist` | Creates the distribution packages | | sbdi | `sbt dist` | Creates the distribution packages |
| sbgi | `sbt gen-idea` | Create Idea project files | | sbgi | `sbt genIdea` | Create Idea project files |
| sbp | `sbt publish` | Publishes artifacts to the repository | | sbp | `sbt publish` | Publishes artifacts to the repository |
| sbpl | `sbt publish-local` | Publishes artifacts to the local Ivy repository | | sbpl | `sbt publishLocal` | Publishes artifacts to the local Ivy repository |
| sbr | `sbt run` | Runs the main class for the project | | sbr | `sbt run` | Runs the main class for the project |
| sbrm | `sbt run-main` | Runs the specified main class for the project | | sbrm | `sbt runMain` | Runs the specified main class for the project |
| sbu | `sbt update` | Resolves and retrieves external dependencies | | sbu | `sbt update` | Resolves and retrieves external dependencies |
| sbx | `sbt test` | Compiles and runs all tests | | sbx | `sbt test` | Compiles and runs all tests |
| sba | `sbt assembly` | Create a fat JAR with all dependencies | | sba | `sbt assembly` | Create a fat JAR with all dependencies |

View File

@ -6,23 +6,23 @@ _sbt_commands=(
'clean:delete files produced by the build' 'clean:delete files produced by the build'
'compile:compile sources' 'compile:compile sources'
'console:start the Scala REPL with project classes on the classpath' 'console:start the Scala REPL with project classes on the classpath'
'console-quick:start the Scala REPL with project deps on the classpath' 'consoleQuick:start the Scala REPL with project deps on the classpath'
'console-project:start the Scala REPL w/sbt+build-def on the classpath' 'consoleProject:start the Scala REPL w/sbt+build-def on the classpath'
'dist:generate distribution artifacts' 'dist:generate distribution artifacts'
'dist\:clean:clean distribution artifacts' 'dist\:clean:clean distribution artifacts'
'doc:generate API documentation' 'doc:generate API documentation'
'gen-idea:generate Intellij Idea project files' 'genIdea:generate Intellij Idea project files'
'package:produce the main artifact, such as a binary jar' 'package:produce the main artifact, such as a binary jar'
'package-doc:produce a doc artifact, such as a jar containing API docs' 'packageDoc:produce a doc artifact, such as a jar containing API docs'
'package-src:produce a source artifact, such as a jar containing sources' 'packageSrc:produce a source artifact, such as a jar containing sources'
'publish:publish artifacts to a repository' 'publish:publish artifacts to a repository'
'publish-local:publish artifacts to the local repository' 'publishLocal:publish artifacts to the local repository'
'publish-m2:publish artifacts to the local Maven 2 repository' 'publishM2:publish artifacts to the local Maven 2 repository'
'run:run a main class' 'run:run a main class'
'run-main:run the main class selected by the first argument' 'runMain:run the main class selected by the first argument'
'test:execute all tests' 'test:execute all tests'
'test-only:execute the tests provided as arguments' 'testOnly:execute the tests provided as arguments'
'test-quick:execute previously failed tests' 'testQuick:execute previously failed tests'
'update:resolve and optionally retrieve dependencies' 'update:resolve and optionally retrieve dependencies'
) )

View File

@ -9,17 +9,17 @@
alias sbc='sbt compile' alias sbc='sbt compile'
alias sbcc='sbt clean compile' alias sbcc='sbt clean compile'
alias sbco='sbt console' alias sbco='sbt console'
alias sbcq='sbt console-quick' alias sbcq='sbt consoleQuick'
alias sbcln='sbt clean' alias sbcln='sbt clean'
alias sbcp='sbt console-project' alias sbcp='sbt consoleProject'
alias sbd='sbt doc' alias sbd='sbt doc'
alias sbdc='sbt dist:clean' alias sbdc='sbt dist:clean'
alias sbdi='sbt dist' alias sbdi='sbt dist'
alias sbgi='sbt gen-idea' alias sbgi='sbt genIdea'
alias sbp='sbt publish' alias sbp='sbt publish'
alias sbpl='sbt publish-local' alias sbpl='sbt publishLocal'
alias sbr='sbt run' alias sbr='sbt run'
alias sbrm='sbt run-main' alias sbrm='sbt runMain'
alias sbu='sbt update' alias sbu='sbt update'
alias sbx='sbt test' alias sbx='sbt test'
alias sba='sbt assembly' alias sba='sbt assembly'

View File

@ -38,3 +38,4 @@ The plugin also supports the following -
| `ZSH_TMUX_FIXTERM_WITHOUT_256COLOR` | `$TERM` to use for non 256-color terminals (default: `screen`) | | `ZSH_TMUX_FIXTERM_WITHOUT_256COLOR` | `$TERM` to use for non 256-color terminals (default: `screen`) |
| `ZSH_TMUX_FIXTERM_WITH_256COLOR` | `$TERM` to use for 256-color terminals (default: `screen-256color` | | `ZSH_TMUX_FIXTERM_WITH_256COLOR` | `$TERM` to use for 256-color terminals (default: `screen-256color` |
| `ZSH_TMUX_CONFIG` | Set the configuration path (default: `$HOME/.tmux.conf`) | | `ZSH_TMUX_CONFIG` | Set the configuration path (default: `$HOME/.tmux.conf`) |
| `ZSH_TMUX_UNICODE` | Set `tmux -u` option to support unicode |

View File

@ -36,6 +36,8 @@ alias tkss='tmux kill-session -t'
: ${ZSH_TMUX_FIXTERM_WITH_256COLOR:=screen-256color} : ${ZSH_TMUX_FIXTERM_WITH_256COLOR:=screen-256color}
# Set the configuration path # Set the configuration path
: ${ZSH_TMUX_CONFIG:=$HOME/.tmux.conf} : ${ZSH_TMUX_CONFIG:=$HOME/.tmux.conf}
# Set -u option to support unicode
: ${ZSH_TMUX_UNICODE:=false}
# Determine if the terminal supports 256 colors # Determine if the terminal supports 256 colors
if [[ $terminfo[colors] == 256 ]]; then if [[ $terminfo[colors] == 256 ]]; then
@ -62,6 +64,7 @@ function _zsh_tmux_plugin_run() {
local -a tmux_cmd local -a tmux_cmd
tmux_cmd=(command tmux) tmux_cmd=(command tmux)
[[ "$ZSH_TMUX_ITERM2" == "true" ]] && tmux_cmd+=(-CC) [[ "$ZSH_TMUX_ITERM2" == "true" ]] && tmux_cmd+=(-CC)
[[ "$ZSH_TMUX_UNICODE" == "true" ]] && tmux_cmd+=(-u)
# Try to connect to an existing session. # Try to connect to an existing session.
[[ "$ZSH_TMUX_AUTOCONNECT" == "true" ]] && $tmux_cmd attach [[ "$ZSH_TMUX_AUTOCONNECT" == "true" ]] && $tmux_cmd attach

View File

@ -77,6 +77,12 @@ if [[ ! $DISABLE_VENV_CD -eq 1 ]]; then
else else
ENV_NAME="" ENV_NAME=""
fi fi
if [[ -n $CD_VIRTUAL_ENV && "$ENV_NAME" != "$CD_VIRTUAL_ENV" ]]; then
# We've just left the repo, deactivate the environment
# Note: this only happens if the virtualenv was activated automatically
deactivate && unset CD_VIRTUAL_ENV
fi
if [[ "$ENV_NAME" != "" ]]; then if [[ "$ENV_NAME" != "" ]]; then
# Activate the environment only if it is not already active # Activate the environment only if it is not already active
if [[ "$VIRTUAL_ENV" != "$WORKON_HOME/$ENV_NAME" ]]; then if [[ "$VIRTUAL_ENV" != "$WORKON_HOME/$ENV_NAME" ]]; then
@ -86,10 +92,6 @@ if [[ ! $DISABLE_VENV_CD -eq 1 ]]; then
source $ENV_NAME/bin/activate && export CD_VIRTUAL_ENV="$ENV_NAME" source $ENV_NAME/bin/activate && export CD_VIRTUAL_ENV="$ENV_NAME"
fi fi
fi fi
elif [[ -n $CD_VIRTUAL_ENV && -n $VIRTUAL_ENV ]]; then
# We've just left the repo, deactivate the environment
# Note: this only happens if the virtualenv was activated automatically
deactivate && unset CD_VIRTUAL_ENV
fi fi
fi fi
} }

View File

@ -27,6 +27,7 @@ plugins=(... yarn)
| yh | `yarn help` | Show help for a yarn command | | yh | `yarn help` | Show help for a yarn command |
| yi | `yarn init` | Interactively creates or updates a package.json file | | yi | `yarn init` | Interactively creates or updates a package.json file |
| yin | `yarn install` | Install dependencies defined in `package.json` | | yin | `yarn install` | Install dependencies defined in `package.json` |
| yln | `yarn lint` | Run the lint script defined in `package.json` |
| yls | `yarn list` | List installed packages | | yls | `yarn list` | List installed packages |
| yout | `yarn outdated` | Check for outdated package dependencies | | yout | `yarn outdated` | Check for outdated package dependencies |
| yp | `yarn pack` | Create a compressed gzip archive of package dependencies | | yp | `yarn pack` | Create a compressed gzip archive of package dependencies |

View File

@ -12,6 +12,7 @@ alias ygu="yarn global upgrade"
alias yh="yarn help" alias yh="yarn help"
alias yi="yarn init" alias yi="yarn init"
alias yin="yarn install" alias yin="yarn install"
alias yln="yarn lint"
alias yls="yarn list" alias yls="yarn list"
alias yout="yarn outdated" alias yout="yarn outdated"
alias yp="yarn pack" alias yp="yarn pack"

View File

@ -25,18 +25,14 @@ if [ -e "$ZSHRC_ORIG" ]; then
echo "Your original zsh config was restored." echo "Your original zsh config was restored."
fi fi
if hash chsh >/dev/null 2>&1; then if hash chsh >/dev/null 2>&1 && [ -f ~/.shell.pre-oh-my-zsh ]; then
if [ -f ~/.shell.pre-oh-my-zsh ]; then old_shell=$(cat ~/.shell.pre-oh-my-zsh)
old_shell=$(cat ~/.shell.pre-oh-my-zsh)
else
old_shell=/bin/bash
fi
echo "Switching your shell back to '$old_shell':" echo "Switching your shell back to '$old_shell':"
if chsh -s "$old_shell"; then if chsh -s "$old_shell"; then
rm -f ~/.shell.pre-oh-my-zsh rm -f ~/.shell.pre-oh-my-zsh
else else
echo "Could not change default shell. Change it manually by running chsh" echo "Could not change default shell. Change it manually by running chsh"
echo "or editing the /etc/passwd file." echo "or editing the /etc/passwd file."
fi fi
fi fi