{"id":19751220,"url":"https://github.com/tkareine/dotfiles","last_synced_at":"2026-03-11T00:33:39.505Z","repository":{"id":1115239,"uuid":"985162","full_name":"tkareine/dotfiles","owner":"tkareine","description":"My dotfiles","archived":false,"fork":false,"pushed_at":"2024-10-21T05:14:04.000Z","size":2199,"stargazers_count":6,"open_issues_count":0,"forks_count":1,"subscribers_count":3,"default_branch":"master","last_synced_at":"2024-10-21T19:47:50.178Z","etag":null,"topics":["bash-prompt","bashrc","dotfiles","linux-configuration","macos-configuration","personal-config","shell-prompt"],"latest_commit_sha":null,"homepage":"","language":"Shell","has_issues":false,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/tkareine.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2010-10-13T21:00:15.000Z","updated_at":"2024-10-21T05:14:08.000Z","dependencies_parsed_at":"2023-10-03T11:18:46.355Z","dependency_job_id":"b065081b-70a5-433f-a2b3-63c40f686f17","html_url":"https://github.com/tkareine/dotfiles","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tkareine%2Fdotfiles","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tkareine%2Fdotfiles/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tkareine%2Fdotfiles/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tkareine%2Fdotfiles/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/tkareine","download_url":"https://codeload.github.com/tkareine/dotfiles/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":224208282,"owners_count":17273674,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["bash-prompt","bashrc","dotfiles","linux-configuration","macos-configuration","personal-config","shell-prompt"],"created_at":"2024-11-12T02:42:54.397Z","updated_at":"2026-03-11T00:33:39.497Z","avatar_url":"https://github.com/tkareine.png","language":"Shell","funding_links":[],"categories":[],"sub_categories":[],"readme":"# My dotfiles\n\n[![CI](https://github.com/tkareine/dotfiles/actions/workflows/ci.yml/badge.svg)][dotfiles-CI]\n\nHere is my public configuration for selected command line tools. I\ncheckout this repository to computers I work with.\n\nThe dotfiles focus on [GNU Bash] with the goal of having the shell\nuser-friendly enough to use, but without having extra functionality that\nwould hinder either the shell's start-up or prompt displaying time. I do\nmost of my programming and file editing in [Emacs] (see [my .emacs.d],\nseparate from this repository) or in [IntelliJ IDEA]; using rich IDEs is\nanother reason for the rather bare-bones shell setup I prefer.\n\nI mainly use macOS, so the tools are optimized for that environment.\nRudimentary support for Linux is in place, however, since I occasionally\nwork in a Linux environment for longer periods.\n\nI have copied or adapted some contents from others. For small chunks of\ncode, I have embedded the source URL in a comment inside the file. When\ncopying has been extensive, I have retained the original copyright in\nthe file. Thank you all!\n\nFinally, my motivation for using Bash over more feature-rich shells is\nthat I think tuning [.bashrc](.bashrc) helps keeping my shell\nprogramming skills in shape.\n\n## Setup highlights\n\nA screenshot from [iTerm2], showing the Bash prompt:\n\n\u003cimg src=\"https://github.com/tkareine/dotfiles/raw/master/images/bash-prompt-showcase-iterm2-v2.png\" title=\"Bash prompt showcase in iTerm2\" alt=\"Bash prompt showcase in iTerm2\" width=\"615\"\u003e\n\nThe font in use is [Input][Input font]\n([customization](https://input.djr.com/download/?customize\u0026fontSelection=fourStyleFamily\u0026regular=InputMonoNarrow-Regular\u0026italic=InputMonoNarrow-Italic\u0026bold=InputMonoNarrow-Bold\u0026boldItalic=InputMonoNarrow-BoldItalic\u0026a=ss\u0026g=ss\u0026i=serifs_round\u0026l=serifs_round\u0026zero=0\u0026asterisk=height\u0026braces=straight\u0026preset=default\u0026line-height=1.2)).\n\n### Fast Bash start-up and prompt display time\n\nI get frustrated if the shell feels sluggish to use. That's why I\noptimize the start-up time of my `.bashrc`:\n\n```bash\ntime bash --login -i -c true\n# real    0m0.162s\n```\n\nAnd especially, I want that the shell prompt gets re-displayed quickly.\nIn a directory not belonging to a Git working tree:\n\n```bash\ntime eval \"$PROMPT_COMMAND\"\n# real    0m0.032s\n```\n\nThe [.bashrc-support.sh](.bashrc-support.sh) file defines `tk_bm`, a\ntiny shell function to benchmark the execution time of a command within\nthe shell itself. Using that to benchmark shell prompt:\n\n```bash\ntk_bm 'eval \"$PROMPT_COMMAND\"'\n# warmup for 1.150 secs (100 times)\n# run command for 10.821 secs (1000 times): eval \"$PROMPT_COMMAND\"\n# mean 10.821 ms\n```\n\nThese outputs are from an Apple M2 Pro laptop, using Bash v5 and\n[bash-completion] with completions enabled for around 30 different\ntools.\n\n### Show selected versions of programming environments in Bash prompt\n\nThe Bash prompt shows the currently selected versions of\n\n- [Node.js], using [chnode] (`n:$version` at the top of the prompt),\n- [Ruby], using [chruby] (`r:$version`), and\n- [Java Development Kit], using a tiny shell function called `chjava`\n  defined in [.bashrc-common.sh](.bashrc-common.sh) (`j:$version`).\n\nFor all these programming environments, I want that the environment\nswitching tool (such as chnode) selects the environment version for a\nshell session. That allows using two different versions of Node.js in\nseparate shells simultaneously.\n\n### macOS configuration\n\nThe [.macos.sh](.macos.sh) script configures macOS quite extensively,\nconsidering what's possible with the `defaults` tool and plist files.\n\nThe script is originally based on [Mathias Bynens' .macos] script.\n\n### GNU Global configuration\n\nWhen you configure [GNU Global] to use [Universal Ctags] as a symbol\nparser, it's possible to extend the functionality of Global with the\nregex based [parser definition language][universal-ctags-optlib] of\nCtags. For instance, I've added extra support for Yaml, JavaScript,\nSCSS, and Less files. See [.globalrc](.globalrc) and\n[custom.ctags](.ctags.d/custom.ctags).\n\nThe downside of regexes is that they're hard to maintain. That's why\nthere's an extensive test suite in [gtags-test.sh](test/gtags-test.sh).\n\nInstalling Global with Homebrew:\n\n```bash\nbrew install global\n```\n\n### Test automation for dotfiles\n\nDid you know you can automate testing your shell's init scripts? See\n[bash-test.sh](test/bash-test.sh).\n\nTests are implemented on top of a small custom framework, written in\nBash. It was fun to write it. See the sources in the\n[test/support](test/support/) directory.\n\nRun `make` at the root of the project in order to learn how to run the\nlinters and tests.\n\n## Installation\n\nInstall the dotfiles with `./install.sh`, which either symlinks or\ncopies each file to your home directory. Installation is safe by\ndefault: if the target file exists in your home directory already, the\ninstaller skips symlinking or copying. See `./install -h` for more.\n\n### Homebrew\n\nOn macOS, [install Homebrew][Homebrew install] to its default prefix\ndirectory:\n\n```bash\n/bin/bash -c \"$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)\"\n```\n\n### Bash\n\nInstalling the latest version of Bash, using [Homebrew] on macOS:\n\n```bash\nbrew install bash\nsudo bash -c \"echo $(brew --prefix)/bin/bash \u003e\u003e /etc/shells\"\nchsh -s \"$(brew --prefix)/bin/bash\"\n```\n\n[Emacs]: https://www.gnu.org/software/emacs/\n[GNU Bash]: https://www.gnu.org/software/bash/\n[GNU Global]: https://www.gnu.org/software/global/\n[Homebrew install]: https://docs.brew.sh/Installation\n[Homebrew]: https://brew.sh/\n[Input font]: https://input.djr.com/\n[IntelliJ IDEA]: https://www.jetbrains.com/idea/\n[Java Development Kit]: https://openjdk.java.net/\n[Mathias Bynens' .macos]: https://github.com/mathiasbynens/dotfiles/blob/master/.macos\n[Node.js]: https://nodejs.org/en/\n[Ruby]: https://www.ruby-lang.org/\n[Universal Ctags]: https://docs.ctags.io/en/latest/\n[bash-completion]: https://github.com/scop/bash-completion\n[chnode]: https://github.com/tkareine/chnode\n[chruby]: https://github.com/postmodern/chruby\n[dotfiles-CI]: https://github.com/tkareine/dotfiles/actions/workflows/ci.yml\n[iTerm2]: https://www.iterm2.com/\n[my .emacs.d]: https://github.com/tkareine/emacs.d\n[universal-ctags-optlib]: https://docs.ctags.io/en/latest/man/ctags-optlib.7.html\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftkareine%2Fdotfiles","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftkareine%2Fdotfiles","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftkareine%2Fdotfiles/lists"}