From 63f6f3f81e0b7b53d8bcf67416e9e12602af5f65 Mon Sep 17 00:00:00 2001 From: Nanda Lopes Date: Sun, 8 Nov 2020 20:53:22 -0300 Subject: [PATCH 1/3] Install directly prezto-override (cherry picked from commit d7eaeed726edc936b18aebcc0df1fcd3670c4edd) --- Rakefile | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/Rakefile b/Rakefile index 137e1eb0..6b374998 100644 --- a/Rakefile +++ b/Rakefile @@ -262,11 +262,11 @@ def install_prezto run %{ ln -nfs "$HOME/.yadr/zsh/prezto" "${ZDOTDIR:-$HOME}/.zprezto" } # The prezto runcoms are only going to be installed if zprezto has never been installed - install_files(Dir.glob('zsh/prezto/runcoms/z*'), :symlink) - - puts - puts "Overriding prezto ~/.zpreztorc with YADR's zpreztorc to enable additional modules..." - run %{ ln -nfs "$HOME/.yadr/zsh/prezto-override/zpreztorc" "${ZDOTDIR:-$HOME}/.zpreztorc" } + install_files(Dir.glob('zsh/prezto/runcoms/zlogin'), :symlink) + install_files(Dir.glob('zsh/prezto/runcoms/zlogout'), :symlink) + install_files(Dir.glob('zsh/prezto-override/zpreztorc'), :symlink) + install_files(Dir.glob('zsh/prezto/runcoms/zprofile'), :symlink) + install_files(Dir.glob('zsh/prezto/runcoms/zshenv'), :symlink) puts puts "Creating directories for your customizations" From ff029a2058a3cb05c61d5d7f083230f335fa6583 Mon Sep 17 00:00:00 2001 From: Nanda Lopes Date: Sun, 8 Nov 2020 20:54:02 -0300 Subject: [PATCH 2/3] zshrc override --- Rakefile | 1 + zsh/prezto-override/zshrc | 3 +++ 2 files changed, 4 insertions(+) create mode 100644 zsh/prezto-override/zshrc diff --git a/Rakefile b/Rakefile index 6b374998..bbcc3e07 100644 --- a/Rakefile +++ b/Rakefile @@ -262,6 +262,7 @@ def install_prezto run %{ ln -nfs "$HOME/.yadr/zsh/prezto" "${ZDOTDIR:-$HOME}/.zprezto" } # The prezto runcoms are only going to be installed if zprezto has never been installed + install_files(Dir.glob('zsh/prezto-override/zshrc'), :symlink) install_files(Dir.glob('zsh/prezto/runcoms/zlogin'), :symlink) install_files(Dir.glob('zsh/prezto/runcoms/zlogout'), :symlink) install_files(Dir.glob('zsh/prezto-override/zpreztorc'), :symlink) diff --git a/zsh/prezto-override/zshrc b/zsh/prezto-override/zshrc new file mode 100644 index 00000000..80f27cb9 --- /dev/null +++ b/zsh/prezto-override/zshrc @@ -0,0 +1,3 @@ +source $HOME/.zprezto/runcoms/zshrc + +for config_file ($HOME/.yadr/zsh/*.zsh) source $config_file From 72446c046aa091af304fcdfba27ad348b37119e0 Mon Sep 17 00:00:00 2001 From: Nanda Lopes Date: Sun, 8 Nov 2020 21:06:34 -0300 Subject: [PATCH 3/3] Remove zshrc post-install inserts --- Rakefile | 12 ------------ 1 file changed, 12 deletions(-) diff --git a/Rakefile b/Rakefile index bbcc3e07..ff48648a 100644 --- a/Rakefile +++ b/Rakefile @@ -321,18 +321,6 @@ def install_files(files, method = :symlink) run %{ cp -f "#{source}" "#{target}" } end - # Temporary solution until we find a way to allow customization - # This modifies zshrc to load all of yadr's zsh extensions. - # Eventually yadr's zsh extensions should be ported to prezto modules. - source_config_code = "for config_file ($HOME/.yadr/zsh/*.zsh) source $config_file" - if file == 'zshrc' - File.open(target, 'a+') do |zshrc| - if zshrc.readlines.grep(/#{Regexp.escape(source_config_code)}/).empty? - zshrc.puts(source_config_code) - end - end - end - puts "==========================================================" puts end