Set up a local development environment with zsh, prezto, fzf, the sorinx prompt theme, and vim with Vundle plugins.
Run this skill on a new machine or container to bootstrap the shell and editor environment.
This setup requires zsh as the default shell.
echo "$SHELL"If the output is not a path ending in zsh (e.g. /bin/zsh or /usr/bin/zsh), ask the user:
Your default shell is
$SHELL. This setup requires zsh. Would you like to switch your default shell to zsh?
If the user agrees:
- First verify zsh is installed:
command -v zshIf zsh is not found, install it:
- macOS: zsh is pre-installed since Catalina. If missing:
brew install zsh - Ubuntu/Debian:
sudo apt-get update && sudo apt-get install -y zsh - Fedora:
sudo dnf install -y zsh - Arch:
sudo pacman -S --noconfirm zsh - Alpine:
sudo apk add zsh
- Change the default shell. This requires the user's password:
chsh -s "$(command -v zsh)"If chsh fails due to permissions (e.g. in a container or restricted environment), instruct the user:
Run
sudo chsh -s $(command -v zsh) $USERor addexec zshto the end of your~/.bashrc.
Do not proceed with the remaining steps until zsh is confirmed as available.
Download the setup script from the gist:
curl -fsSL "https://gist.githubusercontent.com/telnet2/5b2ec3bbaeda06f8f337830a52d724d2/raw/setup.zsh" -o /tmp/setup.shThe script must be run with zsh because it uses zsh-specific glob qualifiers (e.g. (.DN), (z)):
zsh /tmp/setup.shThis script performs the following (skipping components that already exist):
- Clones prezto to
~/.zpreztowith fast-syntax-highlighting module - Backs up existing
.z*dotfiles and symlinks prezto runcoms - Writes
~/.zpreztorcwith modules: fasd, environment, terminal, editor, history, directory, spectrum, utility, autosuggestions, completion, prompt, git, node, fast-syntax-highlighting, history-substring-search - Sets locale to
en_US.UTF-8in~/.zshrc - Clones fzf to
~/.fzfand runs its installer - Clones Vundle to
~/.vim/bundle/Vundle.vim - Downloads a pre-configured
.vimrc
After running, confirm these exist:
ls -d ~/.zprezto ~/.fzf ~/.vim/bundle/Vundle.vim ~/.vimrc ~/.zpreztorcIf any are missing, the script may have encountered an error. Check the output and re-run if needed.
Download the sorinx prompt theme and its installer:
curl -fsSL "https://gist.githubusercontent.com/telnet2/affe231f01922b1b0ec28a2702fff0f9/raw/prompt_sorinx_setup" -o ~/.zprezto/modules/prompt/functions/prompt_sorinx_setupThen update ~/.zpreztorc to use the sorinx theme instead of sorin:
sed -i.bak "s/theme 'sorin'/theme 'sorinx'/" ~/.zpreztorc && rm -f ~/.zpreztorc.bakOn macOS, use:
sed -i '' "s/theme 'sorin'/theme 'sorinx'/" ~/.zpreztorcgrep "theme" ~/.zpreztorcExpected output should contain theme 'sorinx'.
Install all Vundle plugins in headless mode without launching an interactive vim session:
vim -E -s -u ~/.vimrc +PluginInstall +qallIf vim -E has issues (some plugins produce errors in Ex mode), use this alternative:
vim +PluginInstall +qall < /dev/null > /dev/null 2>&1This runs vim with a null stdin so it doesn't wait for user input, installs all plugins defined in .vimrc via Vundle, then exits.
ls ~/.vim/bundle/ | head -20You should see directories for the configured plugins (e.g. nerdtree, vim-fugitive, ctrlp.vim, vim-colors-solarized, etc.).
Start a new zsh session to load the full configuration:
exec zsh| Step | macOS | Ubuntu/Debian | Fedora | Other Linux |
|---|---|---|---|---|
| zsh | pre-installed | apt-get install zsh |
dnf install zsh |
install via pkg mgr |
| setup.sh | zsh /tmp/setup.sh |
zsh /tmp/setup.sh |
same | same |
| locale-gen | not needed | may need sudo locale-gen |
same | varies |
| sorinx theme | sed -i '' |
sed -i.bak |
sed -i.bak |
sed -i.bak |
| vim plugins | headless vim +PluginInstall +qall |
same | same | same |