Skip to content

Commit 6acf03d

Browse files
fdellwinggmta
authored andcommitted
Ports: Add default zshrc
Previosly we had a very messed up PS1 as the Shell PROMPT is not unset correctly. We now provide a default `zshrc` file for the system that uses sane values for basic categories like aliases, autocompletion and history management to make the port more usable. It also forces the prompt to be the default zsh one.
1 parent 3d4d0a1 commit 6acf03d

File tree

3 files changed

+51
-0
lines changed

3 files changed

+51
-0
lines changed

Ports/zsh/.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
!zshrc

Ports/zsh/package.sh

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,3 +13,7 @@ pre_configure() {
1313
post_configure() {
1414
run_replace_in_file "s/define HAVE_PRCTL 1/undef HAVE_PRCTL/" config.h
1515
}
16+
17+
post_install() {
18+
cp "${PORT_META_DIR}/zshrc" "${SERENITY_INSTALL_ROOT}/etc/"
19+
}

Ports/zsh/zshrc

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
###############
2+
# Completions #
3+
###############
4+
5+
# Completions
6+
autoload -U compinit
7+
compinit -C
8+
9+
# Arrow key menu for completions
10+
zstyle ':completion:*' menu select
11+
12+
# Case-insensitive (all),partial-word and then substring completion
13+
zstyle ':completion:*' matcher-list 'm:{a-zA-Z}={A-Za-z}' 'r:|[._-]=* r:|=*' 'l:|=* r:|=*'
14+
15+
###########
16+
# Aliases #
17+
###########
18+
19+
# Set up aliases
20+
alias ll='ls -l'
21+
22+
# Autocomplete command line switches for aliases
23+
setopt completealiases
24+
25+
###########
26+
# History #
27+
###########
28+
29+
# number of lines kept in history
30+
HISTSIZE=1000
31+
# number of lines saved in the history after logout
32+
SAVEHIST=1000
33+
# location of history
34+
HISTFILE=~/.zsh_history
35+
# append command to history file once executed
36+
setopt inc_append_history
37+
# only show past commands that include the current input
38+
bindkey "^[[A" history-beginning-search-backward
39+
bindkey "^[[B" history-beginning-search-forward
40+
41+
########
42+
# Misc #
43+
########
44+
45+
# Set prompt
46+
PROMPT='%m%# '

0 commit comments

Comments
 (0)