Q:

How to insert strings from a string list in one file into another file, with a Helm-like insert functionality? 

How can I insert one or more pre made text strings, stored in one storage file, into any text file where I need these strings?  The text strings are stored as one string per line in the storage file. 
When in a file where I need to insert my strings, I would like to call a function that opens a Helm-list of all the strings available in the storage file.  Further, I must be able to chose more than one string (by the space bar), and insert the chosen strings either vertically (one string per line), or horizontally, where the strings are separated with space. 
Thanks in advance for all suggestions, either to available methods for doing this, or new code! 

A:

The following use helm to take strings from /etc/shells and insert into the current buffer.  To pick multiple strings at a time, use C-SPC (helm-toggle-visible-mark).  To insert marked strings vertically, just use RET.  To insert horizontally, open the action menu with TAB (helm-select-action) and choose the second item. 
(defun foo ()
  (interactive)
  (helm :sources
        (helm-build-in-file-source "Strings"
          "/etc/shells"
          :action
          '(("Insert vertically" . 
             (lambda (_candidate)
               (insert (mapconcat #'identity (helm-marked-candidates) "\n"))))
            ("Insert horizontally" . 
             (lambda (_candidate)
               (insert (mapconcat #'identity (helm-marked-candidates) " "))))))))

