Skip to content

📣 Expand your aliases during presentations

License

Notifications You must be signed in to change notification settings

idadzie/zsh-presenter-mode

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

24 Commits
 
 
 
 
 
 
 
 

Repository files navigation

zsh-presenter-mode

Maintenance

Zsh plugin to expand aliases during presentations.

It also increases the terminal window's contrast to enhance visibility. 😉

💾 Installation

Using Zinit

Add the snippet below to your .zshrc file.

zinit ice wait'0' lucid
zinit light idadzie/zsh-presenter-mode

# or using the for syntax.
zinit light-mode for idadzie/zsh-presenter-mode

Manual

Clone this repository and source the zsh-presenter-mode.plugin.zsh file in your .zshrc file.

# Clone this repository.
git clone https://github.com/idadzie/zsh-presenter-mode.git $XDG_DATA_HOME/zsh-presenter-mode

# Append to your .zshrc file.
echo "source $XDG_DATA_HOME/zsh-presenter-mode/zsh-presenter-mode.plugin.zsh" | tee -a "${ZDOTDIR:-$HOME}/.zshrc"

🚀 How to use

In any terminal window, use the key binding Ctrl P,Ctrl M or the alias presenter-toggle to quickly switch between modes.

🔧 Customisation

You can change the default key binding by adding the snippet below to your .zshrc.

bindkey '\e\e' toggle-presenter-mode

To not pollute the global namespace, there's a single $PRESENTER_MODE hash you can add to your .zshrc to customise the default parameters before loading this plugin.

Hash Field Description
PRESENTER_MODE[BANNER_SHOW] Show banner text when presentation mode is activated. Default: 1
PRESENTER_MODE[SHOW_PREEXEC_ARRAY] Show preexec array when presentation mode is toggled. Default: 0
PRESENTER_MODE[BANNER_TEXT] Banner text when presentation mode is activated. Default: PRESENTATION MODE
PRESENTER_MODE[BG_DEFAULT] Background colour to set after presentation mode is deactivated. Default: #282828

Example

declare -A PRESENTER_MODE
PRESENTER_MODE[BANNER_TEXT]='Welcome to My TED Talk!'
PRESENTER_MODE[BG_DEFAULT]='#2c2c2c'
PRESENTER_MODE[SHOW_PREEXEC_ARRAY]=1

# Load the plugin below.
...

🤝 Credit

The main presenter_mode_{start,stop} functions were borrowed from robobenklein's amazing dotfiles.

💖 Like this project ?

Leave a ⭐ If you think this project is cool.