The Prophet ﷺ said, "A kind word is charity, and every step taken toward the prayer," or he said, "toward the mosque, is charity."
حدثنا يحيى بن آدم حدثنا ابن مبارك عن معمر عن همام بن منبه
عن النبي ﷺ قال الكلمة الطيبة صدقة وكل خطوة يمشيها إلى الصلاة أو قال إلى المسجد صدقة
Its isnad is sahih, and it is in Jami al-Masanid wal-Sunan 7/390, from this same place. It is a shortened version of the hadith that will follow in the Sahifah of Hammam bin Munabbih, 8168, and it was narrated by the two Shaykhs (Bukhari and Muslim), as will be explained there, Allah willing. His statement, "the good word," appears in J as "the gentle word." This is a variant found in the margin of M. What appears here is what is established in the rest of the manuscripts and in Jami al-Masanid wal-Sunan.