[Fix #253] Move Prezto settings into their own file

This commit is contained in:
Sorin Ionescu 2012-09-03 16:38:18 -04:00
parent d041e44cfe
commit cc7e43b242
16 changed files with 97 additions and 76 deletions

View file

@ -22,8 +22,9 @@ version is 4.3.10.
3. Create a new Zsh configuration by copying the Zsh configuration files 3. Create a new Zsh configuration by copying the Zsh configuration files
provided: provided:
for rcfile in "${ZDOTDIR:-$HOME}/.zprezto/runcoms/z"{shenv,shrc,login,logout}; do setopt EXTENDED_GLOB
ln -s "$rcfile" "$ZDOTDIR/.$rcfile:t" for rcfile in "${ZDOTDIR:-$HOME}"/.zprezto/runcoms/^README.md(.N); do
ln -s "$rcfile" "$ZDOTDIR/.${rcfile:t}"
done done
4. Set Zsh as your default shell: 4. Set Zsh as your default shell:
@ -66,15 +67,15 @@ accompanying README files to learn of what is available.
### Modules ### Modules
1. Browse */modules* to see what is available. 1. Browse */modules* to see what is available.
2. Load the modules you need in *~/.zshrc* then open a new Zsh terminal window 2. Load the modules you need in *~/.zpreztorc* then open a new Zsh terminal
or tab. window or tab.
### Themes ### Themes
1. For a list of themes, type `prompt -l`. 1. For a list of themes, type `prompt -l`.
2. To preview a theme, type `prompt -p name`. 2. To preview a theme, type `prompt -p name`.
3. Load the theme you like in *~/.zshrc* then open a new Zsh terminal window 3. Load the theme you like in *~/.zpreztorc* then open a new Zsh terminal
or tab. window or tab.
![sorin theme][2] ![sorin theme][2]

View file

@ -18,6 +18,11 @@ if [[ -s "${ZDOTDIR:-$HOME}/.zpreztorc" ]]; then
source "${ZDOTDIR:-$HOME}/.zpreztorc" source "${ZDOTDIR:-$HOME}/.zpreztorc"
fi fi
# Source the Prezto configuration file.
if [[ -s "${ZDOTDIR:-$HOME}/.zpreztorc" ]]; then
source "${ZDOTDIR:-$HOME}/.zpreztorc"
fi
# Disable color and theme in dumb terminals. # Disable color and theme in dumb terminals.
if [[ "$TERM" == 'dumb' ]]; then if [[ "$TERM" == 'dumb' ]]; then
zstyle ':prezto:*:*' color 'no' zstyle ':prezto:*:*' color 'no'
@ -37,7 +42,7 @@ unset zfunction{s,}
# Source files (the order matters). # Source files (the order matters).
source "${0:h}/helper.zsh" source "${0:h}/helper.zsh"
# Source Prezto modules defined in ~/.zshrc. # Load Prezto modules.
zstyle -a ':prezto:load' pmodule 'pmodules' zstyle -a ':prezto:load' pmodule 'pmodules'
pmodload "$pmodules[@]" pmodload "$pmodules[@]"
unset pmodules unset pmodules

View file

@ -5,12 +5,13 @@
# Sorin Ionescu <sorin.ionescu@gmail.com> # Sorin Ionescu <sorin.ionescu@gmail.com>
# #
# Usage: # Usage:
# To enable key bindings, add the following to zshrc, and replace 'map' with # To enable key bindings, add the following to zpreztorc, and replace 'map'
# 'emacs' or 'vi. # with 'emacs' or 'vi.
# #
# zstyle ':prezto:module:editor' keymap 'map' # zstyle ':prezto:module:editor' keymap 'map'
# #
# To enable the auto conversion of .... to ../.., add the following to zshrc. # To enable the auto conversion of .... to ../.., add the following to
# zpreztorc.
# #
# zstyle ':prezto:module:editor' dot-expansion 'yes' # zstyle ':prezto:module:editor' dot-expansion 'yes'
# #

View file

@ -17,7 +17,7 @@ Settings
### Prefix ### Prefix
To use a different prefix, add the following to *zshrc*, and replace 'g' with To use a different prefix, add the following to *zpreztorc*, and replace 'g' with
the desired prefix: the desired prefix:
zstyle ':prezto:module:gnu-utility' prefix 'g' zstyle ':prezto:module:gnu-utility' prefix 'g'

View file

@ -22,7 +22,7 @@ Settings
### Case Sensitivity ### Case Sensitivity
To enable case-sensitivity for this module only, add the following line to To enable case-sensitivity for this module only, add the following line to
*zshrc*: *zpreztorc*:
zstyle ':prezto:module:history-substring-search' case-sensitive 'yes' zstyle ':prezto:module:history-substring-search' case-sensitive 'yes'
@ -31,7 +31,8 @@ To enable case-sensitivity for this module only, add the following line to
If colors are enabled, *history-substring-search* will automatically highlight If colors are enabled, *history-substring-search* will automatically highlight
positive results. positive results.
To enable highlighting for this module only, add the following line to *zshrc*: To enable highlighting for this module only, add the following line to
*zpreztorc*:
zstyle ':prezto:module:history-substring-search' color 'yes' zstyle ':prezto:module:history-substring-search' color 'yes'

View file

@ -8,14 +8,14 @@ Settings
-------- --------
To enable a Pacman frontend, for example, [Yaourt][2], add the following line to To enable a Pacman frontend, for example, [Yaourt][2], add the following line to
*zshrc*: *zpreztorc*:
zstyle ':prezto:module:pacman' frontend 'yaourt' zstyle ':prezto:module:pacman' frontend 'yaourt'
If you have enabled color globally in *zshrc*, you may disable it for certain If you have enabled color globally in *zpreztorc*, you may disable it for certain
commands. commands.
To disable `yaourt` highlighting, add the following line to *zshrc*: To disable `yaourt` highlighting, add the following line to *zpreztorc*:
zstyle ':prezto:module:pacman:yaourt' color 'no' zstyle ':prezto:module:pacman:yaourt' color 'no'

View file

@ -6,7 +6,7 @@ Loads prompt [themes][1].
Settings Settings
-------- --------
To select a prompt theme, add the following to *zshrc*, and replace **name** To select a prompt theme, add the following to *zpreztorc*, and replace **name**
with the name of the theme you wish to load. Setting it to **random** will load with the name of the theme you wish to load. Setting it to **random** will load
a random theme. a random theme.

View file

@ -10,7 +10,7 @@ Settings
Starts a GNU Screen session automatically when Zsh is launched. Starts a GNU Screen session automatically when Zsh is launched.
To enable this feature, add the following line to *zshrc*: To enable this feature, add the following line to *zpreztorc*:
zstyle ':prezto:module:screen' auto-start 'yes' zstyle ':prezto:module:screen' auto-start 'yes'

View file

@ -8,13 +8,13 @@ Settings
### Agent Forwarding ### Agent Forwarding
To enable ssh-agent forwarding, add the following line to *zshrc*: To enable ssh-agent forwarding, add the following line to *zpreztorc*:
zstyle ':prezto:module:ssh-agent' forwarding 'yes' zstyle ':prezto:module:ssh-agent' forwarding 'yes'
### Identities ### Identities
To load multiple identities, add the following line to *zshrc*: To load multiple identities, add the following line to *zpreztorc*:
zstyle ':prezto:module:ssh-agent' identities 'id_rsa' 'id_rsa2' 'id_github' zstyle ':prezto:module:ssh-agent' identities 'id_rsa' 'id_rsa2' 'id_github'

View file

@ -19,7 +19,8 @@ Settings
### Highlighting ### Highlighting
To enable highlighting for this module only, add the following line to *zshrc*: To enable highlighting for this module only, add the following line to
*zpreztorc*:
zstyle ':prezto:module:syntax-highlighting' color 'yes' zstyle ':prezto:module:syntax-highlighting' color 'yes'
@ -28,7 +29,7 @@ To enable highlighting for this module only, add the following line to *zshrc*:
Syntax highlighting is accomplished by pluggable [highlighters][2]. This module Syntax highlighting is accomplished by pluggable [highlighters][2]. This module
enables the *main*, *brackets*, and *cursor* highlighters by default. enables the *main*, *brackets*, and *cursor* highlighters by default.
To enable all highlighters, add the following to *zshrc*: To enable all highlighters, add the following to *zpreztorc*:
zstyle ':prezto:module:syntax-highlighting' highlighters \ zstyle ':prezto:module:syntax-highlighting' highlighters \
'main' \ 'main' \

View file

@ -9,7 +9,7 @@ Settings
### Auto-Title ### Auto-Title
To auto set the terminal window and tab titles with the current command or To auto set the terminal window and tab titles with the current command or
directory, add the following to *zshrc*: directory, add the following to *zpreztorc*:
zstyle ':prezto:module:terminal' auto-title 'yes' zstyle ':prezto:module:terminal' auto-title 'yes'

View file

@ -10,7 +10,7 @@ Settings
Starts a tmux session automatically when Zsh is launched. Starts a tmux session automatically when Zsh is launched.
To enable this feature, add the following line to *zshrc*: To enable this feature, add the following line to *zpreztorc*:
zstyle ':prezto:module:tmux' auto-start 'yes' zstyle ':prezto:module:tmux' auto-start 'yes'

View file

@ -8,23 +8,23 @@ Settings
### Highlighting ### Highlighting
If you have enabled color globally in *zshrc*, you may disable it for certain If you have enabled color globally in *zpreztorc*, you may disable it for certain
commands. commands.
To disable `ls` color, add the following line to *zshrc*; when coloring is To disable `ls` color, add the following line to *zpreztorc*; when coloring is
disabled, type indicators (\*, /, =>, @, =, |, %) will be appended to entries. disabled, type indicators (\*, /, =>, @, =, |, %) will be appended to entries.
zstyle ':prezto:module:utility:ls' color 'no' zstyle ':prezto:module:utility:ls' color 'no'
To disable `diff` highlighting, add the following line to *zshrc*: To disable `diff` highlighting, add the following line to *zpreztorc*:
zstyle ':prezto:module:utility:diff' color 'no' zstyle ':prezto:module:utility:diff' color 'no'
To disable `wdiff` highlighting, add the following line to *zshrc*: To disable `wdiff` highlighting, add the following line to *zpreztorc*:
zstyle ':prezto:module:utility:wdiff' color 'no' zstyle ':prezto:module:utility:wdiff' color 'no'
To disable `make` highlighting, add the following line to *zshrc*: To disable `make` highlighting, add the following line to *zpreztorc*:
zstyle ':prezto:module:utility:make' color 'no' zstyle ':prezto:module:utility:make' color 'no'

View file

@ -1,8 +1,10 @@
Zsh Configuration Files Configuration Files
======================= ===================
Zsh has several system-wide and user-local configuration files. Zsh has several system-wide and user-local configuration files.
Prezto has one user-local configuration file.
System-wide configuration files are installation-dependent but are installed System-wide configuration files are installation-dependent but are installed
in */etc* by default. in */etc* by default.
@ -22,10 +24,11 @@ The configuration files are read in the following order:
04. ~/.zprofile 04. ~/.zprofile
05. /etc/zshrc 05. /etc/zshrc
06. ~/.zshrc 06. ~/.zshrc
07. /etc/zlogin 07. ~/.zpreztorc
08. ~/.zlogin 08. /etc/zlogin
09. ~/.zlogout 09. ~/.zlogin
10. /etc/zlogout 10. ~/.zlogout
11. /etc/zlogout
### zshenv ### zshenv
@ -45,7 +48,9 @@ zprofile and zlogin are not meant to be used concurrently but can be done so.
This file is sourced by interactive shells. It should define aliases, This file is sourced by interactive shells. It should define aliases,
functions, shell options, and key bindings. functions, shell options, and key bindings.
This is the main Prezto configuration file. ## zpreztorc
This file configures Prezto.
### zlogin ### zlogin

46
runcoms/zpreztorc Normal file
View file

@ -0,0 +1,46 @@
#
# Sets Prezto options.
#
# Authors:
# Sorin Ionescu <sorin.ionescu@gmail.com>
#
# Set the key mapping style to 'emacs' or 'vi'.
zstyle ':prezto:module:editor' keymap 'emacs'
# Auto convert .... to ../..
zstyle ':prezto:module:editor' dot-expansion 'no'
# Set case-sensitivity for completion, history lookup, etc.
zstyle ':prezto:*:*' case-sensitive 'no'
# Color output (auto set to 'no' on dumb terminals).
zstyle ':prezto:*:*' color 'yes'
# Auto set the tab and window titles.
zstyle ':prezto:module:terminal' auto-title 'yes'
# Set the Zsh modules to load (man zshmodules).
# zstyle ':prezto:load' zmodule 'attr' 'stat'
# Set the Zsh functions to load (man zshcontrib).
# zstyle ':prezto:load' zfunction 'zargs' 'zmv'
# Set the Prezto modules to load (browse modules).
# The order matters.
zstyle ':prezto:load' pmodule \
'environment' \
'terminal' \
'editor' \
'history' \
'directory' \
'spectrum' \
'utility' \
'completion' \
'prompt'
# Set the prompt theme to load.
# Setting it to 'random' loads a random theme.
# Auto set to 'off' on dumb terminals.
zstyle ':prezto:module:prompt' theme 'sorin'

View file

@ -1,49 +1,10 @@
# #
# Sets Prezto options. # Executes commands at the start of an interactive session.
# #
# Authors: # Authors:
# Sorin Ionescu <sorin.ionescu@gmail.com> # Sorin Ionescu <sorin.ionescu@gmail.com>
# #
# Set the key mapping style to 'emacs' or 'vi'.
zstyle ':prezto:module:editor' keymap 'emacs'
# Auto convert .... to ../..
zstyle ':prezto:module:editor' dot-expansion 'no'
# Set case-sensitivity for completion, history lookup, etc.
zstyle ':prezto:*:*' case-sensitive 'no'
# Color output (auto set to 'no' on dumb terminals).
zstyle ':prezto:*:*' color 'yes'
# Auto set the tab and window titles.
zstyle ':prezto:module:terminal' auto-title 'yes'
# Set the Zsh modules to load (man zshmodules).
# zstyle ':prezto:load' zmodule 'attr' 'stat'
# Set the Zsh functions to load (man zshcontrib).
# zstyle ':prezto:load' zfunction 'zargs' 'zmv'
# Set the Prezto modules to load (browse modules).
# The order matters.
zstyle ':prezto:load' pmodule \
'environment' \
'terminal' \
'editor' \
'history' \
'directory' \
'spectrum' \
'utility' \
'completion' \
'prompt'
# Set the prompt theme to load.
# Setting it to 'random' loads a random theme.
# Auto set to 'off' on dumb terminals.
zstyle ':prezto:module:prompt' theme 'sorin'
# Source Prezto. # Source Prezto.
if [[ -s "${ZDOTDIR:-$HOME}/.zprezto/init.zsh" ]]; then if [[ -s "${ZDOTDIR:-$HOME}/.zprezto/init.zsh" ]]; then
source "${ZDOTDIR:-$HOME}/.zprezto/init.zsh" source "${ZDOTDIR:-$HOME}/.zprezto/init.zsh"