Skip to content

A sensible system-wide Zsh configuration for Alpine Linux

License

Notifications You must be signed in to change notification settings

jirutka/alpine-zsh-config

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

45 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Zsh Configuration for Alpine Linux

Binaries Workflow

The aim of this project is to provide a sensible default (system-wide) Zsh configuration that will meet the basic needs and expectations of most users. In other words, make Zsh easy to use right out of the box, without having to configure it, while not getting in the way of individual user customization.

Features

Tip
If you as a user want to disable some of these features, define variable zshrc_blacklist with an array of the script names (without .zsh suffix) in your $ZDOTDIR/.zshenv [2], for example: zshrc_blacklist=(50-command-not-found 70-completion).

Key Bindings

List of key bindings defined in the emacs, viins, and vicmd keymaps.

  • Home – move cursor to the beginning of a line

  • End – move cursor to the end of a line

  • Delete – delete the next character

  • Page Up – move cursor up a line, or if already at the top line, move to the previous event in the history

  • Page Down – move cursor down a line, or if already at the bottom line, move to the next event in the history

  • Up Arrow – move cursor up a line, or if already at the top line, fuzzy search backward in the history for a line beginning with a whole line prefix up to the cursor position

  • Down Arrow – move cursor down a line, or if already at the bottom line, fuzzy search forward in the history for a line beginning with a whole line prefix up to the cursor position

  • Shift+Tab – perform menu completion, or if a menu completion is already in progress, move to the previous completion

  • Ctrl+Insert – copy the area from cursor to the mark to the kill buffer and clipboard (if available)

  • Ctrl+Delete – delete (and copy) the next word

  • Ctrl+Left Arrow – move cursor to the beginning of the previous word

  • Ctrl+Right Arrow – move cursor to the beginning of the next word

Configuration Variables

Users can define the following configuration variables in their `$ZDOTDIR/.zshenv`[2] to override the default settings.

Variable Name Default Value Description

ZSH_CACHE_DIR

$XDG_CACHE_HOME/zsh or $HOME/.cache/zsh

Path to a directory where to store cache files (e.g. completion cache). If it doesn’t exist, it will be created.

ZSH_DATA_DIR

$XDG_DATA_HOME/zsh or $HOME/.local/share/zsh

Path to a directory where to store persistent data files (e.g. Zsh history). If it doesn’t exist, it will be created.

ZSH_COMPDUMP

$ZSH_CACHE_DIR/zcompdump

Path to the Zsh completion dump file.

HISTFILE

$ZSH_DATA_DIR/history or $ZDOTDIR/.zsh_history or $HOME/.zsh_history

Path to the Zsh history file. If ${ZDOTDIR:-$HOME}/.zsh_history exists, it will be preferred.

ZSH_CUTBUFFER_CLIPBOARD

"primary"

The system clipboard to synchronize the kill (cut) buffer with; either "primary" (selection), or "clipboard" (regular clipboard).

osc52_supported_terms

('alacritty' 'foot' 'xterm-kitty')

An array of $TERM values that identify terminals with OSC 52 support (access to system clipboard). This is just a shortcut to skip dynamic detection using tty-copy --test for known terminals.

Requirements

Installation

Install package alpine-zsh-config on Alpine Linux Edge, v3.16 or later:

apk add alpine-zsh-config

License

This project is licensed under MIT License. For the full text of the license, see the LICENSE file.


1. OSC 133 allows terminal features such as jumping to the previous/next prompt in the scrollback or opening the output of the last command in a pager. It is supported e.g. in Kitty, WezTerm, iTerm2.
2. $ZDOTDIR/.zshenv is by default ~/.config/zsh/.zshenv, or ~/.zshenv if ~/.zshrc exists.