{
    "componentChunkName": "component---src-templates-issues-tsx",
    "path": "/issues/45",
    "result": {"data":{"issuesJson":{"id":"e331fa7e-b9d0-532c-bd55-fee7c4803391","title":"sharkdp/bat: 类似 cat 命令，但带有 git 集成和语法高亮.","number":45,"bodyHTML":"<div align=\"center\" dir=\"auto\">\n<p dir=\"auto\"><a target=\"_blank\" rel=\"noopener noreferrer nofollow\" href=\"https://camo.githubusercontent.com/a15b413168923d02e21292705ceaf86b92675f98e250c5c896a02ba7504a6eae/68747470733a2f2f63646e2e6a7364656c6976722e6e65742f67682f657279616a662f7475406d61696e2f696d672f696d6167655f32303234303432305f3231343430382e676966\"><img src=\"https://camo.githubusercontent.com/a15b413168923d02e21292705ceaf86b92675f98e250c5c896a02ba7504a6eae/68747470733a2f2f63646e2e6a7364656c6976722e6e65742f67682f657279616a662f7475406d61696e2f696d672f696d6167655f32303234303432305f3231343430382e676966\" width=\"100%\" height=\"3\" data-animated-image=\"\" data-canonical-src=\"https://cdn.jsdelivr.net/gh/eryajf/tu@main/img/image_20240420_214408.gif\" style=\"max-width: 100%; height: auto; max-height: 3px;\"></a><br><br></p>\n<markdown-accessiblity-table><table role=\"table\">\n<thead>\n<tr>\n<th align=\"right\">Repos</th>\n<th align=\"left\"><a href=\"https://github.com/sharkdp/bat\">sharkdp/bat</a></th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td align=\"right\"><strong>Views</strong></td>\n<td align=\"left\"><a href=\"https://github.com/opsre/awesome-ops\"><img src=\"https://camo.githubusercontent.com/18e97828c7b81e446f41b2b00eda4a8bcfcc0439e6ed5b7c31f9668d8eb20393/68747470733a2f2f76696577732e77686174696c656172656e65642e746f6461792f76696577732f6769746875622f736861726b64702f6261742e737667\" alt=\"views\" data-canonical-src=\"https://views.whatilearened.today/views/github/sharkdp/bat.svg\" style=\"max-width: 100%;\"></a></td>\n</tr>\n<tr>\n<td align=\"right\"><strong>Stars</strong></td>\n<td align=\"left\"><a href=\"https://github.com/opsre/awesome-ops\"><img src=\"https://camo.githubusercontent.com/5b0b3c7d78a44861ba475d000b19c377057224d91c567bb007852a34e4e566be/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f73746172732f736861726b64702f6261743f636f6c6f723d663266303864266c6f676f3d556e64657274616c65266c6f676f436f6c6f723d656234363330\" alt=\"stars\" data-canonical-src=\"https://img.shields.io/github/stars/sharkdp/bat?color=f2f08d&amp;logo=Undertale&amp;logoColor=eb4630\" style=\"max-width: 100%;\"></a></td>\n</tr>\n<tr>\n<td align=\"right\"><strong>Forks</strong></td>\n<td align=\"left\"><a href=\"https://github.com/opsre/awesome-ops\"><img src=\"https://camo.githubusercontent.com/e6c8e87c30e23feb95c555237fc2d0f671ce788f845e88a7cc482daa5156ca4f/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f666f726b732f736861726b64702f6261743f636f6c6f723d626138366562266c6f676f3d48616e647368616b65266c6f676f436f6c6f723d656136616136\" alt=\"forks\" data-canonical-src=\"https://img.shields.io/github/forks/sharkdp/bat?color=ba86eb&amp;logo=Handshake&amp;logoColor=ea6aa6\" style=\"max-width: 100%;\"></a></td>\n</tr>\n<tr>\n<td align=\"right\"><strong>License</strong></td>\n<td align=\"left\"><a href=\"https://github.com/opsre/awesome-ops\"><img src=\"https://camo.githubusercontent.com/b2c774b17452a1a95aa944cec504eeff9c0c2b20cbffab0dd5aa35d379fe42e5/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6c6963656e73652f736861726b64702f6261743f6c6f676f3d64617461253341696d616765253246706e672533426261736536342532436956424f5277304b47676f414141414e53556845556741414144414141414177434159414141425841766d48414141414358424957584d41414173544141414c457745416d70775941414144336b6c45515652346e4f335953557a5555426748384a726f57567255474a66456d3773584e63534446784d544c327069347348456778654e526f77586770455742445552522532424e414e4f4b4f4b36366f6f4b4a4742586545475263574163455646475152484677516d483525324630774861655748493944554455354c356b6e6568644f62377a66652532423139636e434a47495243516945596c514237594a4979474c38616f73756c565a36695246516a69474b6b7564576735614c6c704f70704e586e665071773555304459524a6d56786a4367464633424c755a476d416f5655694b4541726d583744375553677351706f72674761336748664b34483663754262435644334771683141352532424c6745253242467749656e514d306a6f446f66714c6f48564e7742796d384370546e416d327a51713073676478624964515a556c416b7150415a3664676a303541446f59526f6f66792532466f5869726f376b3551586a4c6f70677a4b69514e6c4c4461716f4967754577426a7a7150355066446a45394479495879493633464d547751464d43567271774e61763451666f52673538514625324266724d485172454b3844546f434d714e4179574e4866786d54526f4c4f726d5352566747744466714345715a4f4851727a6f34706243557341333431365169364551394b476a6345465267484f724f4b6e5536574162396247455459656b4b7843766a546167394534706a653534446b3551503862624d4859762532464333756541654a6b50304f4778422532424a70426e4172595238455951516e6f4e31414e4661426e5050356c385372736559514c303641646b30464a5938484f5761424d6c6541486a683068506f73497a6c6f3876304125324633345a694f6548726130714b52504d5653493774762532423932747725324676687855654252713456454c674d376642714b354770526d6f514c584e7075625475367a6f4e52706754386e5051627138347764253246494375767978694b4871694e41664933774d367549684271476b4c696977414f734b44714f68743749747239567938536a52424557667941627225324668523142667056514664484a42253246423268683778376a36517077435665655951326b72554235436c636a3641326d3067576a25324244306d4c34397a573563517943484c4e37726a6c6d6d6174457958582532464372547a412532466f51785a6b576c39474a5443566f25324279546a3837253242346769504b6376307149486f344156344430565a727251493334706e70524d36357875652532467a417265453425324654253246536f676c664542794d7369517441546c4c3352414a355948725378365a44665337307337754d486842705225324659423573305057366f455270316236253246667252684b3353444c35546965364f515548516c5133735644752532427a50636b397657453973747225324236496a533967486d5750616861444a25324277434b364e494242587348423948796b587378774470686c436d416476706c6162554a4e6e5a504239342532464e7436784f6538587a4562503257684d335741673147756236744825324233513150673337365239713475716c6e6f36676448476a444f5139306562303141484d3672596975554a314f713472344656756a35765239427a4d3957674e764f7977446869495951467667626366774166774d764863615067425041253246447948476a50624e394138616d6562636477416444354e6633373574787165774e5552656f797677424958594c645170576c6877465771745061435044334173467541535636717171496c62304a766b564331464c39576b4c55556c55574b337a585a4c46432532423125324642726f46746f364f7358497545594a5034447a7a5732594656316f4a614141414141456c46546b5375516d4343\" alt=\"license\" data-canonical-src=\"https://img.shields.io/github/license/sharkdp/bat?logo=data%3Aimage%2Fpng%3Bbase64%2CiVBORw0KGgoAAAANSUhEUgAAADAAAAAwCAYAAABXAvmHAAAACXBIWXMAAAsTAAALEwEAmpwYAAAD3klEQVR4nO3YSUzUUBgH8JroWVrUGJfEm7sXNcSDFxMTL2pi4sHEgxeNRowXgpEWBDURR%2BNANOKOK66ooKJGBXeEGRcWAcEVFGQRHFwQmH5%2F0wHaeWHI9DUDU5L5knehdOb7zfe%2B19cnCJGIRCQiEYlQB7YJIyGL8aosulVZ6iRFQjiGKkudWg5aLlpOppNXnfPqw5U0DYRJmVxjCgFF3BLuZGmAoVUiKEArmX7D7USgsQporgGa3gHfK4H6cuBbCVD3Gqh1A5%2BLgE%2BFwIenQM0joDofqLoHVNwBym8CpTnAm2zQq0sgdxbIdQZUlAkqPAZ6dgj05ADoYRoofy%2FoXiro7k5QXjLopgzKiQNlLDaqoIguEwBjzqP5PfDjE9DyIXyI63FMTwQFMCVrqwNav4QfoRg58QF%2BfrMHQrEK8DToCMqNAyWNHfxmTRoLOrmSRVgGtDfqCEqZOHQrzo4pbCUsA3416Qi6EQ9KGjcEFRgHOrOKnU6WAb9bGETYekKxCvjTag9E4pje54Dk5QP8bbMHYv%2FC3ueAeJkP0OGxB%2BJpBnArYR8EYQQnoN1ANFaBnPP5l8SrseYQL06Adk0FJY8HOWaBMleAHjh0hPosIzlo8v0A%2F34ZiOeHra0qKRPMVSI7tv%2B92tw%2FvhxUeBRq4VELgM7fBqK5GpRmoQLXNpubTu6zoNRpgT8nPQbq84wd%2FICuvyxiKHqiNAfI3wM6uIhBqGkLiiwAOsKDqOht7Itr9Vy8SjRBEWfyAbr%2FhR1BfpVQFdHJB%2FB2hh7x7j6QpwCVeeYQ2krUB5Clcj6A2m0gWj%2BD0mL49zW5cQyCHLN7rjlmmatEyXX%2FCrTzA%2FoQxZkWl9GJTCVo%2ByTj87%2B4giPKcv0qIHo4AV4D0VZrrQI34pnpRM65xue%2FzAreE4%2FT%2FSoglfEByMsiQtATlL3RAJ5YHrSx6ZDfS70s7uMHhBpR%2FYB5s0PW6oERp1b6%2FfrRhK3SDL5Tie6OQUHQlQ3sVDu%2BzPck9vWE9str%2B6IjS9gHmWPahaDJ%2BwCK6NIBBXsHB9HykXsxwDphlCmAdvplabUJNnZPB94%2FNt6xOe8XzEbP2WhM3WAg1Gub6tH%2B3Q1Pg376R9q4uqlno6gdHGjDOQ90eb01AHM6rYiuUJ1Oq4r4FVuj5vR9BzM9WgNvOywDhiIYQFvgbcfwAfwMvHcaPgBPA%2FDyHGjPbN9A8amebcdwAdD5Nf375txqewNUReoyvwBIXYLdQpWlhwFWqtPaCPD3AsFuASV6qqqIlb0JvkVC1FL9WkLUUlUWK3zXZLFC%2B1%2FBroFto6OsXIuEYJP4DzzW2YFV1oJaAAAAAElFTkSuQmCC\" style=\"max-width: 100%;\"></a></td>\n</tr>\n<tr>\n<td align=\"right\"><strong>UpdatedAt</strong></td>\n<td align=\"left\"><a href=\"https://github.com/opsre/awesome-ops\"><img src=\"https://camo.githubusercontent.com/00a3b319b7dd9eb5c7ee9dbc21bbc7bb522ee513f6e20e4151ac7480d5b60bd0/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6c6173742d636f6d6d69742f736861726b64702f6261743f646973706c61795f74696d657374616d703d636f6d6d6974746572266c6f676f3d64617461253341696d616765253246706e672533426261736536342532436956424f5277304b47676f414141414e5355684555674141414234414141416543415941414141374d4b3669414141414358424957584d41414173544141414c457745416d7077594141414648556c45515652346e4c5658375539615678776d3236646c582532466468627825324232253246516e626b7655627264554151674a4a496655444e574454546d4f76314651554661504a346b7573725630314a7431734e70637453327533626f745a746d786439744a5346536f714b71494635625944464c436f76436c656673747a4a387758524c445a4c7a6e6b634f343535376e3364332532466e655a3472454f515a74315771462532423858467234253242664f4c4565326a6f59307a776638546f795a50766a45676b4c592532426b306d6d72584f36644b696e787a476b30666a5430782532425279723055716e6359637a4d317263347451253242497270324c4758646f344e4334567657715453373277716c632532427231334f527269364b6458646e624f484c6c776c7a4a70524b6e3657342532424b36706f4f434e6e494166486a253246253242776168495a4234764b6e715a6630714a704e49716c2532467638545530634e6c3572627963337730516e54703379324c54614a374d314e617844723266526e315370504736476961323174664533345463614f617931694d55564f5146624659714957536f31573854694156616e43306576584f4542375770313448466232327a453566714c4f433545524c515769644e614e49347545636339693768634a6c644868324e57725135674464624f6c7061756d49754c62326174415144506e7a3062384e6257636d785656524a33486d7870536377777a4f4a6d4b44524765384c6c435a444c4739673754496e5631516c376462586256316533675430574b697243466f6d6b5079767758466c5a474a4f6a563625324253743634757564445a4f55354555636f782532464d455144567674364d62634e3237593341797a687633737061557242365a3971724a534f3139657a6a387032704c426b4a792532426343484a7857493567573574636652527a31645531394766476b6f7539505a4f34736d52396a4746777065783444793362766e6d4b79706f74625531335669646a71595a68726a343972764d457425324625324659714c7a396430304e6a57253246637a67796f394f35317a7336614e6c6f354644747530445a675146686c47584a30644241446f4e6864367576703657686f617967374e394c564748386d443462253246486e667455516f4e4734764c51306769784d716c5725324234714f6a744e48446733723166365969525347785279375576714c62395534716b716e78504f4e7661356c447048723125324279794b524e4b57425a793565644d554842326d3572792532422532424551772532427a6766347a6f39253246306f634e3357527a4c4277344a2532424a7950574372716d4967475974554f735744346f785a46516f50556a4770564871493425324661666b51504336665a5165654d31253242764c7549516e6a754257514444437363726d485039656f4e5041744271664f6e5875614b25324268364a45624772732532427076764d6d78654962683836336162565065597953456f39464a48704e4d464a59253242503563575a6b6667374f3174537759436553514c54593345385130392532464256504a556c78516a7368543142736343593032723955445542667643484236367063665041336c794165336e6772332532463437584467614a7a736c7937787741364e5a746c555550437541487161536a5549502532427375653842525741432532464e6651374a5a505a35397330476a3756747049537a34685125324243706658474d4b685a63764c70554b7866574d386f68766637702532464f446a4842666356463849736b383267314648796b63564645253242555a414158343761452532464d6c34504f3530506e75683025324678346e6d637957507364774468427836436d6b4c562532466746446a594b784f4a4f4674623077517949684c39527943774b33414f664947703159464542686e4d4a634c525745624b644b516f55366e63545a6b494544696341792532463831645675454d3552775066657934784f7830496b25324649324e6e466b692532425761664f6f464959466367595a43797864376543556a626334416d46363566742532466b4d686b336f25324235686337734d4a79716a4a45477659466151464972375930775077384246415925324236253242766d6b3377367a7a5275444d6d5a5652736668385274413075455453443775434254364459514e36697665553066706b594c6a453671725672744f78654e4b553954484c5a4a396b4255324a427342685635416976422532466f4b61514e4b675043427744596149665a4334616454684f71463457454e56694c4a77566f586f62664c424b56773637414f6154734c6336355461564b32317651344c613939654b6359673576627873624f627a5451394e37554b4467554f3177446a6944494942736868357a746733396e514d4c535a4248344f7a424f55444551586d323036643366634c67737762585141345068634b336e6873775531427a3877765130395248472532466f597933656a6677424e6d746f59714c4130586741414141424a52553545726b4a676767253344253344266c6162656c3d557064617465644174\" alt=\"last-commit\" data-canonical-src=\"https://img.shields.io/github/last-commit/sharkdp/bat?display_timestamp=committer&amp;logo=data%3Aimage%2Fpng%3Bbase64%2CiVBORw0KGgoAAAANSUhEUgAAAB4AAAAeCAYAAAA7MK6iAAAACXBIWXMAAAsTAAALEwEAmpwYAAAFHUlEQVR4nLVX7U9aVxwm26dlX%2Fdhbx%2B2%2FQnbkvUbrdUAQgJJIfUDNWDTTmOv1FQUFaPJ4kusrV01Jt1sNpctS2u3botZtmxd9tJSFSoqKqIF5bYDFLCovClefstzJ8wXRLDZLznkcO4557n3d3%2FneZ4rEOQZt1WqF%2B8XFr4%2BfOLEe2joY0zwf8ToyZPvjEgkLY%2Bk0mmrXO6dKinxzGk0fjT0x%2BRyr0UqncYczM1rc4tQ%2BIrp2LGXdo4NC4VvWqTS72wqlc%2Br13ORri6KdXdnbOHLlwlzJpRKn6W4%2BK6poOCNnIAfHj%2F%2BwahIZB4vKnqZf0qJpNIql%2Fv8TU0cNl5rbyc3w0QnTp3y2LTaJ7M1NaxDr2fRn1SpPG6Gia21tfE34TcaOay1iMUVOQFbFYqIWSo1W8TiAVanC0evXOEB7Wp14HFb22zE5fqLOC5ERLQWidNaNI4uEcc9i7hcJldHh2NWrQ5gDdbOlpaumIuLb2atAQDPnz0b8NbWcmxVVRJ3HmxpScwwzOJmKDRGe8LlCZDLG9g7TInV1Ql7dbXbV1e3gT0WKirCFomkPyvwXFlZGJOjV6%2BSt64uudDZOU5EUcox%2FMEQDVvt6MbcN27Y3Ayzhv3spaUrB6Z9qrJSO19ezj8p2pLBkJy%2BcCHJxWI5gW5tcfRRz1dU19GfGkou9PZO4smR9jGFwpex4Dy3bvnmKypotbU13VidjqYZhrj49rvMEt%2F%2FYqLz9d00NjW%2Fczgyo9O51zs6aNlo5FDtu0DZgQFhlGXJ0dBADoNhd6uvp6Whoayg7N9LVGH8mD4b%2FHnftUQoNG4vLQ0gixMqlW%2B4qOjtNHDg3r1f6YiRSGxRy7UvqLb9U4qkqnxPONva5lDpHr1%2ByyKRNKWBZy5edMUHB2m5ry%2B%2BEQw%2Bzgf4zo9%2F0ocN3WRzLBw4J%2BJyPWCrqmIgGYtUOsWD4oxZFQoPUjGpVHqI4%2FafkQPC6fZQeeM1%2BvLuIQnjuBWQDDCscrmHP9eoNPAtBqfOnXuaK%2Bh6JEbGrs%2BpvvMmxeIbh863abVPeYySEo9FJHpNMFJY%2BP5cWZkfg7O1tSwYCeSQLTY3E8Q09%2FBVPJUlxQjshT1BscCY02r9UDUBfvCHB66pcfPA3lyAe3ngr3%2F47XDgaJzsly7xwA6NZtlUUPCuAHqaSjUIP%2Bsue8BRWAC%2FNfQ7JZPZ59s0Gj7VtpISz4hQ%2BCpfXGMKhZcvLpUKxfWM8ohvf7p%2FODjHBfcVF8Isk82g1FHykcVFE%2BUZAAX47aE%2FMl4PO50Pnuh0%2Fx4nmcyWPsdwDhBx6CmkLV%2FgFDjYKxOJOFtb0wQyIhL9RyCwK3AOfIGp1YFEBhnMJcLRWEbKdKQoU6ncTZkIEDicAy%2F81dVuEM5RwPfey4xOx0Ik%2FI2NnFki%2BWafOoFIYFcgYZCyxd7eCUjbc4AmF65ft%2FkMhk3o%2B5hc7sMJyqjJEGvYFaQFIr7Y0wPw8BFAY%2B6%2Bvmk3w6zzRuDMmZVRsfh8RtA0uETSD7uCBT6DYQN6iveU0fpkYLjE6qrVrtOxeNKU9THLZJ9kBU2JBsBhV5AivB%2FoKaQNKgPCBwDYaIfZC4adThOqF4WENViLJwVoXobfLBKVw67AOaTsLc65TaVK21vQ4La99eKcYg5vbxsbObzTQ9N7UKDgUO1wDjiDIIBshh5ztg39nQMLSZBH4OzBOUDEQXm206d3fcLgswbXQA4PhcK3nhswU1Bz8wvQ09RHG%2FoYy3ejfwBNmtoYqLA0XgAAAABJRU5ErkJggg%3D%3D&amp;label=UpdatedAt\" style=\"max-width: 100%;\"></a></td>\n</tr>\n<tr>\n<td align=\"right\"><strong>CreatedAt</strong></td>\n<td align=\"left\"><a href=\"https://github.com/opsre/awesome-ops\"><img src=\"https://camo.githubusercontent.com/3f4d0a33785ce5f9edfbbcc7c47996fbeacd48356bcdbe23e8106a9f44e8dd68/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f637265617465642d61742f736861726b64702f6261743f6c6f676f3d64617461253341696d616765253246706e672533426261736536342532436956424f5277304b47676f414141414e5355684555674141414234414141416543415941414141374d4b3669414141414358424957584d41414173544141414c457745416d7077594141414648556c45515652346e4c5658375539615678776d3236646c582532466468627825324232253246516e626b7655627264554151674a4a496655444e574454546d4f76314651554661504a346b7573725630314a7431734e70637453327533626f745a746d786439744a5346536f714b71494635625944464c436f76436c656673747a4a387758524c445a4c7a6e6b634f343535376e3364332532466e655a3472454f515a74315771462532423858467234253242664f4c4565326a6f59307a776638546f795a50766a45676b4c592532426b306d6d72584f36644b696e787a476b30666a5430782532425279723055716e6359637a4d317263347451253242497270324c4758646f344e4334567657715453373277716c632532427231334f527269364b6458646e624f484c6c776c7a4a70524b6e3657342532424b36706f4f434e6e494166486a253246253242776168495a4234764b6e715a6630714a704e49716c2532467638545530634e6c3572627963337730516e54703379324c54614a374d314e617844723266526e315370504736476961323174664533345463614f617931694d55564f5146624659714957536f31573854694156616e43306576584f4542375770313448466232327a453566714c4f433545524c515769644e614e49347545636339693768634a6c644868324e57725135674464624f6c7061756d49754c62326174415144506e7a3062384e6257636d785656524a33486d7870536377777a4f4a6d4b44524765384c6c435a444c4739673754496e5631516c376462586256316533675430574b697243466f6d6b5079767758466c5a474a4f6a563625324253743634757564445a4f55354555636f782532464d455144567674364d62634e3237593341797a687633737061557242365a3971724a534f3139657a6a387032704c426b4a792532426343484a7857493567573574636652527a31645531394766476b6f7539505a4f34736d52396a4746777065783444793362766e6d4b79706f74625531335669646a71595a68726a343972764d457425324625324659714c7a396430304e6a57253246637a67796f394f35317a7336614e6c6f354644747530445a675146686c47584a30644241446f4e6864367576703657686f617967374e394c564748386d443462253246486e667455516f4e4734764c51306769784d716c5725324234714f6a744e48446733723166365969525347785279375576714c62395534716b716e78504f4e7661356c447048723125324279794b524e4b57425a793565644d554842326d3572792532422532424551772532427a6766347a6f39253246306f634e3357527a4c4277344a2532424a7950574372716d4967475974554f735744346f785a46516f50556a4770564871493425324661666b51504336665a5165654d31253242764c7549516e6a754257514444437363726d485039656f4e5041744271664f6e5875614b25324268364a45624772732532427076764d6d78654962683836336162565065597953456f39464a48704e4d464a59253242503563575a6b6667374f3174537759436553514c54593345385130392532464256504a556c78516a7368543142736343593032723955445542667643484236367063665041336c794165336e6772332532463437584467614a7a736c7937787741364e5a746c555550437541487161536a5549502532427375653842525741432532464e6651374a5a505a35397330476a3756747049537a34685125324243706658474d4b685a63764c70554b7866574d386f68766637702532464f446a4842666356463849736b383267314648796b63564645253242555a414158343761452532464d6c34504f3530506e75683025324678346e6d637957507364774468427836436d6b4c562532466746446a594b784f4a4f4674623077517949684c39527943774b33414f664947703159464542686e4d4a634c525745624b644b516f55366e63545a6b494544696341792532463831645675454d3552775066657934784f7830496b25324649324e6e466b692532425761664f6f464959466367595a43797864376543556a626334416d46363566742532466b4d686b336f25324235686337734d4a79716a4a45477659466151464972375930775077384246415925324236253242766d6b3377367a7a5275444d6d5a5652736668385274413075455453443775434254364459514e36697665553066706b594c6a453671725672744f78654e4b553954484c5a4a396b4255324a427342685635416976422532466f4b61514e4b675043427744596149665a4334616454684f71463457454e56694c4a77566f586f62664c424b56773637414f6154734c6336355461564b32317651344c613939654b6359673576627873624f627a5451394e37554b4467554f3177446a6944494942736868357a746733396e514d4c535a4248344f7a424f55444551586d323036643366634c67737762585141345068634b336e6873775531427a3877765130395248472532466f597933656a6677424e6d746f59714c4130586741414141424a52553545726b4a676767253344253344266c6162656c3d437265617465644174\" alt=\"create-at\" data-canonical-src=\"https://img.shields.io/github/created-at/sharkdp/bat?logo=data%3Aimage%2Fpng%3Bbase64%2CiVBORw0KGgoAAAANSUhEUgAAAB4AAAAeCAYAAAA7MK6iAAAACXBIWXMAAAsTAAALEwEAmpwYAAAFHUlEQVR4nLVX7U9aVxwm26dlX%2Fdhbx%2B2%2FQnbkvUbrdUAQgJJIfUDNWDTTmOv1FQUFaPJ4kusrV01Jt1sNpctS2u3botZtmxd9tJSFSoqKqIF5bYDFLCovClefstzJ8wXRLDZLznkcO4557n3d3%2FneZ4rEOQZt1WqF%2B8XFr4%2BfOLEe2joY0zwf8ToyZPvjEgkLY%2Bk0mmrXO6dKinxzGk0fjT0x%2BRyr0UqncYczM1rc4tQ%2BIrp2LGXdo4NC4VvWqTS72wqlc%2Br13ORri6KdXdnbOHLlwlzJpRKn6W4%2BK6poOCNnIAfHj%2F%2BwahIZB4vKnqZf0qJpNIql%2Fv8TU0cNl5rbyc3w0QnTp3y2LTaJ7M1NaxDr2fRn1SpPG6Gia21tfE34TcaOay1iMUVOQFbFYqIWSo1W8TiAVanC0evXOEB7Wp14HFb22zE5fqLOC5ERLQWidNaNI4uEcc9i7hcJldHh2NWrQ5gDdbOlpaumIuLb2atAQDPnz0b8NbWcmxVVRJ3HmxpScwwzOJmKDRGe8LlCZDLG9g7TInV1Ql7dbXbV1e3gT0WKirCFomkPyvwXFlZGJOjV6%2BSt64uudDZOU5EUcox%2FMEQDVvt6MbcN27Y3Ayzhv3spaUrB6Z9qrJSO19ezj8p2pLBkJy%2BcCHJxWI5gW5tcfRRz1dU19GfGkou9PZO4smR9jGFwpex4Dy3bvnmKypotbU13VidjqYZhrj49rvMEt%2F%2FYqLz9d00NjW%2Fczgyo9O51zs6aNlo5FDtu0DZgQFhlGXJ0dBADoNhd6uvp6Whoayg7N9LVGH8mD4b%2FHnftUQoNG4vLQ0gixMqlW%2B4qOjtNHDg3r1f6YiRSGxRy7UvqLb9U4qkqnxPONva5lDpHr1%2ByyKRNKWBZy5edMUHB2m5ry%2B%2BEQw%2Bzgf4zo9%2F0ocN3WRzLBw4J%2BJyPWCrqmIgGYtUOsWD4oxZFQoPUjGpVHqI4%2FafkQPC6fZQeeM1%2BvLuIQnjuBWQDDCscrmHP9eoNPAtBqfOnXuaK%2Bh6JEbGrs%2BpvvMmxeIbh863abVPeYySEo9FJHpNMFJY%2BP5cWZkfg7O1tSwYCeSQLTY3E8Q09%2FBVPJUlxQjshT1BscCY02r9UDUBfvCHB66pcfPA3lyAe3ngr3%2F47XDgaJzsly7xwA6NZtlUUPCuAHqaSjUIP%2Bsue8BRWAC%2FNfQ7JZPZ59s0Gj7VtpISz4hQ%2BCpfXGMKhZcvLpUKxfWM8ohvf7p%2FODjHBfcVF8Isk82g1FHykcVFE%2BUZAAX47aE%2FMl4PO50Pnuh0%2Fx4nmcyWPsdwDhBx6CmkLV%2FgFDjYKxOJOFtb0wQyIhL9RyCwK3AOfIGp1YFEBhnMJcLRWEbKdKQoU6ncTZkIEDicAy%2F81dVuEM5RwPfey4xOx0Ik%2FI2NnFki%2BWafOoFIYFcgYZCyxd7eCUjbc4AmF65ft%2FkMhk3o%2B5hc7sMJyqjJEGvYFaQFIr7Y0wPw8BFAY%2B6%2Bvmk3w6zzRuDMmZVRsfh8RtA0uETSD7uCBT6DYQN6iveU0fpkYLjE6qrVrtOxeNKU9THLZJ9kBU2JBsBhV5AivB%2FoKaQNKgPCBwDYaIfZC4adThOqF4WENViLJwVoXobfLBKVw67AOaTsLc65TaVK21vQ4La99eKcYg5vbxsbObzTQ9N7UKDgUO1wDjiDIIBshh5ztg39nQMLSZBH4OzBOUDEQXm206d3fcLgswbXQA4PhcK3nhswU1Bz8wvQ09RHG%2FoYy3ejfwBNmtoYqLA0XgAAAABJRU5ErkJggg%3D%3D&amp;label=CreatedAt\" style=\"max-width: 100%;\"></a></td>\n</tr>\n</tbody>\n</table></markdown-accessiblity-table>\n<a href=\"https://github.com/opsre/awesome-ops\">\n</a><p dir=\"auto\"><a href=\"https://github.com/opsre/awesome-ops\"><img src=\"https://camo.githubusercontent.com/b964a36ea4078c39f603d46a29436371c7541a2f26e0228d7b21b9d9805b43d3/68747470733a2f2f736f6369616c6966792e6769742e63692f6f707372652f617765736f6d652d6f70732f696d6167653f6465736372697074696f6e3d3126666f6e743d42697474657226666f726b733d31266973737565733d31266c616e67756167653d31266c6f676f3d6874747073253341253246253246617661746172732e67697468756275736572636f6e74656e742e636f6d25324675253246313838353638303230266e616d653d31266f776e65723d31267061747465726e3d436972637569742b426f6172642670756c6c733d31267374617267617a6572733d31267468656d653d4c69676874\" alt=\"\" data-canonical-src=\"https://socialify.git.ci/opsre/awesome-ops/image?description=1&amp;font=Bitter&amp;forks=1&amp;issues=1&amp;language=1&amp;logo=https%3A%2F%2Favatars.githubusercontent.com%2Fu%2F188568020&amp;name=1&amp;owner=1&amp;pattern=Circuit+Board&amp;pulls=1&amp;stargazers=1&amp;theme=Light\" style=\"max-width: 100%;\"></a></p>\n<a target=\"_blank\" rel=\"noopener noreferrer nofollow\" href=\"https://camo.githubusercontent.com/a15b413168923d02e21292705ceaf86b92675f98e250c5c896a02ba7504a6eae/68747470733a2f2f63646e2e6a7364656c6976722e6e65742f67682f657279616a662f7475406d61696e2f696d672f696d6167655f32303234303432305f3231343430382e676966\"><img src=\"https://camo.githubusercontent.com/a15b413168923d02e21292705ceaf86b92675f98e250c5c896a02ba7504a6eae/68747470733a2f2f63646e2e6a7364656c6976722e6e65742f67682f657279616a662f7475406d61696e2f696d672f696d6167655f32303234303432305f3231343430382e676966\" width=\"100%\" height=\"3\" data-animated-image=\"\" data-canonical-src=\"https://cdn.jsdelivr.net/gh/eryajf/tu@main/img/image_20240420_214408.gif\" style=\"max-width: 100%; height: auto; max-height: 3px;\"></a>\n</div>\n<p align=\"center\" dir=\"auto\">\n  <a target=\"_blank\" rel=\"noopener noreferrer\" href=\"doc/logo-header.svg\"><img src=\"doc/logo-header.svg\" alt=\"bat - a cat clone with wings\" style=\"max-width: 100%;\"></a><br>\n  <a href=\"https://github.com/sharkdp/bat/actions?query=workflow%3ACICD\"><img src=\"https://github.com/sharkdp/bat/workflows/CICD/badge.svg\" alt=\"Build Status\" style=\"max-width: 100%;\"></a>\n  <a target=\"_blank\" rel=\"noopener noreferrer nofollow\" href=\"https://camo.githubusercontent.com/b98ad4c1ad5d45c3db1f6c9c7cf661697d40ead67b2edc6f00580da600d38099/68747470733a2f2f696d672e736869656c64732e696f2f6372617465732f6c2f6261742e737667\"><img src=\"https://camo.githubusercontent.com/b98ad4c1ad5d45c3db1f6c9c7cf661697d40ead67b2edc6f00580da600d38099/68747470733a2f2f696d672e736869656c64732e696f2f6372617465732f6c2f6261742e737667\" alt=\"license\" data-canonical-src=\"https://img.shields.io/crates/l/bat.svg\" style=\"max-width: 100%;\"></a>\n  <a href=\"https://crates.io/crates/bat\" rel=\"nofollow\"><img src=\"https://camo.githubusercontent.com/f1890bc7fd1e2c8b70eb84883757888d5844bd76a01d2d135ee4799338d437db/68747470733a2f2f696d672e736869656c64732e696f2f6372617465732f762f6261742e7376673f636f6c6f72423d333139653863\" alt=\"Version info\" data-canonical-src=\"https://img.shields.io/crates/v/bat.svg?colorB=319e8c\" style=\"max-width: 100%;\"></a><br>\n  A <i>cat(1)</i> clone with syntax highlighting and Git integration.\n</p>\n<p align=\"center\" dir=\"auto\">\n  <a href=\"#syntax-highlighting\">Key Features</a> •\n  <a href=\"#how-to-use\">How To Use</a> •\n  <a href=\"#installation\">Installation</a> •\n  <a href=\"#customization\">Customization</a> •\n  <a href=\"#project-goals-and-alternatives\">Project goals, alternatives</a><br>\n  [English]\n  [<a href=\"doc/README-zh.md\">中文</a>]\n  [<a href=\"doc/README-ja.md\">日本語</a>]\n  [<a href=\"doc/README-ko.md\">한국어</a>]\n  [<a href=\"doc/README-ru.md\">Русский</a>]\n</p>\n<h3 dir=\"auto\">Sponsors</h3>\n<p dir=\"auto\">A special <em>thank you</em> goes to our biggest <a href=\"doc/sponsors.md\">sponsors</a>:<br></p>\n<p dir=\"auto\">\n<a href=\"https://www.warp.dev/bat\" rel=\"nofollow\">\n  <img src=\"doc/sponsors/warp-logo.png\" width=\"200\" alt=\"Warp\" style=\"max-width: 100%;\">\n  <br>\n  <strong>Warp, the intelligent terminal</strong>\n  <br>\n  <sub>Available on MacOS, Linux, Windows</sub>\n</a>\n</p><p dir=\"auto\">\n<a href=\"https://graphite.dev/?utm_source=github&amp;utm_medium=repo&amp;utm_campaign=bat\" rel=\"nofollow\">\n  <img src=\"doc/sponsors/graphite-logo.jpeg\" width=\"200\" alt=\"Graphite\" style=\"max-width: 100%;\">\n  <br>\n  <strong>Graphite is the AI developer productivity platform helping<br>teams on GitHub ship higher quality software, faster</strong>\n</a>\n</p>\n<h3 dir=\"auto\">Syntax highlighting</h3>\n<p dir=\"auto\"><code class=\"notranslate\">bat</code> supports syntax highlighting for a large number of programming and markup<br>\nlanguages:</p>\n<p dir=\"auto\"><a target=\"_blank\" rel=\"noopener noreferrer nofollow\" href=\"https://camo.githubusercontent.com/a9789c5200bdb0a22602643d7bf85f0f424ddd4259e763abc865609010c5e228/68747470733a2f2f696d6775722e636f6d2f724773646e44652e706e67\"><img src=\"https://camo.githubusercontent.com/a9789c5200bdb0a22602643d7bf85f0f424ddd4259e763abc865609010c5e228/68747470733a2f2f696d6775722e636f6d2f724773646e44652e706e67\" alt=\"Syntax highlighting example\" data-canonical-src=\"https://imgur.com/rGsdnDe.png\" style=\"max-width: 100%;\"></a></p>\n<h3 dir=\"auto\">Git integration</h3>\n<p dir=\"auto\"><code class=\"notranslate\">bat</code> communicates with <code class=\"notranslate\">git</code> to show modifications with respect to the index<br>\n(see left side bar):</p>\n<p dir=\"auto\"><a target=\"_blank\" rel=\"noopener noreferrer nofollow\" href=\"https://camo.githubusercontent.com/43e40bf9c20d5ceda8fa67f1d95b5c66548b2f6f8dca8403e08129991cc32966/68747470733a2f2f692e696d6775722e636f6d2f326c53573452452e706e67\"><img src=\"https://camo.githubusercontent.com/43e40bf9c20d5ceda8fa67f1d95b5c66548b2f6f8dca8403e08129991cc32966/68747470733a2f2f692e696d6775722e636f6d2f326c53573452452e706e67\" alt=\"Git integration example\" data-canonical-src=\"https://i.imgur.com/2lSW4RE.png\" style=\"max-width: 100%;\"></a></p>\n<h3 dir=\"auto\">Show non-printable characters</h3>\n<p dir=\"auto\">You can use the <code class=\"notranslate\">-A</code>/<code class=\"notranslate\">--show-all</code> option to show and highlight non-printable<br>\ncharacters:</p>\n<p dir=\"auto\"><a target=\"_blank\" rel=\"noopener noreferrer nofollow\" href=\"https://camo.githubusercontent.com/53fa5d4d298aafad2d5baf2312865d0fe5fb2a130bdc8e21d7f534f39f76e29b/68747470733a2f2f692e696d6775722e636f6d2f576e64477039482e706e67\"><img src=\"https://camo.githubusercontent.com/53fa5d4d298aafad2d5baf2312865d0fe5fb2a130bdc8e21d7f534f39f76e29b/68747470733a2f2f692e696d6775722e636f6d2f576e64477039482e706e67\" alt=\"Non-printable character example\" data-canonical-src=\"https://i.imgur.com/WndGp9H.png\" style=\"max-width: 100%;\"></a></p>\n<h3 dir=\"auto\">Automatic paging</h3>\n<p dir=\"auto\">By default, <code class=\"notranslate\">bat</code> pipes its own output to a pager (e.g. <code class=\"notranslate\">less</code>) if the output is too large for one screen.<br>\nIf you would rather <code class=\"notranslate\">bat</code> work like <code class=\"notranslate\">cat</code> all the time (never page output), you can set <code class=\"notranslate\">--paging=never</code> as an option, either on the command line or in your configuration file.<br>\nIf you intend to alias <code class=\"notranslate\">cat</code> to <code class=\"notranslate\">bat</code> in your shell configuration, you can use <code class=\"notranslate\">alias cat='bat --paging=never'</code> to preserve the default behavior.</p>\n<h4 dir=\"auto\">File concatenation</h4>\n<p dir=\"auto\">Even with a pager set, you can still use <code class=\"notranslate\">bat</code> to concatenate files 😉.<br>\nWhenever <code class=\"notranslate\">bat</code> detects a non-interactive terminal (i.e. when you pipe into another process or into a file), <code class=\"notranslate\">bat</code> will act as a drop-in replacement for <code class=\"notranslate\">cat</code> and fall back to printing the plain file contents, regardless of the <code class=\"notranslate\">--pager</code> option's value.</p>\n<h2 dir=\"auto\">How to use</h2>\n<p dir=\"auto\">Display a single file on the terminal</p>\n<div class=\"highlight highlight-source-shell notranslate position-relative overflow-auto\" dir=\"auto\" data-snippet-clipboard-copy-content=\"&gt; bat README.md\"><pre class=\"notranslate\"><span class=\"pl-k\">&gt;</span> bat README.md</pre></div>\n<p dir=\"auto\">Display multiple files at once</p>\n<div class=\"highlight highlight-source-shell notranslate position-relative overflow-auto\" dir=\"auto\" data-snippet-clipboard-copy-content=\"&gt; bat src/*.rs\"><pre class=\"notranslate\"><span class=\"pl-k\">&gt;</span> bat src/<span class=\"pl-k\">*</span>.rs</pre></div>\n<p dir=\"auto\">Read from stdin, determine the syntax automatically (note, highlighting will<br>\nonly work if the syntax can be determined from the first line of the file,<br>\nusually through a shebang such as <code class=\"notranslate\">#!/bin/sh</code>)</p>\n<div class=\"highlight highlight-source-shell notranslate position-relative overflow-auto\" dir=\"auto\" data-snippet-clipboard-copy-content=\"&gt; curl -s https://sh.rustup.rs | bat\"><pre class=\"notranslate\"><span class=\"pl-k\">&gt;</span> curl -s https://sh.rustup.rs <span class=\"pl-k\">|</span> bat</pre></div>\n<p dir=\"auto\">Read from stdin, specify the language explicitly</p>\n<div class=\"highlight highlight-source-shell notranslate position-relative overflow-auto\" dir=\"auto\" data-snippet-clipboard-copy-content=\"&gt; yaml2json .travis.yml | json_pp | bat -l json\"><pre class=\"notranslate\"><span class=\"pl-k\">&gt;</span> yaml2json .travis.yml <span class=\"pl-k\">|</span> json_pp <span class=\"pl-k\">|</span> bat -l json</pre></div>\n<p dir=\"auto\">Show and highlight non-printable characters:</p>\n<div class=\"highlight highlight-source-shell notranslate position-relative overflow-auto\" dir=\"auto\" data-snippet-clipboard-copy-content=\"&gt; bat -A /etc/hosts\"><pre class=\"notranslate\"><span class=\"pl-k\">&gt;</span> bat -A /etc/hosts</pre></div>\n<p dir=\"auto\">Use it as a <code class=\"notranslate\">cat</code> replacement:</p>\n<div class=\"highlight highlight-source-shell notranslate position-relative overflow-auto\" dir=\"auto\" data-snippet-clipboard-copy-content=\"bat &gt; note.md  # quickly create a new file\n\nbat header.md content.md footer.md &gt; document.md\n\nbat -n main.rs  # show line numbers (only)\n\nbat f - g  # output 'f', then stdin, then 'g'.\"><pre class=\"notranslate\">bat <span class=\"pl-k\">&gt;</span> note.md  <span class=\"pl-c\"><span class=\"pl-c\">#</span> quickly create a new file</span>\n\nbat header.md content.md footer.md <span class=\"pl-k\">&gt;</span> document.md\n\nbat -n main.rs  <span class=\"pl-c\"><span class=\"pl-c\">#</span> show line numbers (only)</span>\n\nbat f - g  <span class=\"pl-c\"><span class=\"pl-c\">#</span> output 'f', then stdin, then 'g'.</span></pre></div>\n<h3 dir=\"auto\">Integration with other tools</h3>\n<h4 dir=\"auto\"><code class=\"notranslate\">fzf</code></h4>\n<p dir=\"auto\">You can use <code class=\"notranslate\">bat</code> as a previewer for <a href=\"https://github.com/junegunn/fzf\"><code class=\"notranslate\">fzf</code></a>. To do this,<br>\nuse <code class=\"notranslate\">bat</code>s <code class=\"notranslate\">--color=always</code> option to force colorized output. You can also use <code class=\"notranslate\">--line-range</code><br>\noption to restrict the load times for long files:</p>\n<div class=\"highlight highlight-source-shell notranslate position-relative overflow-auto\" dir=\"auto\" data-snippet-clipboard-copy-content=\"fzf --preview &quot;bat --color=always --style=numbers --line-range=:500 {}&quot;\"><pre class=\"notranslate\">fzf --preview <span class=\"pl-s\"><span class=\"pl-pds\">\"</span>bat --color=always --style=numbers --line-range=:500 {}<span class=\"pl-pds\">\"</span></span></pre></div>\n<p dir=\"auto\">For more information, see <a href=\"https://github.com/junegunn/fzf#preview-window\"><code class=\"notranslate\">fzf</code>'s <code class=\"notranslate\">README</code></a>.</p>\n<h4 dir=\"auto\"><code class=\"notranslate\">find</code> or <code class=\"notranslate\">fd</code></h4>\n<p dir=\"auto\">You can use the <code class=\"notranslate\">-exec</code> option of <code class=\"notranslate\">find</code> to preview all search results with <code class=\"notranslate\">bat</code>:</p>\n<div class=\"highlight highlight-source-shell notranslate position-relative overflow-auto\" dir=\"auto\" data-snippet-clipboard-copy-content=\"find … -exec bat {} +\"><pre class=\"notranslate\">find … -exec bat {} +</pre></div>\n<p dir=\"auto\">If you happen to use <a href=\"https://github.com/sharkdp/fd\"><code class=\"notranslate\">fd</code></a>, you can use the <code class=\"notranslate\">-X</code>/<code class=\"notranslate\">--exec-batch</code> option to do the same:</p>\n<div class=\"highlight highlight-source-shell notranslate position-relative overflow-auto\" dir=\"auto\" data-snippet-clipboard-copy-content=\"fd … -X bat\"><pre class=\"notranslate\">fd … -X bat</pre></div>\n<h4 dir=\"auto\"><code class=\"notranslate\">ripgrep</code></h4>\n<p dir=\"auto\">With <a href=\"https://github.com/eth-p/bat-extras/blob/master/doc/batgrep.md\"><code class=\"notranslate\">batgrep</code></a>, <code class=\"notranslate\">bat</code> can be used as the printer for <a href=\"https://github.com/BurntSushi/ripgrep\"><code class=\"notranslate\">ripgrep</code></a> search results.</p>\n<div class=\"highlight highlight-source-shell notranslate position-relative overflow-auto\" dir=\"auto\" data-snippet-clipboard-copy-content=\"batgrep needle src/\"><pre class=\"notranslate\">batgrep needle src/</pre></div>\n<h4 dir=\"auto\"><code class=\"notranslate\">tail -f</code></h4>\n<p dir=\"auto\"><code class=\"notranslate\">bat</code> can be combined with <code class=\"notranslate\">tail -f</code> to continuously monitor a given file with syntax highlighting.</p>\n<div class=\"highlight highlight-source-shell notranslate position-relative overflow-auto\" dir=\"auto\" data-snippet-clipboard-copy-content=\"tail -f /var/log/pacman.log | bat --paging=never -l log\"><pre class=\"notranslate\">tail -f /var/log/pacman.log <span class=\"pl-k\">|</span> bat --paging=never -l log</pre></div>\n<p dir=\"auto\">Note that we have to switch off paging in order for this to work. We have also specified the syntax<br>\nexplicitly (<code class=\"notranslate\">-l log</code>), as it can not be auto-detected in this case.</p>\n<h4 dir=\"auto\"><code class=\"notranslate\">git</code></h4>\n<p dir=\"auto\">You can combine <code class=\"notranslate\">bat</code> with <code class=\"notranslate\">git show</code> to view an older version of a given file with proper syntax<br>\nhighlighting:</p>\n<div class=\"highlight highlight-source-shell notranslate position-relative overflow-auto\" dir=\"auto\" data-snippet-clipboard-copy-content=\"git show v0.6.0:src/main.rs | bat -l rs\"><pre class=\"notranslate\">git show v0.6.0:src/main.rs <span class=\"pl-k\">|</span> bat -l rs</pre></div>\n<h4 dir=\"auto\"><code class=\"notranslate\">git diff</code></h4>\n<p dir=\"auto\">You can combine <code class=\"notranslate\">bat</code> with <code class=\"notranslate\">git diff</code> to view lines around code changes with proper syntax<br>\nhighlighting:</p>\n<div class=\"highlight highlight-source-shell notranslate position-relative overflow-auto\" dir=\"auto\" data-snippet-clipboard-copy-content=\"batdiff() {\n    git diff --name-only --relative --diff-filter=d | xargs bat --diff\n}\"><pre class=\"notranslate\"><span class=\"pl-en\">batdiff</span>() {\n    git diff --name-only --relative --diff-filter=d <span class=\"pl-k\">|</span> xargs bat --diff\n}</pre></div>\n<p dir=\"auto\">If you prefer to use this as a separate tool, check out <code class=\"notranslate\">batdiff</code> in <a href=\"https://github.com/eth-p/bat-extras\"><code class=\"notranslate\">bat-extras</code></a>.</p>\n<p dir=\"auto\">If you are looking for more support for git and diff operations, check out <a href=\"https://github.com/dandavison/delta\"><code class=\"notranslate\">delta</code></a>.</p>\n<h4 dir=\"auto\"><code class=\"notranslate\">xclip</code></h4>\n<p dir=\"auto\">The line numbers and Git modification markers in the output of <code class=\"notranslate\">bat</code> can make it hard to copy<br>\nthe contents of a file. To prevent this, you can call <code class=\"notranslate\">bat</code> with the <code class=\"notranslate\">-p</code>/<code class=\"notranslate\">--plain</code> option or<br>\nsimply pipe the output into <code class=\"notranslate\">xclip</code>:</p>\n<div class=\"highlight highlight-source-shell notranslate position-relative overflow-auto\" dir=\"auto\" data-snippet-clipboard-copy-content=\"bat main.cpp | xclip\"><pre class=\"notranslate\">bat main.cpp <span class=\"pl-k\">|</span> xclip</pre></div>\n<p dir=\"auto\"><code class=\"notranslate\">bat</code> will detect that the output is being redirected and print the plain file contents.</p>\n<h4 dir=\"auto\"><code class=\"notranslate\">man</code></h4>\n<p dir=\"auto\"><code class=\"notranslate\">bat</code> can be used as a colorizing pager for <code class=\"notranslate\">man</code>, by setting the<br>\n<code class=\"notranslate\">MANPAGER</code> environment variable:</p>\n<div class=\"highlight highlight-source-shell notranslate position-relative overflow-auto\" dir=\"auto\" data-snippet-clipboard-copy-content=\"export MANPAGER=&quot;sh -c 'sed -u -e \\&quot;s/\\\\x1B\\[[0-9;]*m//g; s/.\\\\x08//g\\&quot; | bat -p -lman'&quot;\nman 2 select\"><pre class=\"notranslate\"><span class=\"pl-k\">export</span> MANPAGER=<span class=\"pl-s\"><span class=\"pl-pds\">\"</span>sh -c 'sed -u -e <span class=\"pl-cce\">\\\"</span>s/<span class=\"pl-cce\">\\\\</span>x1B\\[[0-9;]*m//g; s/.<span class=\"pl-cce\">\\\\</span>x08//g<span class=\"pl-cce\">\\\"</span> | bat -p -lman'<span class=\"pl-pds\">\"</span></span>\nman 2 <span class=\"pl-k\">select</span></pre></div>\n<p dir=\"auto\">(replace <code class=\"notranslate\">bat</code> with <code class=\"notranslate\">batcat</code> if you are on Debian or Ubuntu)</p>\n<p dir=\"auto\">If you prefer to have this bundled in a new command, you can also use <a href=\"https://github.com/eth-p/bat-extras/blob/master/doc/batman.md\"><code class=\"notranslate\">batman</code></a>.</p>\n<div class=\"markdown-alert markdown-alert-warning\" dir=\"auto\"><p class=\"markdown-alert-title\" dir=\"auto\"><svg class=\"octicon octicon-alert mr-2\" viewBox=\"0 0 16 16\" version=\"1.1\" width=\"16\" height=\"16\" aria-hidden=\"true\"><path d=\"M6.457 1.047c.659-1.234 2.427-1.234 3.086 0l6.082 11.378A1.75 1.75 0 0 1 14.082 15H1.918a1.75 1.75 0 0 1-1.543-2.575Zm1.763.707a.25.25 0 0 0-.44 0L1.698 13.132a.25.25 0 0 0 .22.368h12.164a.25.25 0 0 0 .22-.368Zm.53 3.996v2.5a.75.75 0 0 1-1.5 0v-2.5a.75.75 0 0 1 1.5 0ZM9 11a1 1 0 1 1-2 0 1 1 0 0 1 2 0Z\"></path></svg>Warning</p><p dir=\"auto\">This will <a href=\"https://github.com/sharkdp/bat/issues/1145\" data-hovercard-type=\"issue\" data-hovercard-url=\"/sharkdp/bat/issues/1145/hovercard\">not work</a> out of the box with Mandoc's <code class=\"notranslate\">man</code> implementation.</p>\n<p dir=\"auto\">Please either use <code class=\"notranslate\">batman</code>, or convert the shell script to a <a href=\"https://en.wikipedia.org/wiki/Shebang_(Unix)\" rel=\"nofollow\">shebang executable</a> and point <code class=\"notranslate\">MANPAGER</code> to that.</p>\n</div>\n<p dir=\"auto\">Note that the <a href=\"assets/syntaxes/02_Extra/Manpage.sublime-syntax\">Manpage syntax</a> is developed in this repository and still needs some work.</p>\n<h4 dir=\"auto\"><code class=\"notranslate\">prettier</code> / <code class=\"notranslate\">shfmt</code> / <code class=\"notranslate\">rustfmt</code></h4>\n<p dir=\"auto\">The <a href=\"https://github.com/eth-p/bat-extras/blob/master/doc/prettybat.md\"><code class=\"notranslate\">prettybat</code></a> script is a wrapper that will format code and print it with <code class=\"notranslate\">bat</code>.</p>\n<h4 dir=\"auto\"><code class=\"notranslate\">Warp</code></h4>\n<a href=\"https://app.warp.dev/drive/folder/-Bat-Warp-Pack-lxhe7HrEwgwpG17mvrFSz1\" rel=\"nofollow\">\n  <img src=\"doc/sponsors/warp-pack-header.png\" alt=\"Warp\" style=\"max-width: 100%;\">\n</a>\n<h4 dir=\"auto\">Highlighting <code class=\"notranslate\">--help</code> messages</h4>\n<p dir=\"auto\">You can use <code class=\"notranslate\">bat</code> to colorize help text: <code class=\"notranslate\">$ cp --help | bat -plhelp</code></p>\n<p dir=\"auto\">You can also use a wrapper around this:</p>\n<div class=\"highlight highlight-source-shell notranslate position-relative overflow-auto\" dir=\"auto\" data-snippet-clipboard-copy-content=\"# in your .bashrc/.zshrc/*rc\nalias bathelp='bat --plain --language=help'\nhelp() {\n    &quot;$@&quot; --help 2&gt;&amp;1 | bathelp\n}\"><pre class=\"notranslate\"><span class=\"pl-c\"><span class=\"pl-c\">#</span> in your .bashrc/.zshrc/*rc</span>\n<span class=\"pl-c1\">alias</span> bathelp=<span class=\"pl-s\"><span class=\"pl-pds\">'</span>bat --plain --language=help<span class=\"pl-pds\">'</span></span>\n<span class=\"pl-en\">help</span>() {\n    <span class=\"pl-s\"><span class=\"pl-pds\">\"</span><span class=\"pl-smi\">$@</span><span class=\"pl-pds\">\"</span></span> --help <span class=\"pl-k\">2&gt;&amp;1</span> <span class=\"pl-k\">|</span> bathelp\n}</pre></div>\n<p dir=\"auto\">Then you can do <code class=\"notranslate\">$ help cp</code> or <code class=\"notranslate\">$ help git commit</code>.</p>\n<p dir=\"auto\">When you are using <code class=\"notranslate\">zsh</code>, you can also use global aliases to override <code class=\"notranslate\">-h</code> and <code class=\"notranslate\">--help</code> entirely:</p>\n<div class=\"highlight highlight-source-shell notranslate position-relative overflow-auto\" dir=\"auto\" data-snippet-clipboard-copy-content=\"alias -g -- -h='-h 2&gt;&amp;1 | bat --language=help --style=plain'\nalias -g -- --help='--help 2&gt;&amp;1 | bat --language=help --style=plain'\"><pre class=\"notranslate\"><span class=\"pl-c1\">alias</span> -g -- -h=<span class=\"pl-s\"><span class=\"pl-pds\">'</span>-h 2&gt;&amp;1 | bat --language=help --style=plain<span class=\"pl-pds\">'</span></span>\n<span class=\"pl-c1\">alias</span> -g -- --help=<span class=\"pl-s\"><span class=\"pl-pds\">'</span>--help 2&gt;&amp;1 | bat --language=help --style=plain<span class=\"pl-pds\">'</span></span></pre></div>\n<p dir=\"auto\">For <code class=\"notranslate\">fish</code>, you can use abbreviations:</p>\n<div class=\"highlight highlight-source-fish notranslate position-relative overflow-auto\" dir=\"auto\" data-snippet-clipboard-copy-content=\"abbr -a --position anywhere -- --help '--help | bat -plhelp'\nabbr -a --position anywhere -- -h '-h | bat -plhelp'\"><pre class=\"notranslate\">abbr <span class=\"pl-s\">-a</span> <span class=\"pl-s\">--position</span> anywhere -- <span class=\"pl-s\">--help</span> <span class=\"pl-s\"><span class=\"pl-pds\">'</span>--help | bat -plhelp<span class=\"pl-pds\">'</span></span>\nabbr <span class=\"pl-s\">-a</span> <span class=\"pl-s\">--position</span> anywhere -- <span class=\"pl-s\">-h</span> <span class=\"pl-s\"><span class=\"pl-pds\">'</span>-h | bat -plhelp<span class=\"pl-pds\">'</span></span></pre></div>\n<p dir=\"auto\">This way, you can keep on using <code class=\"notranslate\">cp --help</code>, but get colorized help pages.</p>\n<p dir=\"auto\">Be aware that in some cases, <code class=\"notranslate\">-h</code> may not be a shorthand of <code class=\"notranslate\">--help</code> (for example with <code class=\"notranslate\">ls</code>).</p>\n<p dir=\"auto\">Please report any issues with the help syntax in <a href=\"https://github.com/victor-gp/cmd-help-sublime-syntax\">this repository</a>.</p>\n<h2 dir=\"auto\">Installation</h2>\n<p dir=\"auto\"><a href=\"https://repology.org/project/bat-cat/versions\" rel=\"nofollow\"><img src=\"https://camo.githubusercontent.com/19d2a0fe2f4f0e6954905e2ed2183b4dc37e4f9ea1702920ed05ef68a1cb4a06/68747470733a2f2f7265706f6c6f67792e6f72672f62616467652f766572746963616c2d616c6c7265706f732f6261742d6361742e7376673f636f6c756d6e733d33266578636c7564655f756e737570706f727465643d31\" alt=\"Packaging status\" data-canonical-src=\"https://repology.org/badge/vertical-allrepos/bat-cat.svg?columns=3&amp;exclude_unsupported=1\" style=\"max-width: 100%;\"></a></p>\n<h3 dir=\"auto\">On Ubuntu (using <code class=\"notranslate\">apt</code>)</h3>\n<p dir=\"auto\"><em>... and other Debian-based Linux distributions.</em></p>\n<p dir=\"auto\"><code class=\"notranslate\">bat</code> is available on <a href=\"https://packages.ubuntu.com/search?keywords=bat&amp;exact=1\" rel=\"nofollow\">Ubuntu since 20.04 (\"Focal\")</a> and <a href=\"https://packages.debian.org/bullseye/bat\" rel=\"nofollow\">Debian since August 2021 (Debian 11 - \"Bullseye\")</a>.</p>\n<p dir=\"auto\">If your Ubuntu/Debian installation is new enough you can simply run:</p>\n<div class=\"highlight highlight-source-shell notranslate position-relative overflow-auto\" dir=\"auto\" data-snippet-clipboard-copy-content=\"sudo apt install bat\"><pre class=\"notranslate\">sudo apt install bat</pre></div>\n<p dir=\"auto\"><strong>Important</strong>: If you install <code class=\"notranslate\">bat</code> this way, please note that the executable may be installed as <code class=\"notranslate\">batcat</code> instead of <code class=\"notranslate\">bat</code> (due to <a href=\"https://github.com/sharkdp/bat/issues/982\" data-hovercard-type=\"issue\" data-hovercard-url=\"/sharkdp/bat/issues/982/hovercard\">a name<br>\nclash with another package</a>). You can set up a <code class=\"notranslate\">bat -&gt; batcat</code> symlink or alias to prevent any issues that may come up because of this and to be consistent with other distributions:</p>\n<div class=\"highlight highlight-source-shell notranslate position-relative overflow-auto\" dir=\"auto\" data-snippet-clipboard-copy-content=\"mkdir -p ~/.local/bin\nln -s /usr/bin/batcat ~/.local/bin/bat\"><pre class=\"notranslate\">mkdir -p <span class=\"pl-k\">~</span>/.local/bin\nln -s /usr/bin/batcat <span class=\"pl-k\">~</span>/.local/bin/bat</pre></div>\n<h3 dir=\"auto\">On Ubuntu (using most recent <code class=\"notranslate\">.deb</code> packages)</h3>\n<p dir=\"auto\"><em>... and other Debian-based Linux distributions.</em></p>\n<p dir=\"auto\">If the package has not yet been promoted to your Ubuntu/Debian installation, or you want<br>\nthe most recent release of <code class=\"notranslate\">bat</code>, download the latest <code class=\"notranslate\">.deb</code> package from the<br>\n<a href=\"https://github.com/sharkdp/bat/releases\">release page</a> and install it via:</p>\n<div class=\"highlight highlight-source-shell notranslate position-relative overflow-auto\" dir=\"auto\" data-snippet-clipboard-copy-content=\"sudo dpkg -i bat_0.18.3_amd64.deb  # adapt version number and architecture\"><pre class=\"notranslate\">sudo dpkg -i bat_0.18.3_amd64.deb  <span class=\"pl-c\"><span class=\"pl-c\">#</span> adapt version number and architecture</span></pre></div>\n<h3 dir=\"auto\">On Alpine Linux</h3>\n<p dir=\"auto\">You can install <a href=\"https://pkgs.alpinelinux.org/packages?name=bat\" rel=\"nofollow\">the <code class=\"notranslate\">bat</code> package</a><br>\nfrom the official sources, provided you have the appropriate repository enabled:</p>\n<div class=\"highlight highlight-source-shell notranslate position-relative overflow-auto\" dir=\"auto\" data-snippet-clipboard-copy-content=\"apk add bat\"><pre class=\"notranslate\">apk add bat</pre></div>\n<h3 dir=\"auto\">On Arch Linux</h3>\n<p dir=\"auto\">You can install <a href=\"https://www.archlinux.org/packages/extra/x86_64/bat/\" rel=\"nofollow\">the <code class=\"notranslate\">bat</code> package</a><br>\nfrom the official sources:</p>\n<div class=\"highlight highlight-source-shell notranslate position-relative overflow-auto\" dir=\"auto\" data-snippet-clipboard-copy-content=\"pacman -S bat\"><pre class=\"notranslate\">pacman -S bat</pre></div>\n<h3 dir=\"auto\">On Fedora</h3>\n<p dir=\"auto\">You can install <a href=\"https://koji.fedoraproject.org/koji/packageinfo?packageID=27506\" rel=\"nofollow\">the <code class=\"notranslate\">bat</code> package</a> from the official <a href=\"https://docs.fedoraproject.org/en-US/modularity/using-modules/\" rel=\"nofollow\">Fedora Modular</a> repository.</p>\n<div class=\"highlight highlight-source-shell notranslate position-relative overflow-auto\" dir=\"auto\" data-snippet-clipboard-copy-content=\"dnf install bat\"><pre class=\"notranslate\">dnf install bat</pre></div>\n<h3 dir=\"auto\">On Funtoo Linux</h3>\n<p dir=\"auto\">You can install <a href=\"https://github.com/funtoo/dev-kit/tree/1.4-release/sys-apps/bat\">the <code class=\"notranslate\">bat</code> package</a> from dev-kit.</p>\n<div class=\"highlight highlight-source-shell notranslate position-relative overflow-auto\" dir=\"auto\" data-snippet-clipboard-copy-content=\"emerge sys-apps/bat\"><pre class=\"notranslate\">emerge sys-apps/bat</pre></div>\n<h3 dir=\"auto\">On Gentoo Linux</h3>\n<p dir=\"auto\">You can install <a href=\"https://packages.gentoo.org/packages/sys-apps/bat\" rel=\"nofollow\">the <code class=\"notranslate\">bat</code> package</a><br>\nfrom the official sources:</p>\n<div class=\"highlight highlight-source-shell notranslate position-relative overflow-auto\" dir=\"auto\" data-snippet-clipboard-copy-content=\"emerge sys-apps/bat\"><pre class=\"notranslate\">emerge sys-apps/bat</pre></div>\n<h3 dir=\"auto\">On Void Linux</h3>\n<p dir=\"auto\">You can install <code class=\"notranslate\">bat</code> via xbps-install:</p>\n<div class=\"highlight highlight-source-shell notranslate position-relative overflow-auto\" dir=\"auto\" data-snippet-clipboard-copy-content=\"xbps-install -S bat\"><pre class=\"notranslate\">xbps-install -S bat</pre></div>\n<h3 dir=\"auto\">On Termux</h3>\n<p dir=\"auto\">You can install <code class=\"notranslate\">bat</code> via pkg:</p>\n<div class=\"highlight highlight-source-shell notranslate position-relative overflow-auto\" dir=\"auto\" data-snippet-clipboard-copy-content=\"pkg install bat\"><pre class=\"notranslate\">pkg install bat</pre></div>\n<h3 dir=\"auto\">On FreeBSD</h3>\n<p dir=\"auto\">You can install a precompiled <a href=\"https://www.freshports.org/textproc/bat\" rel=\"nofollow\"><code class=\"notranslate\">bat</code> package</a> with pkg:</p>\n<div class=\"highlight highlight-source-shell notranslate position-relative overflow-auto\" dir=\"auto\" data-snippet-clipboard-copy-content=\"pkg install bat\"><pre class=\"notranslate\">pkg install bat</pre></div>\n<p dir=\"auto\">or build it on your own from the FreeBSD ports:</p>\n<div class=\"highlight highlight-source-shell notranslate position-relative overflow-auto\" dir=\"auto\" data-snippet-clipboard-copy-content=\"cd /usr/ports/textproc/bat\nmake install\"><pre class=\"notranslate\"><span class=\"pl-c1\">cd</span> /usr/ports/textproc/bat\nmake install</pre></div>\n<h3 dir=\"auto\">On OpenBSD</h3>\n<p dir=\"auto\">You can install <code class=\"notranslate\">bat</code> package using <a href=\"https://man.openbsd.org/pkg_add.1\" rel=\"nofollow\"><code class=\"notranslate\">pkg_add(1)</code></a>:</p>\n<div class=\"highlight highlight-source-shell notranslate position-relative overflow-auto\" dir=\"auto\" data-snippet-clipboard-copy-content=\"pkg_add bat\"><pre class=\"notranslate\">pkg_add bat</pre></div>\n<h3 dir=\"auto\">Via nix</h3>\n<p dir=\"auto\">You can install <code class=\"notranslate\">bat</code> using the <a href=\"https://nixos.org/nix\" rel=\"nofollow\">nix package manager</a>:</p>\n<div class=\"highlight highlight-source-shell notranslate position-relative overflow-auto\" dir=\"auto\" data-snippet-clipboard-copy-content=\"nix-env -i bat\"><pre class=\"notranslate\">nix-env -i bat</pre></div>\n<h3 dir=\"auto\">Via flox</h3>\n<p dir=\"auto\">You can install <code class=\"notranslate\">bat</code> using <a href=\"https://flox.dev\" rel=\"nofollow\">Flox</a></p>\n<div class=\"highlight highlight-source-shell notranslate position-relative overflow-auto\" dir=\"auto\" data-snippet-clipboard-copy-content=\"flox install bat\"><pre class=\"notranslate\">flox install bat</pre></div>\n<h3 dir=\"auto\">On openSUSE</h3>\n<p dir=\"auto\">You can install <code class=\"notranslate\">bat</code> with zypper:</p>\n<div class=\"highlight highlight-source-shell notranslate position-relative overflow-auto\" dir=\"auto\" data-snippet-clipboard-copy-content=\"zypper install bat\"><pre class=\"notranslate\">zypper install bat</pre></div>\n<h3 dir=\"auto\">Via snap package</h3>\n<p dir=\"auto\">There is currently no recommended snap package available.<br>\nExisting packages may be available, but are not officially supported and may contain <a href=\"https://github.com/sharkdp/bat/issues/1519\" data-hovercard-type=\"issue\" data-hovercard-url=\"/sharkdp/bat/issues/1519/hovercard\">issues</a>.</p>\n<h3 dir=\"auto\">On macOS (or Linux) via Homebrew</h3>\n<p dir=\"auto\">You can install <code class=\"notranslate\">bat</code> with <a href=\"https://formulae.brew.sh/formula/bat\" rel=\"nofollow\">Homebrew</a>:</p>\n<div class=\"highlight highlight-source-shell notranslate position-relative overflow-auto\" dir=\"auto\" data-snippet-clipboard-copy-content=\"brew install bat\"><pre class=\"notranslate\">brew install bat</pre></div>\n<h3 dir=\"auto\">On macOS via MacPorts</h3>\n<p dir=\"auto\">Or install <code class=\"notranslate\">bat</code> with <a href=\"https://ports.macports.org/port/bat/summary\" rel=\"nofollow\">MacPorts</a>:</p>\n<div class=\"highlight highlight-source-shell notranslate position-relative overflow-auto\" dir=\"auto\" data-snippet-clipboard-copy-content=\"port install bat\"><pre class=\"notranslate\">port install bat</pre></div>\n<h3 dir=\"auto\">On Windows</h3>\n<p dir=\"auto\">There are a few options to install <code class=\"notranslate\">bat</code> on Windows. Once you have installed <code class=\"notranslate\">bat</code>,<br>\ntake a look at the <a href=\"#using-bat-on-windows\">\"Using <code class=\"notranslate\">bat</code> on Windows\"</a> section.</p>\n<h4 dir=\"auto\">Prerequisites</h4>\n<p dir=\"auto\">You will need to install the <a href=\"https://learn.microsoft.com/en-us/cpp/windows/latest-supported-vc-redist#latest-microsoft-visual-c-redistributable-version\" rel=\"nofollow\">Visual C++ Redistributable</a></p>\n<h4 dir=\"auto\">With WinGet</h4>\n<p dir=\"auto\">You can install <code class=\"notranslate\">bat</code> via <a href=\"https://learn.microsoft.com/en-us/windows/package-manager/winget\" rel=\"nofollow\">WinGet</a>:</p>\n<div class=\"highlight highlight-source-shell notranslate position-relative overflow-auto\" dir=\"auto\" data-snippet-clipboard-copy-content=\"winget install sharkdp.bat\"><pre class=\"notranslate\">winget install sharkdp.bat</pre></div>\n<h4 dir=\"auto\">With Chocolatey</h4>\n<p dir=\"auto\">You can install <code class=\"notranslate\">bat</code> via <a href=\"https://chocolatey.org/packages/Bat\" rel=\"nofollow\">Chocolatey</a>:</p>\n<div class=\"highlight highlight-source-shell notranslate position-relative overflow-auto\" dir=\"auto\" data-snippet-clipboard-copy-content=\"choco install bat\"><pre class=\"notranslate\">choco install bat</pre></div>\n<h4 dir=\"auto\">With Scoop</h4>\n<p dir=\"auto\">You can install <code class=\"notranslate\">bat</code> via <a href=\"https://scoop.sh/\" rel=\"nofollow\">scoop</a>:</p>\n<div class=\"highlight highlight-source-shell notranslate position-relative overflow-auto\" dir=\"auto\" data-snippet-clipboard-copy-content=\"scoop install bat\"><pre class=\"notranslate\">scoop install bat</pre></div>\n<h4 dir=\"auto\">From prebuilt binaries:</h4>\n<p dir=\"auto\">You can download prebuilt binaries from the <a href=\"https://github.com/sharkdp/bat/releases\">Release page</a>,</p>\n<p dir=\"auto\">You will need to install the <a href=\"https://support.microsoft.com/en-us/help/2977003/the-latest-supported-visual-c-downloads\" rel=\"nofollow\">Visual C++ Redistributable</a> package.</p>\n<h3 dir=\"auto\">From binaries</h3>\n<p dir=\"auto\">Check out the <a href=\"https://github.com/sharkdp/bat/releases\">Release page</a> for<br>\nprebuilt versions of <code class=\"notranslate\">bat</code> for many different architectures. Statically-linked<br>\nbinaries are also available: look for archives with <code class=\"notranslate\">musl</code> in the file name.</p>\n<h3 dir=\"auto\">From source</h3>\n<p dir=\"auto\">If you want to build <code class=\"notranslate\">bat</code> from source, you need Rust 1.74.0 or<br>\nhigher. You can then use <code class=\"notranslate\">cargo</code> to build everything:</p>\n<h4 dir=\"auto\">From local source</h4>\n<div class=\"highlight highlight-source-shell notranslate position-relative overflow-auto\" dir=\"auto\" data-snippet-clipboard-copy-content=\"cargo install --path . --locked\"><pre class=\"notranslate\">cargo install --path <span class=\"pl-c1\">.</span> --locked</pre></div>\n<div class=\"markdown-alert markdown-alert-note\" dir=\"auto\"><p class=\"markdown-alert-title\" dir=\"auto\"><svg class=\"octicon octicon-info mr-2\" viewBox=\"0 0 16 16\" version=\"1.1\" width=\"16\" height=\"16\" aria-hidden=\"true\"><path d=\"M0 8a8 8 0 1 1 16 0A8 8 0 0 1 0 8Zm8-6.5a6.5 6.5 0 1 0 0 13 6.5 6.5 0 0 0 0-13ZM6.5 7.75A.75.75 0 0 1 7.25 7h1a.75.75 0 0 1 .75.75v2.75h.25a.75.75 0 0 1 0 1.5h-2a.75.75 0 0 1 0-1.5h.25v-2h-.25a.75.75 0 0 1-.75-.75ZM8 6a1 1 0 1 1 0-2 1 1 0 0 1 0 2Z\"></path></svg>Note</p><p dir=\"auto\">The <code class=\"notranslate\">--path .</code> above specifies the directory of the source code and NOT where <code class=\"notranslate\">bat</code> will be installed.<br>\nFor more information see the docs for <a href=\"https://doc.rust-lang.org/cargo/commands/cargo-install.html\" rel=\"nofollow\"><code class=\"notranslate\">cargo install</code></a>.</p>\n</div>\n<h4 dir=\"auto\">From <code class=\"notranslate\">crates.io</code></h4>\n<div class=\"highlight highlight-source-shell notranslate position-relative overflow-auto\" dir=\"auto\" data-snippet-clipboard-copy-content=\"cargo install --locked bat\"><pre class=\"notranslate\">cargo install --locked bat</pre></div>\n<p dir=\"auto\">Note that additional files like the man page or shell completion<br>\nfiles can not be installed automatically in both these ways.<br>\nIf installing from a local source, they will be generated by <code class=\"notranslate\">cargo</code><br>\nand should be available in the cargo target folder under <code class=\"notranslate\">build</code>.</p>\n<p dir=\"auto\">Furthermore, shell completions are also available by running:</p>\n<div class=\"highlight highlight-source-shell notranslate position-relative overflow-auto\" dir=\"auto\" data-snippet-clipboard-copy-content=\"bat --completion &lt;shell&gt;\n# see --help for supported shells\"><pre class=\"notranslate\">bat --completion <span class=\"pl-k\">&lt;</span>shell<span class=\"pl-k\">&gt;</span>\n<span class=\"pl-c\"><span class=\"pl-c\">#</span> see --help for supported shells</span></pre></div>\n<h2 dir=\"auto\">Customization</h2>\n<h3 dir=\"auto\">Highlighting theme</h3>\n<p dir=\"auto\">Use <code class=\"notranslate\">bat --list-themes</code> to get a list of all available themes for syntax<br>\nhighlighting. To select the <code class=\"notranslate\">TwoDark</code> theme, call <code class=\"notranslate\">bat</code> with the<br>\n<code class=\"notranslate\">--theme=TwoDark</code> option or set the <code class=\"notranslate\">BAT_THEME</code> environment variable to<br>\n<code class=\"notranslate\">TwoDark</code>. Use <code class=\"notranslate\">export BAT_THEME=\"TwoDark\"</code> in your shell's startup file to<br>\nmake the change permanent. Alternatively, use <code class=\"notranslate\">bat</code>s<br>\n<a href=\"https://github.com/sharkdp/bat#configuration-file\">configuration file</a>.</p>\n<p dir=\"auto\">If you want to preview the different themes on a custom file, you can use<br>\nthe following command (you need <a href=\"https://github.com/junegunn/fzf\"><code class=\"notranslate\">fzf</code></a> for this):</p>\n<div class=\"highlight highlight-source-shell notranslate position-relative overflow-auto\" dir=\"auto\" data-snippet-clipboard-copy-content=\"bat --list-themes | fzf --preview=&quot;bat --theme={} --color=always /path/to/file&quot;\"><pre class=\"notranslate\">bat --list-themes <span class=\"pl-k\">|</span> fzf --preview=<span class=\"pl-s\"><span class=\"pl-pds\">\"</span>bat --theme={} --color=always /path/to/file<span class=\"pl-pds\">\"</span></span></pre></div>\n<p dir=\"auto\"><code class=\"notranslate\">bat</code> automatically picks a fitting theme depending on your terminal's background color.<br>\nYou can use the <code class=\"notranslate\">--theme-dark</code> / <code class=\"notranslate\">--theme-light</code> options or the <code class=\"notranslate\">BAT_THEME_DARK</code> / <code class=\"notranslate\">BAT_THEME_LIGHT</code> environment variables<br>\nto customize the themes used. This is especially useful if you frequently switch between dark and light mode.</p>\n<p dir=\"auto\">You can also use a custom theme by following the<br>\n<a href=\"https://github.com/sharkdp/bat#adding-new-themes\">'Adding new themes' section below</a>.</p>\n<h3 dir=\"auto\">8-bit themes</h3>\n<p dir=\"auto\"><code class=\"notranslate\">bat</code> has three themes that always use <a href=\"https://en.wikipedia.org/wiki/ANSI_escape_code#Colors\" rel=\"nofollow\">8-bit colors</a>,<br>\neven when truecolor support is available:</p>\n<ul dir=\"auto\">\n<li><code class=\"notranslate\">ansi</code> looks decent on any terminal. It uses 3-bit colors: black, red, green,<br>\nyellow, blue, magenta, cyan, and white.</li>\n<li><code class=\"notranslate\">base16</code> is designed for <a href=\"https://github.com/tinted-theming/home\">base16</a> terminal themes. It uses<br>\n4-bit colors (3-bit colors plus bright variants) in accordance with the<br>\n<a href=\"https://github.com/tinted-theming/home/blob/main/styling.md\">base16 styling guidelines</a>.</li>\n<li><code class=\"notranslate\">base16-256</code> is designed for <a href=\"https://github.com/tinted-theming/tinted-shell\">tinted-shell</a>.<br>\nIt replaces certain bright colors with 8-bit colors from 16 to 21. <strong>Do not</strong> use this simply<br>\nbecause you have a 256-color terminal but are not using tinted-shell.</li>\n</ul>\n<p dir=\"auto\">Although these themes are more restricted, they have three advantages over truecolor themes. They:</p>\n<ul dir=\"auto\">\n<li>Enjoy maximum compatibility. Some terminal utilities do not support more than 3-bit colors.</li>\n<li>Adapt to terminal theme changes. Even for already printed output.</li>\n<li>Visually harmonize better with other terminal software.</li>\n</ul>\n<h3 dir=\"auto\">Output style</h3>\n<p dir=\"auto\">You can use the <code class=\"notranslate\">--style</code> option to control the appearance of <code class=\"notranslate\">bat</code>s output.<br>\nYou can use <code class=\"notranslate\">--style=numbers,changes</code>, for example, to show only Git changes<br>\nand line numbers but no grid and no file header. Set the <code class=\"notranslate\">BAT_STYLE</code> environment<br>\nvariable to make these changes permanent or use <code class=\"notranslate\">bat</code>s<br>\n<a href=\"https://github.com/sharkdp/bat#configuration-file\">configuration file</a>.</p>\n<div class=\"markdown-alert markdown-alert-tip\" dir=\"auto\"><p class=\"markdown-alert-title\" dir=\"auto\"><svg class=\"octicon octicon-light-bulb mr-2\" viewBox=\"0 0 16 16\" version=\"1.1\" width=\"16\" height=\"16\" aria-hidden=\"true\"><path d=\"M8 1.5c-2.363 0-4 1.69-4 3.75 0 .984.424 1.625.984 2.304l.214.253c.223.264.47.556.673.848.284.411.537.896.621 1.49a.75.75 0 0 1-1.484.211c-.04-.282-.163-.547-.37-.847a8.456 8.456 0 0 0-.542-.68c-.084-.1-.173-.205-.268-.32C3.201 7.75 2.5 6.766 2.5 5.25 2.5 2.31 4.863 0 8 0s5.5 2.31 5.5 5.25c0 1.516-.701 2.5-1.328 3.259-.095.115-.184.22-.268.319-.207.245-.383.453-.541.681-.208.3-.33.565-.37.847a.751.751 0 0 1-1.485-.212c.084-.593.337-1.078.621-1.489.203-.292.45-.584.673-.848.075-.088.147-.173.213-.253.561-.679.985-1.32.985-2.304 0-2.06-1.637-3.75-4-3.75ZM5.75 12h4.5a.75.75 0 0 1 0 1.5h-4.5a.75.75 0 0 1 0-1.5ZM6 15.25a.75.75 0 0 1 .75-.75h2.5a.75.75 0 0 1 0 1.5h-2.5a.75.75 0 0 1-.75-.75Z\"></path></svg>Tip</p><p dir=\"auto\">If you specify a default style in <code class=\"notranslate\">bat</code>'s config file, you can change which components<br>\nare displayed during a single run of <code class=\"notranslate\">bat</code> using the <code class=\"notranslate\">--style</code> command-line argument.<br>\nBy prefixing a component with <code class=\"notranslate\">+</code> or <code class=\"notranslate\">-</code>, it can be added or removed from the current style.</p>\n<p dir=\"auto\">For example, if your config contains <code class=\"notranslate\">--style=full,-snip</code>, you can run bat with<br>\n<code class=\"notranslate\">--style=-grid,+snip</code> to remove the grid and add back the <code class=\"notranslate\">snip</code> component.<br>\nOr, if you want to override the styles completely, you use <code class=\"notranslate\">--style=numbers</code> to<br>\nonly show the line numbers.</p>\n</div>\n<h3 dir=\"auto\">Adding new syntaxes / language definitions</h3>\n<p dir=\"auto\">Should you find that a particular syntax is not available within <code class=\"notranslate\">bat</code>, you can follow these<br>\ninstructions to easily add new syntaxes to your current <code class=\"notranslate\">bat</code> installation.</p>\n<p dir=\"auto\"><code class=\"notranslate\">bat</code> uses the excellent <a href=\"https://github.com/trishume/syntect/\"><code class=\"notranslate\">syntect</code></a><br>\nlibrary for syntax highlighting. <code class=\"notranslate\">syntect</code> can read any<br>\n<a href=\"https://www.sublimetext.com/docs/3/syntax.html\" rel=\"nofollow\">Sublime Text <code class=\"notranslate\">.sublime-syntax</code> file</a><br>\nand theme.</p>\n<p dir=\"auto\">A good resource for finding Sublime Syntax packages is <a href=\"https://packagecontrol.io/\" rel=\"nofollow\">Package Control</a>. Once you found a<br>\nsyntax:</p>\n<ol dir=\"auto\">\n<li>\n<p dir=\"auto\">Create a folder with syntax definition files:</p>\n<div class=\"highlight highlight-source-shell notranslate position-relative overflow-auto\" dir=\"auto\" data-snippet-clipboard-copy-content=\"mkdir -p &quot;$(bat --config-dir)/syntaxes&quot;\ncd &quot;$(bat --config-dir)/syntaxes&quot;\n\n# Put new '.sublime-syntax' language definition files\n# in this folder (or its subdirectories), for example:\ngit clone https://github.com/tellnobody1/sublime-purescript-syntax\"><pre class=\"notranslate\">mkdir -p <span class=\"pl-s\"><span class=\"pl-pds\">\"</span><span class=\"pl-s\"><span class=\"pl-pds\">$(</span>bat --config-dir<span class=\"pl-pds\">)</span></span>/syntaxes<span class=\"pl-pds\">\"</span></span>\n<span class=\"pl-c1\">cd</span> <span class=\"pl-s\"><span class=\"pl-pds\">\"</span><span class=\"pl-s\"><span class=\"pl-pds\">$(</span>bat --config-dir<span class=\"pl-pds\">)</span></span>/syntaxes<span class=\"pl-pds\">\"</span></span>\n\n<span class=\"pl-c\"><span class=\"pl-c\">#</span> Put new '.sublime-syntax' language definition files</span>\n<span class=\"pl-c\"><span class=\"pl-c\">#</span> in this folder (or its subdirectories), for example:</span>\ngit clone https://github.com/tellnobody1/sublime-purescript-syntax</pre></div>\n</li>\n<li>\n<p dir=\"auto\">Now use the following command to parse these files into a binary cache:</p>\n<div class=\"highlight highlight-source-shell notranslate position-relative overflow-auto\" dir=\"auto\" data-snippet-clipboard-copy-content=\"bat cache --build\"><pre class=\"notranslate\">bat cache --build</pre></div>\n</li>\n<li>\n<p dir=\"auto\">Finally, use <code class=\"notranslate\">bat --list-languages</code> to check if the new languages are available.</p>\n<p dir=\"auto\">If you ever want to go back to the default settings, call:</p>\n<div class=\"highlight highlight-source-shell notranslate position-relative overflow-auto\" dir=\"auto\" data-snippet-clipboard-copy-content=\"bat cache --clear\"><pre class=\"notranslate\">bat cache --clear</pre></div>\n</li>\n<li>\n<p dir=\"auto\">If you think that a specific syntax should be included in <code class=\"notranslate\">bat</code> by default, please<br>\nconsider opening a \"syntax request\" ticket after reading the policies and<br>\ninstructions <a href=\"doc/assets.md\">here</a>: <a href=\"https://github.com/sharkdp/bat/issues/new?labels=syntax-request&amp;template=syntax_request.md\">Open Syntax Request</a>.</p>\n</li>\n</ol>\n<h3 dir=\"auto\">Adding new themes</h3>\n<p dir=\"auto\">This works very similar to how we add new syntax definitions.</p>\n<p dir=\"auto\">First, create a folder with the new syntax highlighting themes:</p>\n<div class=\"highlight highlight-source-shell notranslate position-relative overflow-auto\" dir=\"auto\" data-snippet-clipboard-copy-content=\"mkdir -p &quot;$(bat --config-dir)/themes&quot;\ncd &quot;$(bat --config-dir)/themes&quot;\n\n# Download a theme in '.tmTheme' format, for example:\ngit clone https://github.com/greggb/sublime-snazzy\n\n# Update the binary cache\nbat cache --build\"><pre class=\"notranslate\">mkdir -p <span class=\"pl-s\"><span class=\"pl-pds\">\"</span><span class=\"pl-s\"><span class=\"pl-pds\">$(</span>bat --config-dir<span class=\"pl-pds\">)</span></span>/themes<span class=\"pl-pds\">\"</span></span>\n<span class=\"pl-c1\">cd</span> <span class=\"pl-s\"><span class=\"pl-pds\">\"</span><span class=\"pl-s\"><span class=\"pl-pds\">$(</span>bat --config-dir<span class=\"pl-pds\">)</span></span>/themes<span class=\"pl-pds\">\"</span></span>\n\n<span class=\"pl-c\"><span class=\"pl-c\">#</span> Download a theme in '.tmTheme' format, for example:</span>\ngit clone https://github.com/greggb/sublime-snazzy\n\n<span class=\"pl-c\"><span class=\"pl-c\">#</span> Update the binary cache</span>\nbat cache --build</pre></div>\n<p dir=\"auto\">Finally, use <code class=\"notranslate\">bat --list-themes</code> to check if the new themes are available.</p>\n<h3 dir=\"auto\">Adding or changing file type associations</h3>\n<p dir=\"auto\">You can add new (or change existing) file name patterns using the <code class=\"notranslate\">--map-syntax</code><br>\ncommand line option. The option takes an argument of the form <code class=\"notranslate\">pattern:syntax</code> where<br>\n<code class=\"notranslate\">pattern</code> is a glob pattern that is matched against the file name and<br>\nthe absolute file path. The <code class=\"notranslate\">syntax</code> part is the full name of a supported language<br>\n(use <code class=\"notranslate\">bat --list-languages</code> for an overview).</p>\n<p dir=\"auto\"><strong>Note:</strong> You probably want to use this option as <a href=\"#configuration-file\">an entry in <code class=\"notranslate\">bat</code>'s configuration file</a><br>\nfor persistence instead of passing it on the command line as a one-off. Generally<br>\nyou'd just use <code class=\"notranslate\">-l</code> if you want to manually specify a language for a file.</p>\n<p dir=\"auto\">Example: To use \"INI\" syntax highlighting for all files with a <code class=\"notranslate\">.conf</code> file extension, use</p>\n<div class=\"highlight highlight-source-shell notranslate position-relative overflow-auto\" dir=\"auto\" data-snippet-clipboard-copy-content=\"--map-syntax='*.conf:INI'\"><pre class=\"notranslate\">--map-syntax=<span class=\"pl-s\"><span class=\"pl-pds\">'</span>*.conf:INI<span class=\"pl-pds\">'</span></span></pre></div>\n<p dir=\"auto\">Example: To open all files called <code class=\"notranslate\">.ignore</code> (exact match) with the \"Git Ignore\" syntax, use:</p>\n<div class=\"highlight highlight-source-shell notranslate position-relative overflow-auto\" dir=\"auto\" data-snippet-clipboard-copy-content=\"--map-syntax='.ignore:Git Ignore'\"><pre class=\"notranslate\">--map-syntax=<span class=\"pl-s\"><span class=\"pl-pds\">'</span>.ignore:Git Ignore<span class=\"pl-pds\">'</span></span></pre></div>\n<p dir=\"auto\">Example: To open all <code class=\"notranslate\">.conf</code> files in subfolders of <code class=\"notranslate\">/etc/apache2</code> with the \"Apache Conf\"<br>\nsyntax, use (this mapping is already built in):</p>\n<div class=\"highlight highlight-source-shell notranslate position-relative overflow-auto\" dir=\"auto\" data-snippet-clipboard-copy-content=\"--map-syntax='/etc/apache2/**/*.conf:Apache Conf'\"><pre class=\"notranslate\">--map-syntax=<span class=\"pl-s\"><span class=\"pl-pds\">'</span>/etc/apache2/**/*.conf:Apache Conf<span class=\"pl-pds\">'</span></span></pre></div>\n<h3 dir=\"auto\">Using a different pager</h3>\n<p dir=\"auto\"><code class=\"notranslate\">bat</code> uses the pager that is specified in the <code class=\"notranslate\">PAGER</code> environment variable. If this variable is not<br>\nset, <code class=\"notranslate\">less</code> is used by default. If you want to use a different pager, you can either modify the<br>\n<code class=\"notranslate\">PAGER</code> variable or set the <code class=\"notranslate\">BAT_PAGER</code> environment variable to override what is specified in<br>\n<code class=\"notranslate\">PAGER</code>.</p>\n<div class=\"markdown-alert markdown-alert-note\" dir=\"auto\"><p class=\"markdown-alert-title\" dir=\"auto\"><svg class=\"octicon octicon-info mr-2\" viewBox=\"0 0 16 16\" version=\"1.1\" width=\"16\" height=\"16\" aria-hidden=\"true\"><path d=\"M0 8a8 8 0 1 1 16 0A8 8 0 0 1 0 8Zm8-6.5a6.5 6.5 0 1 0 0 13 6.5 6.5 0 0 0 0-13ZM6.5 7.75A.75.75 0 0 1 7.25 7h1a.75.75 0 0 1 .75.75v2.75h.25a.75.75 0 0 1 0 1.5h-2a.75.75 0 0 1 0-1.5h.25v-2h-.25a.75.75 0 0 1-.75-.75ZM8 6a1 1 0 1 1 0-2 1 1 0 0 1 0 2Z\"></path></svg>Note</p><p dir=\"auto\">If <code class=\"notranslate\">PAGER</code> is <code class=\"notranslate\">more</code> or <code class=\"notranslate\">most</code>, <code class=\"notranslate\">bat</code> will silently use <code class=\"notranslate\">less</code> instead to ensure support for colors.</p>\n</div>\n<p dir=\"auto\">If you want to pass command-line arguments to the pager, you can also set them via the<br>\n<code class=\"notranslate\">PAGER</code>/<code class=\"notranslate\">BAT_PAGER</code> variables:</p>\n<div class=\"highlight highlight-source-shell notranslate position-relative overflow-auto\" dir=\"auto\" data-snippet-clipboard-copy-content=\"export BAT_PAGER=&quot;less -RF&quot;\"><pre class=\"notranslate\"><span class=\"pl-k\">export</span> BAT_PAGER=<span class=\"pl-s\"><span class=\"pl-pds\">\"</span>less -RF<span class=\"pl-pds\">\"</span></span></pre></div>\n<p dir=\"auto\">Instead of using environment variables, you can also use <code class=\"notranslate\">bat</code>s <a href=\"https://github.com/sharkdp/bat#configuration-file\">configuration file</a> to configure the pager (<code class=\"notranslate\">--pager</code> option).</p>\n<h3 dir=\"auto\">Using <code class=\"notranslate\">less</code> as a pager</h3>\n<p dir=\"auto\">When using <code class=\"notranslate\">less</code> as a pager, <code class=\"notranslate\">bat</code> will automatically pass extra options along to <code class=\"notranslate\">less</code><br>\nto improve the experience. Specifically, <code class=\"notranslate\">-R</code>/<code class=\"notranslate\">--RAW-CONTROL-CHARS</code>, <code class=\"notranslate\">-F</code>/<code class=\"notranslate\">--quit-if-one-screen</code>,<br>\nand under certain conditions, <code class=\"notranslate\">-X</code>/<code class=\"notranslate\">--no-init</code> and/or <code class=\"notranslate\">-S</code>/<code class=\"notranslate\">--chop-long-lines</code>.</p>\n<div class=\"markdown-alert markdown-alert-important\" dir=\"auto\"><p class=\"markdown-alert-title\" dir=\"auto\"><svg class=\"octicon octicon-report mr-2\" viewBox=\"0 0 16 16\" version=\"1.1\" width=\"16\" height=\"16\" aria-hidden=\"true\"><path d=\"M0 1.75C0 .784.784 0 1.75 0h12.5C15.216 0 16 .784 16 1.75v9.5A1.75 1.75 0 0 1 14.25 13H8.06l-2.573 2.573A1.458 1.458 0 0 1 3 14.543V13H1.75A1.75 1.75 0 0 1 0 11.25Zm1.75-.25a.25.25 0 0 0-.25.25v9.5c0 .138.112.25.25.25h2a.75.75 0 0 1 .75.75v2.19l2.72-2.72a.749.749 0 0 1 .53-.22h6.5a.25.25 0 0 0 .25-.25v-9.5a.25.25 0 0 0-.25-.25Zm7 2.25v2.5a.75.75 0 0 1-1.5 0v-2.5a.75.75 0 0 1 1.5 0ZM9 9a1 1 0 1 1-2 0 1 1 0 0 1 2 0Z\"></path></svg>Important</p><p dir=\"auto\">These options will not be added if:</p>\n<ul dir=\"auto\">\n<li>The pager is not named <code class=\"notranslate\">less</code>.</li>\n<li>The <code class=\"notranslate\">--pager</code> argument contains any command-line arguments (e.g. <code class=\"notranslate\">--pager=\"less -R\"</code>).</li>\n<li>The <code class=\"notranslate\">BAT_PAGER</code> environment variable contains any command-line arguments (e.g. <code class=\"notranslate\">export BAT_PAGER=\"less -R\"</code>)</li>\n</ul>\n<p dir=\"auto\">The <code class=\"notranslate\">--quit-if-one-screen</code> option will not be added when:</p>\n<ul dir=\"auto\">\n<li>The <code class=\"notranslate\">--paging=always</code> argument is used.</li>\n<li>The <code class=\"notranslate\">BAT_PAGING</code> environment is set to <code class=\"notranslate\">always</code>.</li>\n</ul>\n</div>\n<p dir=\"auto\">The <code class=\"notranslate\">-R</code> option is needed to interpret ANSI colors correctly.</p>\n<p dir=\"auto\">The <code class=\"notranslate\">-F</code> option instructs <code class=\"notranslate\">less</code> to exit immediately if the output size is smaller than<br>\nthe vertical size of the terminal. This is convenient for small files because you do not<br>\nhave to press <code class=\"notranslate\">q</code> to quit the pager.</p>\n<p dir=\"auto\">The <code class=\"notranslate\">-X</code> option is needed to fix a bug with the <code class=\"notranslate\">--quit-if-one-screen</code> feature in versions<br>\nof <code class=\"notranslate\">less</code> older than version 530. Unfortunately, it also breaks mouse-wheel support in <code class=\"notranslate\">less</code>.<br>\nIf you want to enable mouse-wheel scrolling on older versions of <code class=\"notranslate\">less</code> and do not mind losing<br>\nthe quit-if-one-screen feature, you can set the pager (via <code class=\"notranslate\">--pager</code> or <code class=\"notranslate\">BAT_PAGER</code>) to <code class=\"notranslate\">less -R</code>.<br>\nFor <code class=\"notranslate\">less</code> 530 or newer, it should work out of the box.</p>\n<p dir=\"auto\">The <code class=\"notranslate\">-S</code> option is added when <code class=\"notranslate\">bat</code>'s <code class=\"notranslate\">-S</code>/<code class=\"notranslate\">--chop-long-lines</code> option is used. This tells <code class=\"notranslate\">less</code><br>\nto truncate any lines larger than the terminal width.</p>\n<h3 dir=\"auto\">Indentation</h3>\n<p dir=\"auto\"><code class=\"notranslate\">bat</code> expands tabs to 4 spaces by itself, not relying on the pager. To change this, simply add the<br>\n<code class=\"notranslate\">--tabs</code> argument with the number of spaces you want to be displayed.</p>\n<p dir=\"auto\"><strong>Note</strong>: Defining tab stops for the pager (via the <code class=\"notranslate\">--pager</code> argument by <code class=\"notranslate\">bat</code>, or via the <code class=\"notranslate\">LESS</code><br>\nenvironment variable for <code class=\"notranslate\">less</code>) won't be taken into account because the pager will already get<br>\nexpanded spaces instead of tabs. This behaviour is added to avoid indentation issues caused by the<br>\nsidebar. Calling <code class=\"notranslate\">bat</code> with <code class=\"notranslate\">--tabs=0</code> will override it and let tabs be consumed by the pager.</p>\n<h3 dir=\"auto\">Dark mode</h3>\n<p dir=\"auto\">If you make use of the dark mode feature in macOS, you might want to configure <code class=\"notranslate\">bat</code> to use a different<br>\ntheme based on the OS theme. The following snippet uses the <code class=\"notranslate\">default</code> theme when in the <em>dark mode</em><br>\nand the <code class=\"notranslate\">GitHub</code> theme when in the <em>light mode</em>.</p>\n<div class=\"highlight highlight-source-shell notranslate position-relative overflow-auto\" dir=\"auto\" data-snippet-clipboard-copy-content=\"alias cat=&quot;bat --theme auto:system --theme-dark default --theme-light GitHub&quot;\"><pre class=\"notranslate\"><span class=\"pl-c1\">alias</span> cat=<span class=\"pl-s\"><span class=\"pl-pds\">\"</span>bat --theme auto:system --theme-dark default --theme-light GitHub<span class=\"pl-pds\">\"</span></span></pre></div>\n<h2 dir=\"auto\">Configuration file</h2>\n<p dir=\"auto\"><code class=\"notranslate\">bat</code> can also be customized with a configuration file. The location of the file is dependent<br>\non your operating system. To get the default path for your system, call</p>\n<div class=\"highlight highlight-source-shell notranslate position-relative overflow-auto\" dir=\"auto\" data-snippet-clipboard-copy-content=\"bat --config-file\"><pre class=\"notranslate\">bat --config-file</pre></div>\n<p dir=\"auto\">Alternatively, you can use <code class=\"notranslate\">BAT_CONFIG_PATH</code> or <code class=\"notranslate\">BAT_CONFIG_DIR</code> environment variables to point <code class=\"notranslate\">bat</code><br>\nto a non-default location of the configuration file or the configuration directory respectively:</p>\n<div class=\"highlight highlight-source-shell notranslate position-relative overflow-auto\" dir=\"auto\" data-snippet-clipboard-copy-content=\"export BAT_CONFIG_PATH=&quot;/path/to/bat/bat.conf&quot;\nexport BAT_CONFIG_DIR=&quot;/path/to/bat&quot;\"><pre class=\"notranslate\"><span class=\"pl-k\">export</span> BAT_CONFIG_PATH=<span class=\"pl-s\"><span class=\"pl-pds\">\"</span>/path/to/bat/bat.conf<span class=\"pl-pds\">\"</span></span>\n<span class=\"pl-k\">export</span> BAT_CONFIG_DIR=<span class=\"pl-s\"><span class=\"pl-pds\">\"</span>/path/to/bat<span class=\"pl-pds\">\"</span></span></pre></div>\n<p dir=\"auto\">A default configuration file can be created with the <code class=\"notranslate\">--generate-config-file</code> option.</p>\n<div class=\"highlight highlight-source-shell notranslate position-relative overflow-auto\" dir=\"auto\" data-snippet-clipboard-copy-content=\"bat --generate-config-file\"><pre class=\"notranslate\">bat --generate-config-file</pre></div>\n<p dir=\"auto\">There is also now a systemwide configuration file, which is located under <code class=\"notranslate\">/etc/bat/config</code> on<br>\nLinux and Mac OS and <code class=\"notranslate\">C:\\ProgramData\\bat\\config</code> on windows. If the system wide configuration<br>\nfile is present, the content of the user configuration will simply be appended to it.</p>\n<h3 dir=\"auto\">Format</h3>\n<p dir=\"auto\">The configuration file is a simple list of command line arguments. Use <code class=\"notranslate\">bat --help</code> to see a full list of possible options and values. In addition, you can add comments by prepending a line with the <code class=\"notranslate\">#</code> character.</p>\n<p dir=\"auto\">Example configuration file:</p>\n<div class=\"highlight highlight-source-shell notranslate position-relative overflow-auto\" dir=\"auto\" data-snippet-clipboard-copy-content=\"# Set the theme to &quot;TwoDark&quot;\n--theme=&quot;TwoDark&quot;\n\n# Show line numbers, Git modifications and file header (but no grid)\n--style=&quot;numbers,changes,header&quot;\n\n# Use italic text on the terminal (not supported on all terminals)\n--italic-text=always\n\n# Use C++ syntax for Arduino .ino files\n--map-syntax &quot;*.ino:C++&quot;\"><pre class=\"notranslate\"><span class=\"pl-c\"><span class=\"pl-c\">#</span> Set the theme to \"TwoDark\"</span>\n--theme=<span class=\"pl-s\"><span class=\"pl-pds\">\"</span>TwoDark<span class=\"pl-pds\">\"</span></span>\n\n<span class=\"pl-c\"><span class=\"pl-c\">#</span> Show line numbers, Git modifications and file header (but no grid)</span>\n--style=<span class=\"pl-s\"><span class=\"pl-pds\">\"</span>numbers,changes,header<span class=\"pl-pds\">\"</span></span>\n\n<span class=\"pl-c\"><span class=\"pl-c\">#</span> Use italic text on the terminal (not supported on all terminals)</span>\n--italic-text=always\n\n<span class=\"pl-c\"><span class=\"pl-c\">#</span> Use C++ syntax for Arduino .ino files</span>\n--map-syntax <span class=\"pl-s\"><span class=\"pl-pds\">\"</span>*.ino:C++<span class=\"pl-pds\">\"</span></span></pre></div>\n<h2 dir=\"auto\">Using <code class=\"notranslate\">bat</code> on Windows</h2>\n<p dir=\"auto\"><code class=\"notranslate\">bat</code> mostly works out-of-the-box on Windows, but a few features may need extra configuration.</p>\n<h3 dir=\"auto\">Prerequisites</h3>\n<p dir=\"auto\">You will need to install the <a href=\"https://support.microsoft.com/en-us/help/2977003/the-latest-supported-visual-c-downloads\" rel=\"nofollow\">Visual C++ Redistributable</a> package.</p>\n<h3 dir=\"auto\">Paging</h3>\n<p dir=\"auto\">Windows only includes a very limited pager in the form of <code class=\"notranslate\">more</code>. You can download a Windows binary<br>\nfor <code class=\"notranslate\">less</code> <a href=\"http://www.greenwoodsoftware.com/less/download.html\" rel=\"nofollow\">from its homepage</a> or <a href=\"https://chocolatey.org/packages/Less\" rel=\"nofollow\">through<br>\nChocolatey</a>. To use it, place the binary in a directory in<br>\nyour <code class=\"notranslate\">PATH</code> or <a href=\"#using-a-different-pager\">define an environment variable</a>. The <a href=\"#on-windows\">Chocolatey package</a> installs <code class=\"notranslate\">less</code> automatically.</p>\n<h3 dir=\"auto\">Colors</h3>\n<p dir=\"auto\">Windows 10 natively supports colors in both <code class=\"notranslate\">conhost.exe</code> (Command Prompt) and PowerShell since<br>\n<a href=\"https://en.wikipedia.org/wiki/Windows_10_version_history#Version_1511_(November_Update)\" rel=\"nofollow\">v1511</a>, as<br>\nwell as in newer versions of bash. On earlier versions of Windows, you can use<br>\n<a href=\"http://cmder.app/\" rel=\"nofollow\">Cmder</a>, which includes <a href=\"https://conemu.github.io/\" rel=\"nofollow\">ConEmu</a>.</p>\n<p dir=\"auto\"><strong>Note:</strong> Old versions of <code class=\"notranslate\">less</code> do not correctly interpret colors on Windows. To fix this, you can add the optional Unix tools to your PATH when installing Git. If you don’t have any other pagers installed, you can disable paging entirely by passing <code class=\"notranslate\">--paging=never</code> or by setting <code class=\"notranslate\">BAT_PAGER</code> to an empty string.</p>\n<h3 dir=\"auto\">Cygwin</h3>\n<p dir=\"auto\"><code class=\"notranslate\">bat</code> on Windows does not natively support Cygwin's unix-style paths (<code class=\"notranslate\">/cygdrive/*</code>). When passed an absolute cygwin path as an argument, <code class=\"notranslate\">bat</code> will encounter the following error: <code class=\"notranslate\">The system cannot find the path specified. (os error 3)</code></p>\n<p dir=\"auto\">This can be solved by creating a wrapper or adding the following function to your <code class=\"notranslate\">.bash_profile</code> file:</p>\n<div class=\"highlight highlight-source-shell notranslate position-relative overflow-auto\" dir=\"auto\" data-snippet-clipboard-copy-content=\"bat() {\n    local index\n    local args=(&quot;$@&quot;)\n    for index in $(seq 0 ${#args[@]}) ; do\n        case &quot;${args[index]}&quot; in\n        -*) continue;;\n        *)  [ -e &quot;${args[index]}&quot; ] &amp;&amp; args[index]=&quot;$(cygpath --windows &quot;${args[index]}&quot;)&quot;;;\n        esac\n    done\n    command bat &quot;${args[@]}&quot;\n}\"><pre class=\"notranslate\"><span class=\"pl-en\">bat</span>() {\n    <span class=\"pl-k\">local</span> index\n    <span class=\"pl-k\">local</span> args=(<span class=\"pl-s\"><span class=\"pl-pds\">\"</span><span class=\"pl-smi\">$@</span><span class=\"pl-pds\">\"</span></span>)\n    <span class=\"pl-k\">for</span> <span class=\"pl-smi\">index</span> <span class=\"pl-k\">in</span> <span class=\"pl-s\"><span class=\"pl-pds\">$(</span>seq 0 <span class=\"pl-smi\">${<span class=\"pl-k\">#</span>args[@]}</span><span class=\"pl-pds\">)</span></span> <span class=\"pl-k\">;</span> <span class=\"pl-k\">do</span>\n        <span class=\"pl-k\">case</span> <span class=\"pl-s\"><span class=\"pl-pds\">\"</span><span class=\"pl-smi\">${args[index]}</span><span class=\"pl-pds\">\"</span></span> <span class=\"pl-k\">in</span>\n        -<span class=\"pl-k\">*</span>) <span class=\"pl-k\">continue</span>;;\n        <span class=\"pl-k\">*</span>)  [ <span class=\"pl-k\">-e</span> <span class=\"pl-s\"><span class=\"pl-pds\">\"</span><span class=\"pl-smi\">${args[index]}</span><span class=\"pl-pds\">\"</span></span> ] <span class=\"pl-k\">&amp;&amp;</span> args[index]=<span class=\"pl-s\"><span class=\"pl-pds\">\"</span><span class=\"pl-s\"><span class=\"pl-pds\">$(</span>cygpath --windows <span class=\"pl-s\"><span class=\"pl-pds\">\"</span><span class=\"pl-smi\">${args[index]}</span><span class=\"pl-pds\">\"</span></span><span class=\"pl-pds\">)</span></span><span class=\"pl-pds\">\"</span></span>;;\n        <span class=\"pl-k\">esac</span>\n    <span class=\"pl-k\">done</span>\n    <span class=\"pl-c1\">command</span> bat <span class=\"pl-s\"><span class=\"pl-pds\">\"</span><span class=\"pl-smi\">${args[@]}</span><span class=\"pl-pds\">\"</span></span>\n}</pre></div>\n<h2 dir=\"auto\">Troubleshooting</h2>\n<h3 dir=\"auto\">Garbled output</h3>\n<p dir=\"auto\">If an input file contains color codes or other ANSI escape sequences or control characters, <code class=\"notranslate\">bat</code> will have problems<br>\nperforming syntax highlighting and text wrapping, and thus the output can become garbled.</p>\n<p dir=\"auto\">If your version of <code class=\"notranslate\">bat</code> supports the <code class=\"notranslate\">--strip-ansi=auto</code> option, it can be used to remove such sequences<br>\nbefore syntax highlighting. Alternatively, you may disable both syntax highlighting and wrapping by<br>\npassing the <code class=\"notranslate\">--color=never --wrap=never</code> options to <code class=\"notranslate\">bat</code>.</p>\n<div class=\"markdown-alert markdown-alert-note\" dir=\"auto\"><p class=\"markdown-alert-title\" dir=\"auto\"><svg class=\"octicon octicon-info mr-2\" viewBox=\"0 0 16 16\" version=\"1.1\" width=\"16\" height=\"16\" aria-hidden=\"true\"><path d=\"M0 8a8 8 0 1 1 16 0A8 8 0 0 1 0 8Zm8-6.5a6.5 6.5 0 1 0 0 13 6.5 6.5 0 0 0 0-13ZM6.5 7.75A.75.75 0 0 1 7.25 7h1a.75.75 0 0 1 .75.75v2.75h.25a.75.75 0 0 1 0 1.5h-2a.75.75 0 0 1 0-1.5h.25v-2h-.25a.75.75 0 0 1-.75-.75ZM8 6a1 1 0 1 1 0-2 1 1 0 0 1 0 2Z\"></path></svg>Note</p><p dir=\"auto\">The <code class=\"notranslate\">auto</code> option of <code class=\"notranslate\">--strip-ansi</code> avoids removing escape sequences when the syntax is plain text.</p>\n</div>\n<h3 dir=\"auto\">Terminals &amp; colors</h3>\n<p dir=\"auto\"><code class=\"notranslate\">bat</code> handles terminals <em>with</em> and <em>without</em> truecolor support. However, the colors in most syntax<br>\nhighlighting themes are not optimized for 8-bit colors. It is therefore strongly recommended<br>\nthat you use a terminal with 24-bit truecolor support (<code class=\"notranslate\">terminator</code>, <code class=\"notranslate\">konsole</code>, <code class=\"notranslate\">iTerm2</code>, ...),<br>\nor use one of the basic <a href=\"#8-bit-themes\">8-bit themes</a> designed for a restricted set of colors.<br>\nSee <a href=\"https://gist.github.com/XVilka/8346728\">this article</a> for more details and a full list of<br>\nterminals with truecolor support.</p>\n<p dir=\"auto\">Make sure that your truecolor terminal sets the <code class=\"notranslate\">COLORTERM</code> variable to either <code class=\"notranslate\">truecolor</code> or<br>\n<code class=\"notranslate\">24bit</code>. Otherwise, <code class=\"notranslate\">bat</code> will not be able to determine whether or not 24-bit escape sequences<br>\nare supported (and fall back to 8-bit colors).</p>\n<h3 dir=\"auto\">Line numbers and grid are hardly visible</h3>\n<p dir=\"auto\">Please try a different theme (see <code class=\"notranslate\">bat --list-themes</code> for a list). The <code class=\"notranslate\">OneHalfDark</code> and<br>\n<code class=\"notranslate\">OneHalfLight</code> themes provide grid and line colors that are brighter.</p>\n<h3 dir=\"auto\">File encodings</h3>\n<p dir=\"auto\"><code class=\"notranslate\">bat</code> natively supports UTF-8 as well as UTF-16. For every other file encoding, you may need to<br>\nconvert to UTF-8 first because the encodings can typically not be auto-detected. You can <code class=\"notranslate\">iconv</code><br>\nto do so.<br>\nExample: if you have a PHP file in Latin-1 (ISO-8859-1) encoding, you can call:</p>\n<div class=\"highlight highlight-source-shell notranslate position-relative overflow-auto\" dir=\"auto\" data-snippet-clipboard-copy-content=\"iconv -f ISO-8859-1 -t UTF-8 my-file.php | bat\"><pre class=\"notranslate\">iconv -f ISO-8859-1 -t UTF-8 my-file.php <span class=\"pl-k\">|</span> bat</pre></div>\n<p dir=\"auto\">Note: you might have to use the <code class=\"notranslate\">-l</code>/<code class=\"notranslate\">--language</code> option if the syntax can not be auto-detected<br>\nby <code class=\"notranslate\">bat</code>.</p>\n<h2 dir=\"auto\">Development</h2>\n<div class=\"highlight highlight-source-shell notranslate position-relative overflow-auto\" dir=\"auto\" data-snippet-clipboard-copy-content=\"# Recursive clone to retrieve all submodules\ngit clone --recursive https://github.com/sharkdp/bat\n\n# Build (debug version)\ncd bat\ncargo build --bins\n\n# Run unit tests and integration tests\ncargo test\n\n# Install (release version)\ncargo install --path . --locked\n\n# Build a bat binary with modified syntaxes and themes\nbash assets/create.sh\ncargo install --path . --locked --force\"><pre class=\"notranslate\"><span class=\"pl-c\"><span class=\"pl-c\">#</span> Recursive clone to retrieve all submodules</span>\ngit clone --recursive https://github.com/sharkdp/bat\n\n<span class=\"pl-c\"><span class=\"pl-c\">#</span> Build (debug version)</span>\n<span class=\"pl-c1\">cd</span> bat\ncargo build --bins\n\n<span class=\"pl-c\"><span class=\"pl-c\">#</span> Run unit tests and integration tests</span>\ncargo <span class=\"pl-c1\">test</span>\n\n<span class=\"pl-c\"><span class=\"pl-c\">#</span> Install (release version)</span>\ncargo install --path <span class=\"pl-c1\">.</span> --locked\n\n<span class=\"pl-c\"><span class=\"pl-c\">#</span> Build a bat binary with modified syntaxes and themes</span>\nbash assets/create.sh\ncargo install --path <span class=\"pl-c1\">.</span> --locked --force</pre></div>\n<p dir=\"auto\">If you want to build an application that uses <code class=\"notranslate\">bat</code>s pretty-printing<br>\nfeatures as a library, check out the <a href=\"https://docs.rs/bat/\" rel=\"nofollow\">the API documentation</a>.<br>\nNote that you have to use either <code class=\"notranslate\">regex-onig</code> or <code class=\"notranslate\">regex-fancy</code> as a feature<br>\nwhen you depend on <code class=\"notranslate\">bat</code> as a library.</p>\n<h2 dir=\"auto\">Contributing</h2>\n<p dir=\"auto\">Take a look at the <a href=\"CONTRIBUTING.md\"><code class=\"notranslate\">CONTRIBUTING.md</code></a> guide.</p>\n<h2 dir=\"auto\">Maintainers</h2>\n<ul dir=\"auto\">\n<li><a href=\"https://github.com/sharkdp\">sharkdp</a></li>\n<li><a href=\"https://github.com/eth-p\">eth-p</a></li>\n<li><a href=\"https://github.com/keith-hall\">keith-hall</a></li>\n<li><a href=\"https://github.com/Enselic\">Enselic</a></li>\n</ul>\n<h2 dir=\"auto\">Security vulnerabilities</h2>\n<p dir=\"auto\">Please contact <a href=\"https://david-peter.de/\" rel=\"nofollow\">David Peter</a> via email if you want to report a vulnerability in <code class=\"notranslate\">bat</code>.</p>\n<h2 dir=\"auto\">Project goals and alternatives</h2>\n<p dir=\"auto\"><code class=\"notranslate\">bat</code> tries to achieve the following goals:</p>\n<ul dir=\"auto\">\n<li>Provide beautiful, advanced syntax highlighting</li>\n<li>Integrate with Git to show file modifications</li>\n<li>Be a drop-in replacement for (POSIX) <code class=\"notranslate\">cat</code></li>\n<li>Offer a user-friendly command-line interface</li>\n</ul>\n<p dir=\"auto\">There are a lot of alternatives, if you are looking for similar programs. See<br>\n<a href=\"doc/alternatives.md\">this document</a> for a comparison.</p>\n<h2 dir=\"auto\">License</h2>\n<p dir=\"auto\">Copyright (c) 2018-2023 <a href=\"https://github.com/sharkdp/bat\">bat-developers</a>.</p>\n<p dir=\"auto\"><code class=\"notranslate\">bat</code> is made available under the terms of either the MIT License or the Apache License 2.0, at your option.</p>\n<p dir=\"auto\">See the <a href=\"LICENSE-APACHE\">LICENSE-APACHE</a> and <a href=\"LICENSE-MIT\">LICENSE-MIT</a> files for license details.</p>","updatedAt":"2025-05-21T15:49:53Z","upvoteCount":null,"author":{"login":"eryajf","avatarUrl":"https://avatars.githubusercontent.com/u/33259379?u=e4a4090a38ac2473aaed4ef9945233636776c6c3&v=4","url":"https://github.com/eryajf"},"category":null,"labels":{"edges":[{"node":{"name":"更多","color":"25B472"}},{"node":{"name":"命令行工具","color":"e05879"}},{"node":{"name":"sharkdp","color":"bb72b2"}}]},"comments":{"edges":[]}}},"pageContext":{"number":45,"previous":{"title":"bitepeng/b0pass: 基于Go语言的高性能 `手机电脑超大文件传输神器`、`局域网共享文件服务器`","number":44},"next":{"title":"etcd-io/bbolt: Go 语言开发的嵌入式键/值数据库","number":46}}},
    "staticQueryHashes": ["151096407","2861350382"]}