Merge b792a0f0d9
into 903954985f
This commit is contained in:
commit
69d3a36b38
6
.gitmodules
vendored
6
.gitmodules
vendored
|
@ -19,3 +19,9 @@
|
|||
[submodule "modules/autosuggestions/external"]
|
||||
path = modules/autosuggestions/external
|
||||
url = https://github.com/zsh-users/zsh-autosuggestions.git
|
||||
[submodule "modules/fzf-zsh"]
|
||||
path = modules/fzf-zsh
|
||||
url = https://github.com/Piping/fzf-zsh.git
|
||||
[submodule "modules/prompt/external-themes/lambda"]
|
||||
path = modules/prompt/external-themes/lambda
|
||||
url = https://github.com/subnixr/minimal.git
|
||||
|
|
44
README.md
44
README.md
|
@ -38,34 +38,28 @@ Zim has many modules! Enable as many or as few as you'd like.
|
|||
Installation
|
||||
------------
|
||||
Installing Zim is easy. If you have a different shell framework installed (like oh-my-zsh or prezto),
|
||||
*uninstall those first to prevent conflicts*. It can be installed manually by following the instructions below:
|
||||
*uninstall those first to prevent conflicts*. Then put following instructions at the end of your `~/.zshrc`:
|
||||
|
||||
1. In a Zsh shell, clone the repository:
|
||||
```
|
||||
git clone --recursive https://github.com/zimfw/zimfw.git ${ZDOTDIR:-${HOME}}/.zim
|
||||
```bash
|
||||
# Zim initializition
|
||||
export ZIM_HOME="$HOME/.zsh"
|
||||
|
||||
if [ ! -f "$ZIM_HOME/init.zsh" ]; then
|
||||
echo "Installing zim"
|
||||
git clone --recursive https://github.com/zimfw/zimfw.git $ZIM_HOME
|
||||
git clone https://github.com/Piping/fzf-zsh.git $ZIM_HOME/modules/fzf-zsh
|
||||
cat $ZIM_HOME/templates/zlogin >> $HOME/.zlogin
|
||||
source $HOME/.zlogin
|
||||
fi
|
||||
|
||||
zmodules=(git git-info prompt completion syntax-highlighting autosuggestions fzf-zsh)
|
||||
zprompt_theme='steeef'
|
||||
zhighlighters=(main brackets cursor)
|
||||
|
||||
source $ZIM_HOME/init.zsh #make sure init after zmodules lists etcs..
|
||||
```
|
||||
|
||||
2. Paste this into your terminal to prepend the initialization templates to your configs:
|
||||
```
|
||||
setopt EXTENDED_GLOB
|
||||
for template_file in ${ZDOTDIR:-${HOME}}/.zim/templates/*; do
|
||||
user_file="${ZDOTDIR:-${HOME}}/.${template_file:t}"
|
||||
touch ${user_file}
|
||||
( print -rn "$(<${template_file})$(<${user_file})" >! ${user_file} ) 2>/dev/null
|
||||
done
|
||||
```
|
||||
|
||||
3. Set Zsh as the default shell:
|
||||
```
|
||||
chsh -s =zsh
|
||||
```
|
||||
|
||||
4. Open a new terminal and finish optimization (this is only needed once, hereafter it will happen upon desktop/tty login):
|
||||
```
|
||||
source ${ZDOTDIR:-${HOME}}/.zlogin
|
||||
```
|
||||
|
||||
5. You're done! Enjoy your Zsh IMproved! Take some time to read about the [available modules][modules] and tweak your `.zshrc` file.
|
||||
You're done! Enjoy your Zsh IMproved! Take some time to read about the [available modules][modules] and tweak your `.zshrc` file.
|
||||
|
||||
Updating
|
||||
--------
|
||||
|
|
15
init.zsh
15
init.zsh
|
@ -7,19 +7,6 @@ autoload -Uz is-at-least && if ! is-at-least 5.2; then
|
|||
return 1
|
||||
fi
|
||||
|
||||
# Define zim location
|
||||
(( ! ${+ZIM_HOME} )) && export ZIM_HOME=${ZDOTDIR:-${HOME}}/.zim
|
||||
|
||||
# Source user configuration
|
||||
[[ -s ${ZDOTDIR:-${HOME}}/.zimrc ]] && source ${ZDOTDIR:-${HOME}}/.zimrc
|
||||
|
||||
# Set input mode before loading modules
|
||||
if [[ ${zinput_mode} == 'vi' ]]; then
|
||||
bindkey -v
|
||||
else
|
||||
bindkey -e
|
||||
fi
|
||||
|
||||
# Autoload module functions
|
||||
() {
|
||||
local mod_function
|
||||
|
@ -82,6 +69,8 @@ Actions:
|
|||
;;
|
||||
build-cache) source ${ZIM_HOME}/tools/zim_build_cache && print 'Cache rebuilt'
|
||||
;;
|
||||
reload) zmanage clean-cache && zmanage build-cache
|
||||
;;
|
||||
remove) zsh ${ZIM_HOME}/tools/zim_remove
|
||||
;;
|
||||
reset) zsh ${ZIM_HOME}/tools/zim_reset
|
||||
|
|
|
@ -5,29 +5,34 @@
|
|||
# This includes zcompile, zcompdump, etc.
|
||||
#
|
||||
|
||||
zcompare() {
|
||||
if [[ -s ${1} && ( ! -s ${1}.zwc || ${1} -nt ${1}.zwc) ]]; then
|
||||
zcompile ${1}
|
||||
fi
|
||||
}
|
||||
|
||||
(
|
||||
local dir file
|
||||
setopt LOCAL_OPTIONS EXTENDED_GLOB
|
||||
autoload -U zrecompile
|
||||
local dir file
|
||||
setopt LOCAL_OPTIONS EXTENDED_GLOB
|
||||
autoload -U zrecompile
|
||||
# zcompile the completion cache; siginificant speedup
|
||||
zcompare ${ZDOTDIR:-${HOME}}/${zcompdump_file:-.zcompdump}
|
||||
|
||||
# zcompile the completion cache; siginificant speedup
|
||||
zrecompile -pq ${ZDOTDIR:-${HOME}}/${zcompdump_file:-.zcompdump}
|
||||
# zcompile .zshrc
|
||||
zcompare ${ZDOTDIR:-${HOME}}/.zshrc
|
||||
|
||||
# zcompile .zshrc
|
||||
zrecompile -pq ${ZDOTDIR:-${HOME}}/.zshrc
|
||||
|
||||
# zcompile enabled module autoloaded functions
|
||||
for dir in ${ZIM_HOME}/modules/${^zmodules}/functions(/FN); do
|
||||
# zcompile enabled module autoloaded functions
|
||||
for dir in ${ZIM_HOME}/modules/${^zmodules}/functions(/FN); do
|
||||
zrecompile -pq ${dir}.zwc ${dir}/^(_*|prompt_*_setup|*.*)(-.N)
|
||||
done
|
||||
done
|
||||
|
||||
# zcompile enabled module scripts
|
||||
for file in ${ZIM_HOME}/modules/${^zmodules}/(^*test*/)#*.zsh{,-theme}(.NLk+1); do
|
||||
zrecompile -pq ${file}
|
||||
done
|
||||
# zcompile enabled module scripts
|
||||
for file in ${ZIM_HOME}/modules/${^zmodules}/(^*test*/)#*.zsh{,-theme}(.NLk+1); do
|
||||
zcompare ${file}
|
||||
done
|
||||
|
||||
# zcompile all prompt setup scripts
|
||||
for file in ${ZIM_HOME}/modules/prompt/functions/prompt_*_setup; do
|
||||
zrecompile -pq ${file}
|
||||
done
|
||||
# zcompile all prompt setup scripts
|
||||
for file in ${ZIM_HOME}/modules/prompt/functions/prompt_*_setup; do
|
||||
zcompare ${file}
|
||||
done
|
||||
) &!
|
||||
|
|
1
modules/fzf-zsh
Submodule
1
modules/fzf-zsh
Submodule
|
@ -0,0 +1 @@
|
|||
Subproject commit 9b237ef4d03bfb275dc31722b93efa0d53c2ade5
|
1
modules/prompt/external-themes/lambda
Submodule
1
modules/prompt/external-themes/lambda
Submodule
|
@ -0,0 +1 @@
|
|||
Subproject commit 9dd104f1bddbf742ced6e1e31b14e2b394a47690
|
1
modules/prompt/functions/prompt_lambda_setup
Symbolic link
1
modules/prompt/functions/prompt_lambda_setup
Symbolic link
|
@ -0,0 +1 @@
|
|||
../external-themes/lambda/minimal.zsh
|
Loading…
Reference in a new issue