浏览代码

init: run compinit before loading lib/ files

Marc Cornellà 5 年之前
父节点
当前提交
ea3e666e04
共有 2 个文件被更改,包括 11 次插入9 次删除
  1. 1 0
      lib/directories.zsh
  2. 10 9
      oh-my-zsh.sh

+ 1 - 0
lib/directories.zsh

@@ -21,6 +21,7 @@ alias 9='cd -9'
 
 
 alias md='mkdir -p'
 alias md='mkdir -p'
 alias rd=rmdir
 alias rd=rmdir
+
 function d () {
 function d () {
   if [[ -n $1 ]]; then
   if [[ -n $1 ]]; then
     dirs "$@"
     dirs "$@"

+ 10 - 9
oh-my-zsh.sh

@@ -29,15 +29,6 @@ if [[ -z "$ZSH_CUSTOM" ]]; then
 fi
 fi
 
 
 
 
-# Load all of the config files in ~/oh-my-zsh that end in .zsh
-# TIP: Add files you don't want in git to .gitignore
-for config_file ($ZSH/lib/*.zsh); do
-  custom_config_file="${ZSH_CUSTOM}/lib/${config_file:t}"
-  [ -f "${custom_config_file}" ] && config_file=${custom_config_file}
-  source $config_file
-done
-
-
 is_plugin() {
 is_plugin() {
   local base_dir=$1
   local base_dir=$1
   local name=$2
   local name=$2
@@ -71,6 +62,7 @@ if [ -z "$ZSH_COMPDUMP" ]; then
 fi
 fi
 
 
 if [[ $ZSH_DISABLE_COMPFIX != true ]]; then
 if [[ $ZSH_DISABLE_COMPFIX != true ]]; then
+  source $ZSH/lib/compfix.zsh
   # If completion insecurities exist, warn the user
   # If completion insecurities exist, warn the user
   handle_completion_insecurities
   handle_completion_insecurities
   # Load only from secure directories
   # Load only from secure directories
@@ -80,6 +72,15 @@ else
   compinit -u -C -d "${ZSH_COMPDUMP}"
   compinit -u -C -d "${ZSH_COMPDUMP}"
 fi
 fi
 
 
+
+# Load all of the config files in ~/oh-my-zsh that end in .zsh
+# TIP: Add files you don't want in git to .gitignore
+for config_file ($ZSH/lib/*.zsh); do
+  custom_config_file="${ZSH_CUSTOM}/lib/${config_file:t}"
+  [ -f "${custom_config_file}" ] && config_file=${custom_config_file}
+  source $config_file
+done
+
 # Load all of the plugins that were defined in ~/.zshrc
 # Load all of the plugins that were defined in ~/.zshrc
 for plugin ($plugins); do
 for plugin ($plugins); do
   if [ -f $ZSH_CUSTOM/plugins/$plugin/$plugin.plugin.zsh ]; then
   if [ -f $ZSH_CUSTOM/plugins/$plugin/$plugin.plugin.zsh ]; then