Skip to content

Commit

Permalink
Refactor .zshrc
Browse files Browse the repository at this point in the history
Added fix to resolve the % problem
  • Loading branch information
sydrawat01 authored May 11, 2020
1 parent 0411c7d commit 44a01d1
Showing 1 changed file with 37 additions and 51 deletions.
88 changes: 37 additions & 51 deletions configs/hyper/.zshrc
Original file line number Diff line number Diff line change
Expand Up @@ -4,32 +4,37 @@
# Path to your oh-my-zsh installation.
export ZSH="/Users/sid/.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.
# See https://github.com/robbyrussell/oh-my-zsh/wiki/Themes
#ZSH_THEME="robbyrussell"
ZSH_THEME="spaceship"

# 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 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/ohmyzsh/ohmyzsh/wiki/Themes
ZSH_THEME="robbyrussell"

# 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.
# 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

# 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"

Expand All @@ -49,54 +54,29 @@ DISABLE_AUTO_TITLE="true"

# 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?
# 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.
plugins=(
git
git
)

source $ZSH/oh-my-zsh.sh

# User configuration

# export MANPATH="/usr/local/man:$MANPATH"

# You may need to manually set your language environment
# export LANG=en_US.UTF-8

# Preferred editor for local and remote sessions
# if [[ -n $SSH_CONNECTION ]]; then
# export EDITOR='vim'
# else
# export EDITOR='mvim'
# fi

# 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.
# For a full list of active aliases, run `alias`.
#
# Example aliases
# alias zshconfig="mate ~/.zshrc"
# alias ohmyzsh="mate ~/.oh-my-zsh"


# ~/.zshrc

# This is from here: https://github.com/zeit/hyper/issues/1188#issuecomment-332606903
# Override auto-title when static titles are desired ($ title My new title)
title() { export TITLE_OVERRIDDEN=1; echo -en "\e]0;$*\a"}
# Turn off static titles ($ autotitle)
Expand Down Expand Up @@ -137,13 +117,19 @@ reactDev() {
npm i react react-dom styled-components
npm i -D @babel/core @babel/preset-env @babel/preset-react babel-loader html-webpack-plugin webpack webpack-cli webpack-dev-server
}

# Install dependencies for eslint and prettier
# Install dependencies for eslint and prettier and initialize with min configs
eslint() {
npm i -D eslint prettier eslint-plugin-prettier eslint-config-prettier eslint-plugin-node eslint-config-node
npm i -D eslint prettier eslint-plugin-prettier eslint-config-prettier eslint-plugin-node eslint-config-node babel-eslint
npx install-peerdeps --dev eslint-config-airbnb
printf '{\n "printWidth": 100,\n "semi": true,\n "singleQuote": true,\n "trailingComma": "all",\n "bracketSpacing": true,\n "arrowParens": "always"\n}' > .prettierrc
printf '{\n "extends": ["airbnb", "prettier", "plugin:node/recommended"],\n "plugins": ["prettier"],\n "env": {\n "browser": true,\n "node": true,\n "es6": true\n },\n "rules": {\n "node/no-unsupported-features/node-builtins": "off",\n "no-param-reassign": "off",\n "prettier/prettier": "error",\n "no-unused-vars": "warn",\n "no-console": "off",\n "func-names": "off",\n "no-process-exit": "off",\n "object-shorthand": "off",\n "class-methods-use-this": "off",\n "no-shadow": "warn"\n }\n}' > .eslintrc
printf 'public\nstatic\n.cache\ncontent\n' > .eslintignore
printf '.cache\npackage.json\npackage-lock.json\npublic\n' > .prettierignore
printf '{\n "printWidth": 100,\n "semi": true,\n "singleQuote": true,\n "trailingComma": "all",\n "bracketSpacing": true,\n "arrowParens": "avoid"\n}' > .prettierrc
printf '{\n "extends": ["airbnb", "prettier"],\n "plugins": ["prettier", "import", "react", "jsx-a11y"],\n "env": {\n "browser": true,\n "node": true,\n "es6": true\n },\n "rules": {\n "node/no-unsupported-features/node-builtins": "off",\n "no-param-reassign": "off",\n "prettier/prettier": "error",\n "no-unused-vars": "warn",\n "no-console": "off",\n "func-names": "off",\n "no-process-exit": "off",\n "object-shorthand": "off",\n "class-methods-use-this": "off",\n "no-shadow": "warn"\n },\n "parser": "babel-eslint",\n "parserOptions": {\n "sourceType": "module",\n "allowImportExportEverywhere": true\n }\n}' > .eslintrc
}

# spaceship-prompt
autoload -U promptinit; promptinit
prompt spaceship

# fix Hyper first line precent % sign
unsetopt PROMPT_SP

0 comments on commit 44a01d1

Please sign in to comment.