The 1841 British edition replaced thoughts with thought, probably unintentionally since other instances referring to a single person’s thoughts were left unchanged in the 1841 edition. The subsequent LDS edition (1849) restored the original plural thoughts here in Alma 18:20.
The text normally prefers plural thoughts for a single person (11 times), as here in nearby verses:
The singular thought is possible, as in the following example involving a plurality of people:
For discussion of the 1920 LDS change to the plural hearts, see under that passage.
There is one other example where an original plural thoughts was replaced by the singular (initially in the 1840 edition, then later in the 1920 LDS edition):
For discussion of this example, see under Mosiah 28:3.
Summary: Maintain in Alma 18:20 the plural thoughts in “how knowest thou the thoughts of my heart”, the earliest extant reading.