Why We Wear a Kippah
ומדרב נחמן בר יצחק נמי אין מזל לישראל דאימיה דרב נחמן בר יצחק אמרי לה כלדאי בריך גנבא הוה לא שבקתיה גלויי רישיה אמרה ליה כסי רישיך כי היכי דתיהוו עלך אימתא דשמיא ובעי רחמי לא הוה ידע אמאי קאמרה ליה יומא חד יתיב קא גריס תותי דיקלא נפל גלימא מעילויה רישיה דלי עיניה חזא לדיקלא אלמיה יצריה סליק פסקיה לקיבורא בשיניה:
And from that which transpired to Rav Naḥman bar Yitzḥak as well it can be derived that there is no constellation for the Jewish people, As Chaldean astrologers told Rav Naḥman bar Yitzḥak’s mother: Your son will be a thief. She did not allow him to uncover his head. She said to her son: Cover your head so that the fear of Heaven will be upon you, and pray for Divine mercy. He did not know why she said this to him. One day he was sitting and studying beneath a palm tree that did not belong to him, and the cloak fell off of his head. He lifted his eyes and saw the palm tree. He was overcome by impulse and he climbed up and detached a bunch of dates with his teeth. Apparently, he had an inborn inclination to steal, but was able to overcome that inclination with proper education and prayer.
אמר רבי יהושע בן לוי אסור לאדם שיהלך ארבע אמות בקומה זקופה שנא' (ישעיהו ו, ג) מלא כל הארץ כבודו רב הונא בריה דרב יהושע לא מסגי ארבע אמות בגילוי הראש אמר שכינה למעלה מראשי
With regard to the same issue, Rabbi Yehoshua ben Levi says: It is prohibited for a person to walk even four cubits with an upright posture, which is considered an arrogant manner, as it is stated: “The entire world is full of His glory” (Isaiah 6:3). One who walks in an arrogant manner indicates a lack of regard for the glory and honor of God that is surrounding him, and thereby chases God from that place, as it were. The Gemara relates: Rav Huna, son of Rav Yehoshua, would not walk four cubits with an uncovered head. He said: The Divine Presence is above my head, and I must act respectfully.

(ו) אסור לילך בקומה זקופה ולא ילך ד' אמות בגילוי הראש ויבדוק נקביו: הגה ויכסה כל גופו ולא ילך יחף (א"ז) וירגיל עצמו לפנות בוקר וערב שהוא זריזות ונקיות (הגהות מיימוני פ' ה' מה' דעות):

(6) It is forbidden to walk in an [overly] upright posture, and one should not walk [a distance of] four amot with the head uncovered (out of respect for the Divine Presence), and one should examine one's orifices [to ensure they are kept clean]. Rem"a: And one should cover his entire body, and should not go barefoot (Or Zarua). And One should accustom oneself to relieve oneself morning and evening, which is [included in the virtues of] alacrity and cleanliness (Hagahot Maimoni Chap 5 of Hilchot Deot).

(ד) כְּשֶׁשּׁוֹמֵעַ קוֹל הַתַּרְנְגוֹלִים מְבָרֵךְ בָּרוּךְ אַתָּה יְיָ׳‎ אֱלֹהֵינוּ מֶלֶךְ הָעוֹלָם הַנּוֹתֵן לַשֶּׂכְוִי בִינָה לְהַבְחִין בֵּין יוֹם וּבֵין לָיְלָה. כְּשֶׁלּוֹבֵשׁ בְּגָדָיו מְבָרֵךְ בָּרוּךְ אַתָּה יְיָ׳‎ אֱלֹהֵינוּ מֶלֶךְ הָעוֹלָם מַלְבִּישׁ עֲרוּמִים. כְּשֶׁמַּנִּיחַ סְדִינוֹ עַל רֹאשׁוֹ מְבָרֵךְ בָּרוּךְ אַתָּה יְיָ׳‎ אֱלֹהֵינוּ מֶלֶךְ הָעוֹלָם עוֹטֵר יִשְׂרָאֵל בְּתִפְאָרָה. כְּשֶׁמַּעֲבִיר יָדָיו עַל עֵינָיו מְבָרֵךְ פּוֹקֵחַ עִוְרִים. כְּשֶׁיֵּשֵׁב עַל מִטָּתוֹ מְבָרֵךְ מַתִּיר אֲסוּרִים. כְּשֶׁמּוֹרִיד רַגְלָיו מִן הַמִּטָּה וּמַנִּיחָם עַל גַּבֵּי קַרְקַע מְבָרֵךְ רוֹקַע הָאָרֶץ עַל הַמָּיִם. כְּשֶׁעוֹמֵד מְבָרֵךְ זוֹקֵף כְּפוּפִים. כְּשֶׁנּוֹטֵל יָדָיו מְבָרֵךְ אֲשֶׁר קִדְּשָׁנוּ בְּמִצְוֹתָיו וְצִוָּנוּ עַל נְטִילַת יָדָיִם. כְּשֶׁרוֹחֵץ פָּנָיו מְבָרֵךְ בָּרוּךְ אַתָּה יְיָ׳‎ אֱלֹהֵינוּ מֶלֶךְ הָעוֹלָם הַמַּעֲבִיר חֶבְלֵי שֵׁנָה מֵעֵינָי וּתְנוּמָה מֵעַפְעַפָּי, יְהִי רָצוֹן מִלְּפָנֶיךָ יְיָ׳‎ אֱלֹהַי וֵאלֹהֵי אֲבוֹתַי שֶׁתַּרְגִּילֵנִי לִדְבַר מִצְוָה וְאַל תַּרְגִּילֵנִי לִדְבַר עֲבֵרָה וְעָוֹן וְתַשְׁלֵט בִּי יֵצֶר טוֹב וְאַל יִשְׁלֹט בִּי יֵצֶר רָע וּתְחַזְּקֵנִי בְּמִצְוֹתֶיךָ וְתֵן חֶלְקִי בְּתוֹרָתֶךָ וְתִתְּנֵנִי לְחֵן וּלְחֶסֶד וּלְרַחֲמִים בְּעֵינֶיךָ וּבְעֵינֵי כָל רוֹאַי וְתִגְמְלֵנִי חֲסָדִים טוֹבִים, בָּרוּךְ אַתָּה יְיָ׳‎ גּוֹמֵל חֲסָדִים טוֹבִים:

