Skip to content

Latest commit

 

History

History
251 lines (167 loc) · 8.4 KB

readme.md

File metadata and controls

251 lines (167 loc) · 8.4 KB

>_ typewritten - a minimal zsh prompt theme

Leaves all the room for what's important.

typewritten zsh prompt demo

Terminal is iTerm2 — Font is JetBrains Mono — Terminal theme is Seoul256

Features

Quick start

npm

npm install -g typewritten

That's it. The script will make the necessary symlinks to fpath and set the prompt in your .zshrc.

Manual

Clone the typewritten repository somewhere you can easily link. I recommend creating a .zsh directory at root.

mkdir -p "$HOME/.zsh"
git clone https://github.com/reobin/typewritten.git "$HOME/.zsh/typewritten"

Load typewritten in your .zshrc by using zsh prompinit:

fpath+=$HOME/.zsh/typewritten
autoload -U promptinit; promptinit
prompt typewritten

Note: if using oh-my-zsh, set ZSH_THEME="" in your .zshrc to disable oh-my-zsh themes.

Clone the repository into your custom oh-my-zsh themes directory:

git clone https://github.com/reobin/typewritten.git $ZSH_CUSTOM/themes/typewritten

Symlink typewritten.zsh-theme to your oh-my-zsh custom themes directory:

ln -s "$ZSH_CUSTOM/themes/typewritten/typewritten.zsh-theme" "$ZSH_CUSTOM/themes/typewritten.zsh-theme"

Set ZSH_THEME="typewritten" in your .zshrc file.

Add antibody bundle reobin/typewritten to your .zshrc.

Add zgen load reobin/typewritten typewritten to your .zshrc.

Add zmodule reobin/typewritten --name typewritten to your .zimrc and run zimfw install.

Add zplug reobin/typewritten, as:theme to your .zshrc.

Customization options

Click on an option's name to see more info.

Option Description Available options Default value
TYPEWRITTEN_PROMPT_LAYOUT Defines how the prompt is displayed. singleline, half_pure , pure, singleline_verbose, and multiline singleline
TYPEWRITTEN_SYMBOL Defines the prompt symbol. Any string value >
TYPEWRITTEN_GIT_RELATIVE_PATH If true, the current git home directory name is always shown next to the current directory name. true or false false
TYPEWRITTEN_CURSOR Defines the used cursor. underscore, beam, or block underscore
TYPEWRITTEN_RIGHT_PROMPT_PREFIX Defines what is displayed just before the right part of the prompt. Any string

All of these options are configurable through your .zshrc file like this:

export TYPEWRITTEN_PROMPT_LAYOUT="singleline"

TYPEWRITTEN_PROMPT_LAYOUT

Default single line (TYPEWRITTEN_PROMPT_LAYOUT="singleline")

singleline prompt layout

Half pure (TYPEWRITTEN_PROMPT_LAYOUT="half_pure")

half pure prompt layout

Pure (TYPEWRITTEN_PROMPT_LAYOUT="pure")

pure prompt layout

Single line - verbose variation (TYPEWRITTEN_PROMPT_LAYOUT="singleline_verbose")

single line verbose prompt layout

Multiline (TYPEWRITTEN_PROMPT_LAYOUT="multiline")

multiline prompt layout

TYPEWRITTEN_SYMBOL

Here are some examples of customized prompt symbols.

Default (TYPEWRITTEN_SYMBOL="❯")

default symbol

Dollar sign (TYPEWRITTEN_SYMBOL="$")

dollar sign symbol

Full arrow (TYPEWRITTEN_SYMBOL="->")

arrow symbol

TYPEWRITTEN_GIT_RELATIVE_PATH

By default, the git root directory is always displayed no matter how far you are inside it. To turn it off and display only the current directory, set TYPEWRITTEN_GIT_RELATIVE_PATH to false.

Default behaviour (TYPEWRITTEN_GIT_RELATIVE_PATH=true)

/.../ is displayed when the nesting gets more than one level deep.

default git relative path

Hide git home directory (TYPEWRITTEN_GIT_RELATIVE_PATH=false)

hide git home directory

TYPEWRITTEN_CURSOR

Default underscore (TYPEWRITTEN_CURSOR="underscore")

underscore cursor

Beam (TYPEWRITTEN_CURSOR="beam")

beam cursor

Block (TYPEWRITTEN_CURSOR="block")

block cursor

TYPEWRITTEN_RIGHT_PROMPT_PREFIX

Bash comment prefix (TYPEWRITTEN_RIGHT_PROMPT_PREFIX="# ")

bash comment prefix

More info

git status indicators

  • ?   — untracked change(s);
  • +   — staged change(s);
  • !   — file(s) modified in the repo;
  • »   — renamed file(s);
  •   — deleted file(s);
  • $   — stashed change(s);
  • #   — unmerged change(s);
  • •|   — behind of remote branch;
  • |•   — ahead of remote branch;
  • ~   — Branches have diverged;

Git status can be disabled by setting git config value in a repo or globally like so:

git config --add oh-my-zsh.hide-status 1

return code

When an error happens, the prompt symbol changes to a red color, and the return code is displayed on the left.

127 return code

The return code display can be disbled by setting TYPEWRITTEN_DISABLE_RETURN_CODE to true in your .zshrc

Credits

Contributors

A special thanks to all the contributors to this project

Inspiration

pure layout is inspired by Pure