Reba, I'll give you a short version of what I spent about 20 minute on last night.
Words written by Reginald Heber, Anglican pastor, for Trinity Sunday worship in the early 1800s. First appeared in Anglican hymnals in 1826, showed up in America by 1850, but not with the music we know today. The music was composed by another Anglican pastor, John Dykes, in 1850s, and by 1861 we have the hymn as we recognize it today.
Heber used scripture verses from Isaiah 6:3 "...Holy, holy, holy, is the LORD of hosts: the whole earth is full of his glory,"and Revelation 4:8 "...Holy, holy, holy, Lord God Almighty, who was, and who is, and who is to come" as a basis for emphasizing doctrine of Trinity by using the theme of threes throughout the hymn:
1. Holy, holy, holy! Lord God Almighty!
Early in the morning our song shall rise to thee.
Holy, holy, holy! Merciful and mighty,
God in three persons, blessed Trinity!
2. Holy, holy, holy! All the saints adore thee,
casting down their golden crowns around the glassy sea;
cherubim and seraphim falling down before thee,
which wert, and art, and evermore shalt be.
3. Holy, holy, holy! Though the darkness hide thee,
though the eye of sinful man thy glory may not see,
only thou art holy; there is none beside thee,
perfect in power, in love and purity.
4. Holy, holy, holy! Lord God Almighty!
All thy works shall praise thy name, in earth and sky and sea.
Holy, holy, holy! Merciful and mighty,
God in three persons, blessed Trinity.