{"id":14069704,"url":"https://github.com/farisachugthai/dotfiles","last_synced_at":"2025-07-30T06:32:29.829Z","repository":{"id":101125873,"uuid":"119761644","full_name":"farisachugthai/dotfiles","owner":"farisachugthai","description":"Dotfiles for bash, tmux, git, VSCode, Jupyter Notebooks and many more on Linux, Windows 10 and Android (Termux)","archived":false,"fork":false,"pushed_at":"2020-08-23T00:43:41.000Z","size":14114,"stargazers_count":26,"open_issues_count":0,"forks_count":3,"subscribers_count":3,"default_branch":"master","last_synced_at":"2024-12-04T11:37:45.516Z","etag":null,"topics":["awesome","bash","dotfiles","jupyter","python","termux","unix","vscode","workflow","x11"],"latest_commit_sha":null,"homepage":"","language":"Shell","has_issues":true,"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/farisachugthai.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","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}},"created_at":"2018-02-01T00:35:52.000Z","updated_at":"2024-08-22T00:04:39.000Z","dependencies_parsed_at":"2023-03-26T14:18:27.745Z","dependency_job_id":null,"html_url":"https://github.com/farisachugthai/dotfiles","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/farisachugthai/dotfiles","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/farisachugthai%2Fdotfiles","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/farisachugthai%2Fdotfiles/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/farisachugthai%2Fdotfiles/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/farisachugthai%2Fdotfiles/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/farisachugthai","download_url":"https://codeload.github.com/farisachugthai/dotfiles/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/farisachugthai%2Fdotfiles/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":267822663,"owners_count":24149664,"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","status":"online","status_checked_at":"2025-07-30T02:00:09.044Z","response_time":70,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["awesome","bash","dotfiles","jupyter","python","termux","unix","vscode","workflow","x11"],"created_at":"2024-08-13T07:07:09.399Z","updated_at":"2025-07-30T06:32:29.327Z","avatar_url":"https://github.com/farisachugthai.png","language":"Shell","funding_links":[],"categories":["Shell"],"sub_categories":[],"readme":"# Dotfiles\n\nA repository that hosts the dotfiles for my Ubuntu workstations and a Termux\ndevelopment environment.\n\n## Overview\n\nCode for a Windows 10 laptop is slowly working it's way in, though the\ntransition to a typical Windows workflow has been different than Linux.\n\nMost of the code here is helper code that aides my productivity while I'm\nworking on various personal projects.\n\nEnjoy reading through the code, feel free to take anything that interests you,\nand leave a comment or open an issue if you notice anything that you'd\npersonally improve!\n\n## Features\n\nCurrently this houses code for dozens of applications with a focus on python\nprogramming and conventional Unix terminal workflows.\n\nConfigurations exist for:\n\n- Customized Completions\n\n- [Modifications](unix/.profile) [for](unix/.bashrc) [bash](unix/.bash_logout)\n  [are](unix/.bashrc.d/alias.bash) [abundant](unix/.bashrc.d/functions.bash).\n\n- [Tmux settings](./unix/.tmux.conf) and [tmux scripts](./unix/.tmux) as well.\n\n## Completions\n\nThe way that auto-completions are set up can fundamentally change the user\nexperience when working with a shell. This is especially true for when the\nuser is unfamiliar with the ins and outs of the shell.\n\nHowever, the way that bash handles auto-completion can be largely \ninconsistent. It seems that this is largely a product of how differing \nflavors of Unix set up their shells by default, in addition to a large \namounts of configurability and customization that users are afforded but \npotentially may not be aware of.\n\nIt's unfortunate bash doesn't have a simpler \"drop down menu interface\" for \nit's users. However, I'm hoping that all of my digging through man\npages will save you from the same fate.\n\nFollowing are my notes on this to attempt setting things up consistently.\n\n### General set up\n\n```bash\n\nu0_a144 @ localhost ~ 11:59 0\n*@In [11] $ complete -p | sort | uniq | wc -l\n475\n\nu0_a144 @ localhost ~ 11:59 0\n*@In [11] $ complete -p | sort | uniq | rg --max-count=999999 '.*fzf*' | wc -l\n145\n\n```\n\nThe above shows how many commands have tab completion set up, which as of May 09, 2020, is 475 commands.\n\nBeing able to mindlessly jam the \u003ckbd\u003eTab\u003c/kbd\u003e key is outstandingly\nhelpful to working in a shell frequently.\n\nIn addition, 145 of those commands utilize FZF's shell completion, as it noticeably speeds up completion generation.\n\n\n### WSL\n\nOn the Arch flavor of WSL, /etc/profile and /etc/profile.d exist but don't do\nanything to setup completions.\n\nThe /etc/bash.bashrc does the fairly standard idiom.:\n\n`[ -r /usr/share/bash-completion/bash_completion   ] \u0026\u0026 . /usr/share/bash-completion/bash_completion`\n\nOtherwise little is set up.\n\nI just created a directory /etc/bash_completion.d as one was needed by `activate-global-python-argcomplete`.\n\n### /usr/share/bash-completion/bash_completion\n\nIt appears that the following dirs are sourced by the frequently present file at\n/usr/share/bash-completion/bash_completion.\n\nThe following is defined in a function `__load_completion()`, IE check that\nit's defined in the shell before placing files here!\n\n    local -a dirs=( ${BASH_COMPLETION_USER_DIR:-${XDG_DATA_HOME:-$HOME/.local/share}/bash-completion}/completions )\n\nThis is defined globally.:\n\n    # source compat completion directory definitions\n    compat_dir=${BASH_COMPLETION_COMPAT_DIR:-/etc/bash_completion.d}\n\nAs is this.:\n\n    # source user completion file\n    user_completion=${BASH_COMPLETION_USER_FILE:-~/.bash_completion}\n\nOn Termux,\n\n\n### Readline\n\n**TODO**\n\n[.inputrc](./unix/.inputrc)\n\n\n### `complete` and `compgen`\n\n\n## Handling Git on Windows\n\nGit may try to treat files with extensions it doesn't recognize as binary.\nAs Windows occasionally encodes things with `CP-437`, `UTF-16`, `ASCII` or\n`locale=C` depending on what mood it's in, this can be difficult to fix\nby means of decoding.\n\nA simple fix is to set the following in the\n[.gitattributes](./unix/.config/git/aattributes) file.\n\n`*.ps1 text eol=input diff`\n\n`eol=input` is only set because powershell needs `DOS` style lines, but I don't\nwant the entire repository filled with differing line endings on Unix computers.\n\n`text` is to ensure it's not recognized as binary but if it already was, `diff`\nwill reset it back to text.\n\n## Bash Configuration\n\nThe `$PAGER` is highly customized. From my bashrc.\n\n```bash\n# -J: displays a status column at the left edge of the screen\n# -R: is what we need for ansi colors\n# -K: exit less in response to Ctrl-C\n# -M: Verbose prompt\n# -L: Line numbers. Open a man page and hit 'G' to see what you're getting into\n# -i: Ignore case. Works similarly to how modern programs handle smart case!\n# --mouse: Take a guess\n# -g: only one  search match highlighted\n# -e EOF reached twice? Close automatically.\n# -S set wrap or \"squeeze\" long lines\n# -F: Quit automatically if one screen\n\nexport PAGER=\"less -JRKMLigeF\"\nexport LESSHISTSIZE=5000  # default is 100\n\n# Oh shit! --mouse is a bash\u003e5 feature!\nif [[ $BASH_VERSINFO -gt 4 ]]; then export PAGER=\"$PAGER --mouse --no-histdups --save-marks \"; fi\n\n\n# Thank byobu for these ones. Man pages now look pretty awesome\nexport GREP_COLORS=\"ms=01;38;5;202:mc=01;31:sl=:cx=:fn=01;38;5;132:ln=32:bn=32:se=00;38;5;242\"\nexport LESS_TERMCAP_mb=$(printf '\\e[01;31m')       # enter blinking mode – red\nexport LESS_TERMCAP_md=$(printf '\\e[01;38;5;180m') # enter double-bright mode – bold light orange\nexport LESS_TERMCAP_me=$(printf '\\e[0m')           # turn off all appearance modes (mb, md, so, us)\nexport LESS_TERMCAP_se=$(printf '\\e[0m')           # leave standout mode\nexport LESS_TERMCAP_so=$(printf '\\e[03;38;5;202m') # enter standout mode – orange background highlight (or italics)\nexport LESS_TERMCAP_ue=$(printf '\\e[0m')           # leave underline mode\nexport LESS_TERMCAP_us=$(printf '\\e[04;38;5;139m') # enter underline mode – underline aubergine\n\nif [[ -n \"$(command -v bat)\" ]]; then\n    export BAT_PAGER=\"less -JRKMLige\"\n    export BAT_THEME=\"base16\"\n    export BAT_STYLE=\"full\"\n  # TODO: This doesn't work for me\n  # export MANPAGER=\"sh -c 'col -bx | bat -l man -p'\"\n  export MANROFFOPT=\"-c\"\n  if [[ -d \"$HOME/faris/AppData/Roaming\" ]]; then\n    export BATCONFIGFILE=\"$HOME/faris/AppData/Roaming/bat/config\"\n  fi\nfi\n\n```\n\nThis is just a simple example of how extensive some frequently used options\nhave gotten.\n\n### Useful ANSI escape sequences\n\n```bash\n\n# CUSTOM BASH COLOR PROMPT\n# 30m - Black\n# 31m - Red\n# 32m - Green\n# 33m - Yellow\n# 34m - Blue\n# 35m - Purple\n# 36m - Cyan\n# 37m - White\n# 0 - Normal\n# 1 - Bold\nexport BLACK=\"\\[\\033[0;30m\\]\"\nexport BLACKBOLD=\"\\[\\033[1;30m\\]\"\nexport RED=\"\\[\\033[0;31m\\]\"\nexport REDBOLD=\"\\[\\033[1;31m\\]\"\nexport GREEN=\"\\[\\033[0;32m\\]\"\nexport GREENBOLD=\"\\[\\033[1;32m\\]\"\nexport YELLOW=\"\\[\\033[0;33m\\]\"\nexport YELLOWBOLD=\"\\[\\033[1;33m\\]\"\nexport BLUE=\"\\[\\033[0;34m\\]\"\nexport BLUEBOLD=\"\\[\\033[1;34m\\]\"\nexport PURPLE=\"\\[\\033[0;35m\\]\"\nexport PURPLEBOLD=\"\\[\\033[1;35m\\]\"\nexport CYAN=\"\\[\\033[0;36m\\]\"\nexport CYANBOLD=\"\\[\\033[1;36m\\]\"\nexport WHITE=\"\\[\\033[0;37m\\]\"\nexport WHITEBOLD=\"\\[\\033[1;37m\\]\"\n\nexport RESET=\"\\033[0m\"\nexport PS2=\"\\001\\033[32m\\002  ...:\\001$RESET\\002 \"\nexport LIGHT_RED=\"\\[\\e[91m\\]\"\nexport ORANGE=\"\\[\\e[38;5;208m\\]\"\n# Different shade\nexport yellow=\"\\[\\e[38;5;214m\\]\"\nexport GREEN=\"\\[\\e[38;5;71m\\]\"\nexport UGREEN=\"\\[\\e[38;5;71;1;4m\\]\"\nexport SALMON=\"\\[\\e[38;5;167m\\]\"\nexport BROWN=\"\\[\\e[38;5;166m\\]\"\n\n```\n\n### Porting to Windows\n\nHas been nothing short of a massive pain in the ass.\n\nHopefully these tips will help someone else one day.\n\n1. Break down every part of your previous setup from the ground up.\n   I've had powershell and conda inconsistently set the python environment.\n   I didn't imagine at any point that the shell itself was at fault, and\n   wasted a ton of time as a result. Then move forward.\n\n2. View your setup as it's individual components. This will be akin to unit\n   testing, and when you're in the middle of doing something will,\n   _unfortunately_, be the integration test.\n\n   - However doing this correctly can save you a lot of headache. Take\n     concatenating a file as a simple example. To page a file, requires cmd\n     to read it, pass it to less. If the pager was invoked automatically by\n     git, ensure that env var is consistent with the rest of your setup.\n     Not setting the `$TERM` envvar may cause issues here.\n\n     - Sticking with the pager example. `Git` called `bat`, a new version of `cat`\n       rewritten in rust. This called `less` to open the file. If `cmder`,\n       `powershell`, or `cmd` hadn't decoded/encoded the file incorrectly,\n       the colorscheme of the file would render the file practically illegible.\n       If this occurred while using `ipython` to run system commands, I would,\n       on occasion, have 5 different levels of the command to debug.\n\n3. A user can set parameters in the GUI using Control Panel as well as in the\n   registry. Registry problems are functionally impossible to debug, _at least\n   so far I've found_, and as a result, it will frequently be more easy to\n   recover from mistakes in classic ini-style config files.\n\n4. Use `*nix` line endings. Trust me.\n\n5. Use WSL when there aren't other options; however, make every attempt you can\n   to use native tools as possible.\n\n   - When in Rome!\n\n\n### Cmder\n\nSomething in these configuration files has to be set wrong.\nInteractively defining an alias on the cmdline destroys the alias file.\nIt looks like an encoding problem which is definitely possible\nas nvim is set to automatically assume utf-8, as is the windows terminal and cmder.\n\n`chcp` is included as one of the first commands of my\n[user_profile.cmd](./nt/cmder/user_profile.cmd).\n\nHowever, if the alias command provided by ConEmu isn't aware of that, then\nany input from the terminal to the file will corrupt it.\n\nSo be careful and simply define them non-interactively!\n\n## Contributing\n\nWhile most people consider dotfiles very personal, I've posted as many as I\nfound reasonable with the intention of encouraging some discussion on how\nto solve common problems more seamlessly.\n\n## License\n\nMIT\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffarisachugthai%2Fdotfiles","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffarisachugthai%2Fdotfiles","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffarisachugthai%2Fdotfiles/lists"}