Jabir bin Abdullah reported,

Our homes were far from the mosque, so we wanted to sell them and move closer to the mosque. The Messenger of Allah ﷺ forbade us from doing so and said, "For every step you take, there is a degree of reward for you."In another narration, Jabir bin Abdullah said, "The areas around the mosque had become vacant, so the tribe of Banu Salama wanted to relocate closer to the mosque. News of this reached the Messenger of Allah ﷺ, and he said to them, 'I have heard that you intend to move closer to the mosque.'"They replied, "Yes, Messenger of Allah, that is indeed what we want."He said, "Banu Salama, stay in your homes, your steps are recorded. Stay in your homes, your steps are recorded."They then said, "It would no longer have pleased us to have moved."

Azami 1742

Sahih

عن جابر بن عبد الله قال

كانت ديارنا نائية عن المسجد، فأردنا أن نبيع بيوتنا فنقترب من المسجد. فنهانا رسول الله ﷺ فقال: إن لكم بكل خطوة درجة. وفي رواية: قال جابر بن عبد الله: خلت البقاع حول المسجد، فأراد بنو سلمة أن ينتقلوا إلى قرب المسجد، فبلغ ذلك رسول الله ﷺ فقال لهم: إنه بلغني أنكم تريدون أن تنتقلوا قرب المسجد قالوا: نعم يا رسول الله! قد أردنا ذلك، فقال: يا بني سلمة دياركم تكتب آثاركم، دياركم تكتب آثاركم، فقالوا: ما كان يسرنا أنا كنا تحولنا.

الأعظمي 1742صحيح
Contents
Reference
Commentary
Ayat
Collection
Jami al-Kamil
Book
Prayer
Chapter
Obligation of prayer and its virtue
Section
Virtue of walking to prayer
Numbering
Jami al-Kamil 1742 (2nd edition)
Azami 1742