Skip to content

Instantly share code, notes, and snippets.

@telnet2
Last active August 7, 2021 19:12
Show Gist options
  • Save telnet2/5b2ec3bbaeda06f8f337830a52d724d2 to your computer and use it in GitHub Desktop.
Save telnet2/5b2ec3bbaeda06f8f337830a52d724d2 to your computer and use it in GitHub Desktop.
Debian Bullseye Setup script
# for the docker image debian:bullseye
ZHOME="${ZDOTDIR:-$HOME}/.zprezto"
# sudo apt-get install git software-properties-common
if [ ! -d "${ZHOME}" ]; then
git clone --recursive https://github.com/sorin-ionescu/prezto.git "${ZHOME}"
git clone https://github.com/zdharma/fast-syntax-highlighting "${ZHOME}/modules/fast-syntax-highlighting"
# Rename .z* file to ._z* using glob qualifier (.) to select plain files only
# and (N) to ignore no match error; existing symlinks will not be changed.
for f in .z*(.DN); do mv $f $f:s/.z/.z_/ ; done
setopt EXTENDED_GLOB
for rcfile in "${ZHOME}"/runcoms/^README.md(.N); do
if [ ! -f "${ZDOTDIR:-$HOME}/.${rcfile:t}" ]; then
ln -s "$rcfile" "${ZDOTDIR:-$HOME}/.${rcfile:t}"
fi
done
rm -rf ~/.zpreztorc
cat <<'EOF' >> ~/.zpreztorc
zstyle ':prezto:*:*' color 'yes'
zstyle ':prezto:load' pmodule \
'fasd' \
'environment' \
'terminal' \
'editor' \
'history' \
'directory' \
'spectrum' \
'utility' \
'autosuggestions' \
'completion' \
'prompt' \
'git' \
'node' \
'fast-syntax-highlighting' \
'history-substring-search'
zstyle ':prezto:module:editor' key-bindings 'emacs'
zstyle ':prezto:module:prompt' theme 'sorin'
zstyle ':prezto:module:fzf' key-bindings 'yes'
zstyle ':prezto:module:fzf' completion 'yes'
zstyle ':prezto:module:fzf' height '30%'
zstyle ':prezto:module:fzf' tmux 'yes'
zstyle ':prezto:module:fzf' colorscheme 'Solarized Light'
EOF
# <<<need to set the locale; otherwise `perl -e exit` would cause locale warning.
cat <<'EOF' >> ~/.zshrc
export LC_ALL=en_US.UTF-8
export LANG=en_US.UTF-8
export LANGUAGE=en_US.UTF-8
EOF
locale-gen
localedef -i en_US -f UTF-8 en_US.UTF-8
# >>>need to set the locale; otherwise `perl -e exit` would cause locale warning.
fi
if [ ! -d "${HOME}/.fzf" ]; then
git clone --depth 1 https://github.com/junegunn/fzf.git ${HOME}/.fzf
${HOME}/.fzf/install
fi
if [[ ! -d ~/.vim/bundle/Vundle.vim ]]; then
git clone https://github.com/VundleVim/Vundle.vim.git ~/.vim/bundle/Vundle.vim
fi
if [[ ! -f ~/.vimrc ]]; then
curl https://gist.githubusercontent.com/telnet2/048a582b5a3354ad70cab9c6f787390c/raw/870f6742fa15bf6c30a826dcfb863821db8e1aa9/.vimrc > ~/.vimrc
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment