From 8d0397c40fd3e56a9fe14a77ca9171a4e5f9be80 Mon Sep 17 00:00:00 2001 From: Piping Date: Sat, 7 Jul 2018 08:49:08 -0700 Subject: [PATCH 01/12] Update README.md Clear Installation Guide --- README.md | 40 ++++++++++++++++------------------------ 1 file changed, 16 insertions(+), 24 deletions(-) diff --git a/README.md b/README.md index 6eaaa4c..e0bf5c9 100644 --- a/README.md +++ b/README.md @@ -38,34 +38,26 @@ 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 + # 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 + cat $ZIM_HOME/templates/zlogin >> $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 -------- From 4283c62766568fa5bc724a69358f8eb183e01d2f Mon Sep 17 00:00:00 2001 From: Piping Date: Sat, 7 Jul 2018 08:49:41 -0700 Subject: [PATCH 02/12] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index e0bf5c9..42ff65a 100644 --- a/README.md +++ b/README.md @@ -40,7 +40,7 @@ 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*. Then put following instructions at the end of your .zshrc: - ``` + ```zshrc # Zim initializition export ZIM_HOME="$HOME/.zsh" From b1e64c2fd79bf8994ff6e975bb0d151622955f63 Mon Sep 17 00:00:00 2001 From: Piping Date: Sat, 7 Jul 2018 08:50:41 -0700 Subject: [PATCH 03/12] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 42ff65a..5f0e978 100644 --- a/README.md +++ b/README.md @@ -40,7 +40,7 @@ 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*. Then put following instructions at the end of your .zshrc: - ```zshrc + ```bash # Zim initializition export ZIM_HOME="$HOME/.zsh" From 1e739e1276b517362dec08dbea18444090c7fc4f Mon Sep 17 00:00:00 2001 From: Piping Date: Sat, 7 Jul 2018 08:51:31 -0700 Subject: [PATCH 04/12] clear installation guide --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 5f0e978..6ab3179 100644 --- a/README.md +++ b/README.md @@ -38,7 +38,7 @@ 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*. Then put following instructions at the end of your .zshrc: +*uninstall those first to prevent conflicts*. Then put following instructions at the end of your `~/.zshrc`: ```bash # Zim initializition From c654cd22a9f0959d289f5736f6f9c8beeda57eda Mon Sep 17 00:00:00 2001 From: Piping Date: Sat, 7 Jul 2018 08:53:18 -0700 Subject: [PATCH 05/12] Update README.md --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index 6ab3179..d1bbd89 100644 --- a/README.md +++ b/README.md @@ -48,6 +48,7 @@ Installing Zim is easy. If you have a different shell framework installed (like echo "Installing zim" git clone --recursive https://github.com/zimfw/zimfw.git $ZIM_HOME cat $ZIM_HOME/templates/zlogin >> $HOME/.zlogin + source $HOME/.zlogin fi zmodules=(git git-info prompt completion syntax-highlighting autosuggestions fzf-zsh) From 7292e4f0def033efaf4f766bca30a44ed2b115b9 Mon Sep 17 00:00:00 2001 From: Piping Date: Sat, 7 Jul 2018 09:03:56 -0700 Subject: [PATCH 06/12] Update README.md --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index d1bbd89..53d0b58 100644 --- a/README.md +++ b/README.md @@ -47,6 +47,7 @@ Installing Zim is easy. If you have a different shell framework installed (like 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 From c30703ac6679a4d220ca18954e1bf9da9f60687f Mon Sep 17 00:00:00 2001 From: Dequan Zhang Date: Sat, 7 Jul 2018 20:46:30 +0000 Subject: [PATCH 07/12] update login logic --- login_init.zsh | 43 ++++++++++++++++++++++++------------------- 1 file changed, 24 insertions(+), 19 deletions(-) diff --git a/login_init.zsh b/login_init.zsh index 0b98bb4..0da8ca6 100755 --- a/login_init.zsh +++ b/login_init.zsh @@ -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 ) &! From d9bf3585f1db57fca7683c9061bfbbcb69d94593 Mon Sep 17 00:00:00 2001 From: Dequan Zhang Date: Sat, 7 Jul 2018 21:02:21 +0000 Subject: [PATCH 08/12] use less code --- init.zsh | 15 ++------------- 1 file changed, 2 insertions(+), 13 deletions(-) diff --git a/init.zsh b/init.zsh index 3de17fd..bc33c0e 100755 --- a/init.zsh +++ b/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 From 5691c255a771e563880faea15225b1c5bab0c5df Mon Sep 17 00:00:00 2001 From: Dequan Zhang Date: Sat, 7 Jul 2018 21:25:16 +0000 Subject: [PATCH 09/12] update submodules --- .gitmodules | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/.gitmodules b/.gitmodules index becdcb6..f3e45ff 100644 --- a/.gitmodules +++ b/.gitmodules @@ -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 From 8badd225da3dfa350c6b30aa697a84b19b78a546 Mon Sep 17 00:00:00 2001 From: Dequan Zhang Date: Sat, 7 Jul 2018 21:28:37 +0000 Subject: [PATCH 10/12] update submodules --- .gitmodules | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.gitmodules b/.gitmodules index f3e45ff..75ebe33 100644 --- a/.gitmodules +++ b/.gitmodules @@ -23,5 +23,5 @@ 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 + path = modules/prompt/external-themes/lambda + url = https://github.com/subnixr/minimal.git From c939f8b4d4f592501091015c58c3f9a3776edf35 Mon Sep 17 00:00:00 2001 From: Dequan Zhang Date: Sat, 7 Jul 2018 23:07:05 +0000 Subject: [PATCH 11/12] update submodules --- .gitmodules | 2 +- modules/fzf-zsh | 1 + modules/prompt/external-themes/lambda | 1 + 3 files changed, 3 insertions(+), 1 deletion(-) create mode 160000 modules/fzf-zsh create mode 160000 modules/prompt/external-themes/lambda diff --git a/.gitmodules b/.gitmodules index 75ebe33..1d666a5 100644 --- a/.gitmodules +++ b/.gitmodules @@ -24,4 +24,4 @@ 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 + url = https://github.com/subnixr/minimal.git diff --git a/modules/fzf-zsh b/modules/fzf-zsh new file mode 160000 index 0000000..9b237ef --- /dev/null +++ b/modules/fzf-zsh @@ -0,0 +1 @@ +Subproject commit 9b237ef4d03bfb275dc31722b93efa0d53c2ade5 diff --git a/modules/prompt/external-themes/lambda b/modules/prompt/external-themes/lambda new file mode 160000 index 0000000..9dd104f --- /dev/null +++ b/modules/prompt/external-themes/lambda @@ -0,0 +1 @@ +Subproject commit 9dd104f1bddbf742ced6e1e31b14e2b394a47690 From b792a0f0d9c459ef77265a8c02042ddc068b4f2f Mon Sep 17 00:00:00 2001 From: Dequan Zhang Date: Sat, 7 Jul 2018 23:08:37 +0000 Subject: [PATCH 12/12] update submodules --- modules/prompt/functions/prompt_lambda_setup | 1 + 1 file changed, 1 insertion(+) create mode 120000 modules/prompt/functions/prompt_lambda_setup diff --git a/modules/prompt/functions/prompt_lambda_setup b/modules/prompt/functions/prompt_lambda_setup new file mode 120000 index 0000000..eaff786 --- /dev/null +++ b/modules/prompt/functions/prompt_lambda_setup @@ -0,0 +1 @@ +../external-themes/lambda/minimal.zsh \ No newline at end of file