(4) When he hears the crowing of the cock, he recites the blessing, "Blessed art Thou, O Lord our God, King of the Universe**This sentence “Blessed … Universe” precedes every one of the following blessings., who hast given to the cock intelligence to distinguish between day and night." When he puts on his garments, he recites, "Blessed art Thou, O Lord our God, King of the Universe, who clothest the naked." When he puts on his headgear he recites, "Blessed art Thou, O Lord our God, King of the Universe, who crownest Israel with glory." When he passes his hands over his eyes, he recites, "Who openest the eyes of the blind." When he sits up on his couch, he recites, "Who loosest those that are bound." When he descends from the couch and puts his feet on the ground, he recites, "Who spreadest forth the earth above the waters". When he stands up, he recites, "Who raisest up them that are bowed down". When he washes his hands, he recites, "Who hast sanctified us by Thy commandments and given us a command concerning the washing of the hands". When he washes his face, he recites the blessing, "Blessed art Thou, O Lord our God, King of the Universe, who removest the bands of sleep from mine eyes and slumber from mine eyelids. May it be Thy will, O Lord my God and God of my fathers to accustom me to religious duties and not accustom me to transgression. Let the good inclination have sway over me and let not the evil inclination have sway over me. Strengthen me in Thy commandments and grant my portion in Thy Law. Grant that I may be vouchsafed grace, loving kindness and mercy in Thy sight and in the sight of all who behold me, and bestow upon me loving kindnesses. Blessed art Thou, O Lord, who bestowest loving kindnesses upon Thy people, Israel.

(י) (י) ולא ילך - אפילו בבית שיש בו תקרה וכ"ש תחת אויר השמים דיש ליזהר לכו"ע:

(יא) (יא) ד"א - ומידת חסידות אפילו פחות מד"א ואפילו בעת השינה בלילה ויש שמצדדין לומר דאפילו ד"א אינו אסור מדינא רק להצנועין במעשיהן אבל כבר כתב הט"ז לקמן בסימן ח' דבזמנינו איסור גמור מדינא להיות בגילוי הראש ואפילו יושב בביתו עי"ש הטעם וכן כתב בתשובת מהר"י ברונא וכתב המ"א דאפילו קטנים נכון להרגילם בכיסוי הראש כי היכי דליהוי להו אימתא דשמיא כדאיתא (בשבת קנ"ו) כסי ראשך כי היכי דליהוי עלך אימתא דשמיא ודע עוד דלענין גילוי הראש די בכיסוי היד על הראש וה"ה אם מפלה ראשו שרי בגילוי הראש. ועיין בפמ"ג שכתב דלילך ד"א תחת אויר השמים לא מהני בזה כיסוי הראש ביד:

(ד) כובעים [קפיל"ה בלעז] הקלועים מקש חשיבא כסוי אבל הנחת יד על הראש לא חשיבא כסוי ואם אחר מניח ידו על ראשו של זה משמע דחשיבא כסוי:

(4) Caps ["kapilah" in the language of this country], and the woven straw hats, are considered covering. But placing one's hand on the head is not considered covering. If another person places their hand on one's head, this is considered covering.