Browse Source

Use cat to concatenate files in installation

Update installation instructions in README.md to use cat. Also add blank
lines at the end (instead of beginning) of template files, since they're
prepended (not appended) to existing files.

See difference of output between print and cat (zlogin having a blank
like at the end):

    % print -rn "$(<zlogin)$(<test)"
    #
    # User configuration sourced by login shells
    #

    # Initialize zim
    [[ -s ${ZIM_HOME}/login_init.zsh ]] && source ${ZIM_HOME}/login_init.zsh# Hello world
    % cat zlogin test
    #
    # User configuration sourced by login shells
    #

    # Initialize zim
    [[ -s ${ZIM_HOME}/login_init.zsh ]] && source ${ZIM_HOME}/login_init.zsh

    # Hello world

Fixes #94. Fixes #280. Closes #300
Eric Nielsen 5 years ago
parent
commit
a05890e8b4
4 changed files with 6 additions and 12 deletions
  1. 1 3
      README.md
  2. 2 4
      templates/zimrc
  3. 1 2
      templates/zlogin
  4. 2 3
      templates/zshrc

+ 1 - 3
README.md

@@ -47,11 +47,9 @@ Installing Zim is easy. If you have a different shell framework installed (like
 
 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
+    cat ${template_file} ${user_file}(.N) >! ${user_file}
   done
   ```
 

+ 2 - 4
templates/zimrc

@@ -1,5 +1,3 @@
-
-
 #################
 # CORE SETTINGS #
 #################
@@ -78,7 +76,6 @@ zinput_mode='emacs'
 # removing the 'cursor' highlighter will fix the disappearing cursor problem
 zhighlighters=(main brackets cursor)
 
-
 #
 # SSH
 #
@@ -86,7 +83,6 @@ zhighlighters=(main brackets cursor)
 # Load these ssh identities with the ssh module
 #zssh_ids=(id_rsa)
 
-
 #
 # Pacman
 #
@@ -96,3 +92,5 @@ zhighlighters=(main brackets cursor)
 
 # Load any helper scripts as defined here
 #zpacman_helper=(aur)
+
+

+ 1 - 2
templates/zlogin

@@ -1,8 +1,7 @@
-
-
 #
 # User configuration sourced by login shells
 #
 
 # Initialize zim
 [[ -s ${ZIM_HOME}/login_init.zsh ]] && source ${ZIM_HOME}/login_init.zsh
+

+ 2 - 3
templates/zshrc

@@ -1,11 +1,10 @@
-
-
 #
 # User configuration sourced by interactive shells
 #
 
-# Change default zim location
+# Define zim location
 export ZIM_HOME=${ZDOTDIR:-${HOME}}/.zim
 
 # Start zim
 [[ -s ${ZIM_HOME}/init.zsh ]] && source ${ZIM_HOME}/init.zsh
+