mirror of
https://github.com/ohmyzsh/ohmyzsh.git
synced 2025-12-26 02:12:33 +01:00
Merge branch 'master' of github.com:jamesm-sitegen/oh-my-zsh
* 'master' of github.com:jamesm-sitegen/oh-my-zsh: Try again. This works. Load themes from ~/.omz/themes/ too We should start documenting things. Opps, not start, should be init. Fix needs to be named the same as the function This should be interesting. Attempt to install omz as a site function instead. Bad typo. set_theme $theme, not set_theme theme
This commit is contained in:
commit
8fb2c8d878
13 changed files with 122 additions and 94 deletions
|
|
@ -31,9 +31,10 @@ $ chsh -s /bin/zsh
|
|||
Then the following needs to be added to `~/.zshrc` file to activate
|
||||
oh-my-zshell goodness.
|
||||
|
||||
autoload omz
|
||||
zstyle :omz:style theme arch-blue
|
||||
plugins=(archlinux sprunge git)
|
||||
omz_init
|
||||
omz init
|
||||
|
||||
A skeleton template can be found at
|
||||
`/usr/share/oh-my-zsh/templates/user.zsh-template`
|
||||
|
|
|
|||
|
|
@ -1,11 +1,13 @@
|
|||
set_theme() {
|
||||
source "$ZSH/themes/$1.zsh-theme"
|
||||
local themes
|
||||
themes=({$OMZ,$ZSH}/themes/$1.zsh-theme(N))
|
||||
source $themes[1]
|
||||
}
|
||||
|
||||
random_theme() {
|
||||
local themes
|
||||
themes=($ZSH/themes/*zsh-theme)
|
||||
source "$themes[$RANDOM%$#themes+1]"
|
||||
themes=({$OMZ,$ZSH}/themes/*.zsh-theme(N))
|
||||
source $themes[$RANDOM%$#themes+1]
|
||||
}
|
||||
|
||||
# compdef "_files -g '*.zsh'" set_theme
|
||||
|
|
|
|||
|
|
@ -1,49 +0,0 @@
|
|||
# Initializes Oh My Zsh
|
||||
ZSH=${ZSH:-/usr/share/oh-my-zsh}
|
||||
OMZ=${OMZ:-$HOME/.omz}
|
||||
|
||||
local config_file plugin
|
||||
plugin=${plugin:=()}
|
||||
|
||||
# add a function path
|
||||
fpath=($ZSH/functions $ZSH/completions $fpath)
|
||||
|
||||
if [[ -d $OMZ ]]; then
|
||||
[[ -d $OMZ/functions ]] && fpath=($OMZ/functions $fpath)
|
||||
[[ -d $OMZ/completion ]] && fpath=($OMZ/completions $fpath)
|
||||
fi
|
||||
|
||||
for config_file ($ZSH/lib/*.zsh(N))
|
||||
source $config_file
|
||||
|
||||
if [[ -d $OMZ ]]; then
|
||||
for config_file ($OMZ/*.zsh(N))
|
||||
source $config_file
|
||||
fi
|
||||
|
||||
for plugin ($plugins)
|
||||
fpath=($ZSH/plugins/$plugin $fpath)
|
||||
|
||||
if [[ -d $OMZ ]]; then
|
||||
if [[ -d $OMZ/plugins ]]; then
|
||||
for plugin ($plugins)
|
||||
fpath=($OMZ/plugins/$plugin $fpath)
|
||||
fi
|
||||
fi
|
||||
|
||||
# Load and run compinit
|
||||
autoload -U compinit
|
||||
compinit -i
|
||||
|
||||
# load plugins
|
||||
for plugin ($plugins); do
|
||||
if [[ -f $OMZ/plugins/$plugin/$plugin.plugin.zsh ]]; then
|
||||
source $OMZ/plugins/$plugin/$plugin.plugin.zsh
|
||||
elif [[ -f $ZSH/plugins/$plugin/$plugin.plugin.zsh ]]; then
|
||||
source $ZSH/plugins/$plugin/$plugin.plugin.zsh
|
||||
fi
|
||||
done
|
||||
|
||||
local theme
|
||||
zstyle -a :omz:style theme theme
|
||||
set_theme theme
|
||||
61
omz
Normal file
61
omz
Normal file
|
|
@ -0,0 +1,61 @@
|
|||
# omz control center
|
||||
|
||||
omz() {
|
||||
ZSH=${ZSH:-/usr/share/oh-my-zsh}
|
||||
OMZ=${OMZ:-$HOME/.omz}
|
||||
|
||||
case "$1" in
|
||||
"init")
|
||||
local config_file plugin
|
||||
plugin=${plugin:=()}
|
||||
|
||||
# add a function path
|
||||
fpath=($ZSH/functions $ZSH/completions $fpath)
|
||||
|
||||
if [[ -d $OMZ ]]; then
|
||||
[[ -d $OMZ/functions ]] && fpath=($OMZ/functions $fpath)
|
||||
[[ -d $OMZ/completion ]] && fpath=($OMZ/completions $fpath)
|
||||
fi
|
||||
|
||||
for config_file ($ZSH/lib/*.zsh(N))
|
||||
source $config_file
|
||||
|
||||
if [[ -d $OMZ ]]; then
|
||||
for config_file ($OMZ/*.zsh(N))
|
||||
source $config_file
|
||||
fi
|
||||
|
||||
for plugin ($plugins)
|
||||
fpath=($ZSH/plugins/$plugin $fpath)
|
||||
|
||||
if [[ -d $OMZ ]]; then
|
||||
if [[ -d $OMZ/plugins ]]; then
|
||||
for plugin ($plugins)
|
||||
fpath=($OMZ/plugins/$plugin $fpath)
|
||||
fi
|
||||
fi
|
||||
|
||||
# Load and run compinit
|
||||
autoload -U compinit
|
||||
compinit -i
|
||||
|
||||
# load plugins
|
||||
for plugin ($plugins); do
|
||||
if [[ -f $OMZ/plugins/$plugin/$plugin.plugin.zsh ]]; then
|
||||
source $OMZ/plugins/$plugin/$plugin.plugin.zsh
|
||||
elif [[ -f $ZSH/plugins/$plugin/$plugin.plugin.zsh ]]; then
|
||||
source $ZSH/plugins/$plugin/$plugin.plugin.zsh
|
||||
fi
|
||||
done
|
||||
|
||||
local theme
|
||||
zstyle -a :omz:style theme theme
|
||||
set_theme $theme
|
||||
;;
|
||||
*)
|
||||
echo "$0: invalid command $1" 2>&1
|
||||
;;
|
||||
esac
|
||||
}
|
||||
|
||||
# vi: ft=zsh
|
||||
0
plugins/archlinux/README.md
Normal file
0
plugins/archlinux/README.md
Normal file
0
plugins/git/README.md
Normal file
0
plugins/git/README.md
Normal file
0
plugins/keychain/README.md
Normal file
0
plugins/keychain/README.md
Normal file
0
plugins/notfound/README.md
Normal file
0
plugins/notfound/README.md
Normal file
34
plugins/tmux/README.md
Normal file
34
plugins/tmux/README.md
Normal file
|
|
@ -0,0 +1,34 @@
|
|||
Tmux
|
||||
====
|
||||
|
||||
DESCRIPTION TO GO HERE
|
||||
|
||||
Configuration
|
||||
-------------
|
||||
|
||||
To set a corresponding command to a session name, set a zstyle like
|
||||
this
|
||||
|
||||
zstyle :omz:plugins:tmux:cmd irc weechat-curses
|
||||
|
||||
This setups up the tmux plugin to start or jump to weechat when `t
|
||||
irc` is executed.
|
||||
|
||||
The plugin can be configured to start tmux with zsh. To do so, set
|
||||
this zstyle appropriately. If so, it's ideal to have tmux first in the
|
||||
plugin array
|
||||
|
||||
zstyle :omz:plugins:tmux autostart on
|
||||
|
||||
Usage
|
||||
-----
|
||||
|
||||
You can call the `t` function in two ways:
|
||||
|
||||
t session
|
||||
t session command
|
||||
|
||||
Copyright & License
|
||||
-------------------
|
||||
|
||||
This plugin is released under the GLP3
|
||||
|
|
@ -1,9 +1,25 @@
|
|||
# tmux plugin
|
||||
# Copyright (C) 2011 Simon Gomizelj
|
||||
#
|
||||
# This program is free software: you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation, either version 3 of the License, or
|
||||
# (at your option) any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
#
|
||||
# Enable autostarting of tmux with:
|
||||
# zstyle :omz:plugins:tmux autostart on
|
||||
#
|
||||
# Configure t command to autostart a command like
|
||||
# this (example for "t irc"):
|
||||
# zstyle :omz:plugins:cmd irc weechat-curses
|
||||
# zstyle :omz:plugins:tmux:cmd irc weechat-curses
|
||||
#
|
||||
|
||||
if (( $+commands[tmux] )); then
|
||||
|
|
|
|||
|
|
@ -1,7 +1,9 @@
|
|||
# Check /etc/zsh/zshrc for system defaults.
|
||||
|
||||
autoload omz
|
||||
|
||||
zstyle :omz:style theme "arch-blue"
|
||||
|
||||
plugins=(archlinux sprunge git github)
|
||||
|
||||
omz_init
|
||||
omz init
|
||||
|
|
|
|||
|
|
@ -1,9 +0,0 @@
|
|||
ZSH=/usr/share/oh-my-zsh
|
||||
|
||||
zstyle :omz:style theme "arch-blue"
|
||||
|
||||
plugins=(archlinux sprunge)
|
||||
|
||||
omz_init() {
|
||||
source $ZSH/oh-my-zsh.zsh
|
||||
}
|
||||
|
|
@ -1,30 +0,0 @@
|
|||
# Path to your oh-my-zsh configuration.
|
||||
ZSH=$HOME/.oh-my-zsh
|
||||
|
||||
# Set to this to use case-sensitive completion
|
||||
# CASE_SENSITIVE="true"
|
||||
|
||||
# Comment this out to disable weekly auto-update checks
|
||||
# DISABLE_AUTO_UPDATE="true"
|
||||
|
||||
# Uncomment following line if you want to disable colors in ls
|
||||
# DISABLE_LS_COLORS="true"
|
||||
|
||||
# Uncomment following line if you want to disable autosetting terminal title.
|
||||
# DISABLE_AUTO_TITLE="true"
|
||||
|
||||
# Uncomment following line if you want red dots to be displayed while waiting for completion
|
||||
# COMPLETION_WAITING_DOTS="true"
|
||||
|
||||
# Which plugins would you like to load? (plugins can be found in ~/.oh-my-zsh/plugins/*)
|
||||
# Example format: plugins=(rails git textmate ruby lighthouse)
|
||||
plugins=(git)
|
||||
|
||||
source $ZSH/oh-my-zsh.zsh
|
||||
|
||||
# Load a theme
|
||||
# Look in $ZSH/themes/
|
||||
set_theme "robbyrussell"
|
||||
# random_theme
|
||||
|
||||
# Customize to your needs...
|
||||
Loading…
Add table
Add a link
Reference in a new issue