{"id":13895425,"url":"https://github.com/hedyhli/dotfiles","last_synced_at":"2025-03-17T16:32:06.673Z","repository":{"id":117996438,"uuid":"268020018","full_name":"hedyhli/dotfiles","owner":"hedyhli","description":"$HOME sweet /home/ — mostly neovim, emacs, and shell scripts","archived":false,"fork":false,"pushed_at":"2024-09-26T13:59:20.000Z","size":1137,"stargazers_count":13,"open_issues_count":0,"forks_count":2,"subscribers_count":2,"default_branch":"master","last_synced_at":"2024-10-10T03:05:31.396Z","etag":null,"topics":["bash","config","doom-emacs","dotfiles","emacs","fish","git","literate-configuration","neovim","tmux","vim","vimrc","yadm"],"latest_commit_sha":null,"homepage":"","language":"Lua","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/hedyhli.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,"publiccode":null,"codemeta":null}},"created_at":"2020-05-30T06:06:49.000Z","updated_at":"2024-09-26T13:59:23.000Z","dependencies_parsed_at":null,"dependency_job_id":"675adf43-8dc3-46db-b5c6-ea1cdfb12e51","html_url":"https://github.com/hedyhli/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/hedyhli%2Fdotfiles","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hedyhli%2Fdotfiles/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hedyhli%2Fdotfiles/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hedyhli%2Fdotfiles/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/hedyhli","download_url":"https://codeload.github.com/hedyhli/dotfiles/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":221697007,"owners_count":16865523,"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","config","doom-emacs","dotfiles","emacs","fish","git","literate-configuration","neovim","tmux","vim","vimrc","yadm"],"created_at":"2024-08-06T18:02:12.220Z","updated_at":"2024-10-27T15:18:16.988Z","avatar_url":"https://github.com/hedyhli.png","language":"Lua","funding_links":[],"categories":["Lua"],"sub_categories":[],"readme":"# dotfiles\n\n- [Source (SourceHut)](https://git.sr.ht/~hedy/dotfiles)\n- [Patches](https://lists.sr.ht/~hedy/inbox)\n- [Questions/Feedback](https://lists.sr.ht/~hedy/inbox)\n- Chat ([Libera](https://web.libera.chat/#hedy) / [Tilde](https://tilde.chat/kiwi/##hedy))\n\nThese are the setup I have on almost all machines I work in, and because I work\non many [tildes](https://tildeverse.org), I make this set of configuration as\ncross-platform as possible.\n\nUsed on (aka loosely tested on):\n- MacOS\n- Debian/Ubuntu\n- Arch\n- ~WSL 1~ (I no longer use that)\n\nWSL 2 would probably be a similar experience to any of those corresponding\nlinux distros.\n\nNote that WSL support of clipboard pastes is deprecated on NVIM as of\n2023-06-30. Before which, you need to have a `pbcopy`/`pbpaste` binary in path\nthat handles clipboard operations with windows.\n\n---\n\nRepository: [SourceHut](https://sr.ht/~hedy/dotfiles)\n\nMirrors: [tildegit (gitea)](https://tildegit.org/hedy/dotfiles) |\n[GitHub](https://github.com/hedyhli/dotfiles)\n\n**Table of Contents**\n\n\u003c!-- mtoc-start --\u003e\n\n* [Overview](#overview)\n* [Installation](#installation)\n* [Shell](#shell)\n  * [Oh My Fish](#oh-my-fish)\n  * [Fish functions](#fish-functions)\n  * [Local](#local)\n  * [Nushell](#nushell)\n* [Editor](#editor)\n  * [Vim and nvim](#vim-and-nvim)\n    * [Neovim Lua Setup](#neovim-lua-setup)\n    * [TODO for neovim](#todo-for-neovim)\n  * [Vanilla Emacs](#vanilla-emacs)\n  * [Doom emacs](#doom-emacs)\n* [Terminal](#terminal)\n* [Gemini and Spartan client](#gemini-and-spartan-client)\n* [TODO](#todo)\n\n\u003c!-- mtoc-end --\u003e\n\n## Overview\n\n- Manager: [yadm](https://yadm.io) ([`.config/yadm`](.config/yadm))\n- Shell \u0026 tools:\n  - Fish ([`.config/fish`](.config/fish))\n  - Git ([`.gitconfig`](.gitconfig), [`.gitignore_global`](.gitignore_global))\n  - Jujutsu ([`.config/jutjutsu`](.config/jujutsu))\n  - Tmux ([`.tmux.conf`](.tmux.conf))\n- Theme: Catppuccin Mocha (Kitty, Fish and Helix), Tundra (Neovim), Modus Vivendi (emacs)\n  - Note I use a modified Catppuccin Mocha variant that swaps around some colors\n    (without modifying the palette itself) for Kitty ([`.config/kitty/mocha.conf`]\n    (.config/kitty/mocha.conf)) and Fish ([`.config/fish/themes/mocha.theme`]\n    (.config/fish/themes/mocha.theme))\n- Font:\n  - Monospace: IBM Plex Mono and Fira Code, without ligatures (Kitty and Emacs)\n  - Variable width: Inter (Emacs, with ligatures in Logseq), IBM Plex Sans and\n    iA Writer Quattro S (in some contexts)\n- Email: [aerc](https://aerc-mail.org) ([`.config/aerc`](.config/aerc))\n- Terminal: [Kitty](https://sw.kovidgoyal.net/kitty/) ([`.config/kitty`](.config/kitty))\n- Editor:\n  - Vim ([`.vimrc`](.vimrc)) (not used)\n  - Neovim ([`.config/nvim`](.config/nvim))\n  - Emacs ([`.config/emacs`](.config/emacs)) (with chemacs: [.emacs-profiles.el](.emacs-profiles.el))\n  - Helix ([`.config/helix`](.config/helix))\n  - Doom ([`.config/doom`](.config/doom))\n  - [Acme](http://acme.cat-v.org/): Does not have config files, but I do have some scripts (`bin/gotagacme`, `bin/gotagclean.py`)\n- Web client (browser):\n  - [Elinks fork](https://github.com/rkd77/elinks) with local modifications ([`.elinks/elinks.conf`](.elinks/elinks.conf))\n  - [Qutebrowser](https://qutebrowser.org) ([`.qutebrowser/config.py`](.qutebrowser/config.py))\n  - And others irrelevant to dotfiles\n- Gemini client:\n  - [gelim (also spartan)](https://sr.ht/~hedy/gelim) ([`.config/gelim`](.config/gelim))\n  - [amfora](https://github.com/makeworld-the-better-one/amfora) ([`.config/amfora`](.config/amfora))\n\n## Installation\n\n1. Install yadm\n1. Clone the repo with yadm\n1. Fix conflicts as you please\n1. Reload sessions\n  - fish\n  - `tmux source ~/.tmux.conf`\n1. Selectively run scripts in [`dotscripts`](./dotscripts/) using `dot \u003ctype\u003e\n   \u003ctarget\u003e` such as `dot setup fish` to suppress those not-found errors.\n\n---\n\nHere are detailed information for each component of my dotfiles\n\n## Shell\n\nMy default shell is fish because it comes with auto-suggestions and\nhighlighting without the need of additional plugins. It does have its own\nseemingly friendlier syntax, but many times I find myself dropping into `bash`\nwhile writing shell scripts, so I realized... the only thing that is keeping me\nto fish may as well be the auto-suggestions and syntax highlighting...\n[imrsh](https://git.sr.ht/~sircmpwn/imrsh) seems quite attractive looking at\nits goals, plus the fact that it's POSIX-compatible, so if development there\nhas any progress I may even consider switching.\n\nDespite fish being my primary shell, I still like to keep all my aliases,\nscripts, and environment variables synced with the other shells. This is done\nin the [`.startup.sh`](.startup.sh) script. It should be sourced for\nPOSIX-compatible shells. see `dotscripts/setup/bash`.\n\nI don't track `bashrc` or `bash_profile` because I like to keep it to the\nsystem's defaults. Maintaining cross-platform versions of them when I use them\nrarely is a pain.\n\nThe fish shell configuration lives at `.config/fish/`. Of which, `config.fish`\ndoesn't really anything specific, it just sources the shared environment\nvariable file (`.exportenvs.fish`) and the shared aliases (`.aliases`).\n\nThe `.exportenvs.fish` file is generated by\n[`dotscripts/gen/fish-exportenvs`](dotscripts/gen/fish-exportenvs).\n\nIt takes [`.exportenvs`](.exportenvs) and translates it into fish syntax.\nInstead of using bass to source `.exportenvs` on the fly during fish's startup,\nfish can source the generated `.exportenvs.fish` directly which improves\nperformance significantly.\n\nI have a symlink `.bash_aliases` pointing to `.aliases` because bash likes to\nlook for that file.\n\n`.exportenvs` is basically a bunch of environment variables exports. A whole\nton of installation scripts on the internet likes to add `export\nsomething=something` to `bashrc`, so when that happens I tend to just move it\ninto my `.exportenvs`.\n\nEvery time `.exportenvs` is updated, run `dot setup fish` to regenerate\n`.exportenvs.fish` and reload the environment.\n\n**TLDR**:\n- `.startup.sh` for POSIX-compatible shell configuration\n- Alternatively, do the aliases in `.aliases`,\n- do the environment variables in `.exportenvs`, and\n- do the PATH-updates in `.addpath`.\n\nSee below section \"Local\" for machine-specific configuration (untracked in the\nrepo).\n\n\n### Oh My Fish\n\nOh My Fish is like a plugin manager for fish.\n\nI don't have a lot of plugins and nor do I use it for theme and prompt, just\nthese utilities:\n- `z`: quickly access a common dir\n- `bass`: source bash scripts and expressions in fish (I use this for giving\n  fish support to `nvm`, see [the `nvm`\n  function](.config/fish/functions/nvm.fish))\n- `pj`: quickly access projects (NOTE: as of 2024, I've switched to my own\n  implementation for `pj` because this does not support `pj\n  project-name/sub/dir/here`, and I do not use multiple project paths, which it\n  supports.)\n\nThe fish theme is entirely dependent on the terminal color settings and the\n[prompt](.config/fish/functions/fish_prompt.fish) is copied from a particular\npre-existing prompt style that shows error status and git status. I've modifid\nthe prompt style and added right prompt to show user@hostname.\n\n**Setup**: `dotscripts/setup/fish`\n\n### Fish functions\n\nFish functions (located at `.config/fish/functions`) are mostly aliases that\nrequire some checking or additional logic.\n\ncat, rm, ll are aliased to ccat, trash, and exa respectively if those programs\nare installed.\n\nThe nvm function adds fish support to nvm (Node Version Manager).\n\n### Local\n\nThe `.config/fish/config_local.fish` file is for configuration specific for a\ncomputer, this could be setting a special $EDITOR, etc.\n\nOther local files recognized:\n- `.addpath_local` - machine specific software that changes PATH\n- `.gitconfig-local` - email/name, sendmail\n- `.config/kitty/local.conf` - fonts\n\n**Setup**: `dotscripts/gen/localfiles`\n\n### Nushell\n\nI don't (yet?) use Nushell as my primary shell because:\n- it hasn't received enough support and adoption from external CLI programs\n  (completions, plugins etc.)\n- There are often breaking changes\n- It does not yet support a lot of configuration I need for it to become my\n  default shell, such as more nuanced and intelligent syntax highlighting at the\n  prompt\n- Its completion and history is not as good as Fish's\n\nHowever, the language is absolutely amazing, and sometimes I might drop into\nthis shell to do some complex pipelining or advanced scripting (without\nwanting to install external packages). Hence, my Nushell environment is setup up\nto be satisfactorily usable, ie, same aliases, similar readline keybindings,\nenvironment variables and PATH. The latter too is inherited from the parent\nprocess, ie, fish.\n\n**Config**: `.config/nushell`\n\n**Scripts**: `dotscripts/*/nu`\n\n## Editor\n\n- Vim: for systems that don't have neovim installed\n- Neovim (\u003e= 0.8): primary editor, for now\n- Emacs (29 - I need emoji): continuously improving my setup, until one day,\n  *one day*, I'll have it replace neovim.\n- Doom: looking for IDE features and inspiration for my nvim and vanilla emacs\n  setup. I might drop this soon - takes so much time and resources to set it up\n  and maintain the millions of packages only to leave it lying there and never get\n  used.\n- ~~VScode: I only use this when I'm too stressed to remember vim/emacs's key\n  binds, or sometimes when I'm remote-editting.~~ I no longer have any need for\n  waiting for an editor an eternity to start up and maintaining... JSON configs??\n  that runs on Electron?? yeah... no thanks, sorry.\n\n### Vim and nvim\n\n**README**: `.config/nvim/README.norg`\n\nMinimum supported version: NVIM 0.5.0\n\nRecommended version: NVIM 0.9.0+\n\nThe [bin/nv](./bin/nv) script is an alias to neovim, and runs vim if neovim is\nnot installed.\n\nThe vim config is usable, but largely unmaintained. It can be used on systems\nwithout neovim or with an unsupported version of neovim.\n\n\u003cdetails\u003e\n\u003csummary\u003e Legacy neovim setup \u003c/summary\u003e\n\nI use vim-plug as my plugin manager for nvim because it is shorter to type. And\nit installs plugins asynchronously.\n\nMy nvim config directory (`.config/nvim`) has separate files for different types\nof configuration. `general.vim` has mostly the same content as `.vimrc`.\n\nThe isWSL function checks whether the system is WSL in my (n)vim configs. This\nis to set up the clipboard correctly and rebind some keys to make \u003ckbd\u003ealt\u003c/kbd\u003e\nwork correctly in vim.\n\n**Lua and LSP for Neovim**\n\nIf the neovim version on the system \u003e=0.5, LSP will be set up with lua\nconfiguration, otherwise (and if node is installed), CoC will be used. I don't\nuse any system with neovim \\\u003c0.5, so the CoC set up is unmaintained. I might\nremove it in the future.\n\nLSP servers - See comments in `.config/nvim/lua/lsp.lua`.\n\nI'll probably also optimize my vim config so that it can be fast and clean -\navailable for quick editing. No auto-complete, no fancy themes, just some\nmust-have utilities.\n\u003c/details\u003e\n\n#### Neovim Lua Setup\n\n- Plugin manager: Lazy.nvim\n- Completion: nvim-cmp\n- File explorer: nvim-tree and mini.files\n- Icons: nvim-web-devicons\n- Status line: Disabled (using rulerfmt + incline.nvim)\n\nEver since then, my startup time has improved significantly and this switch came\nwith many other advantages including opening up a world of many modern, speedy\nplugins with very useful (not exactly due to being trendy) functionalities.\n\nI like to choose plugins that are fast, customizable, and generally does not\nhave feature creep.\n\n**LSP and completion**\n\nI use the official lsp-config plus nvim-cmp.\n\n**Linting**\n\nLinting is triggered on save. I use nvim-lint.\n\n**Treesitter**\n\nTreesitter plugin is enabled conditionally if neovim version \u003e= 0.9.\n\nNote that a proper C/C++ compiler toolchain is required for building the\nparsers.\n\n**Telescope**\n\nTelescope plugin is enabled conditionally if neovim version \u003e= 0.9.\n\n**Setup**:\n- `dotscripts/setup/nvim` (no longer needed as I no longer use vim-plug)\n- `dotscripts/install/misc` - Includes Vundle setup together with other\nsoftware.\n\n**Additional information**: `.config/nvim/README.norg` including brief notes about neovim vs emacs.\n\n#### TODO for neovim\n\n(I might never complete these since I recently switched to emacs)\n\n- [x] Drop CoC and \\\u003cv0.5 support\n- [x] Use Lazy.nvim package manager\n- [x] Replace lightline with lualine\n- [x] Set up snippets\n- [x] Replace NERDTree with ~neo-tree~ nvim-tree\n- [x] Make use of Lazy loading\n- [x] Fix ftplugin + lazy ft handle\n- [x] Use Tree sitter\n- [x] Ensure conditionally loaded plugins (from nvim version) work as expected\n\n\n### Vanilla Emacs\n\nI use chemacs2 for switching emacs profiles (for emacs \u003c v29) and it allows me\nto use both vanilla emacs and doom emacs at the same time. See\n[`.emacs-profiles.el`](.emacs-profiles.el).\n\n**Setup**: `dotscripts/setup/emacs`. This script is pretty heavily tested and\nit should set up everything you need to start using both emacs and doom\nnormally. It installs chemacs and doom if not already installed.\n\nMy main emacs is vanilla emacs, the configuration lives at `~/.config/emacs`. My\nprimary emacs version is Emacs 29, because I need better SVG support. I use\nEmacs 28 sometimes for testing.\n\nConfiguration for both Vanilla and Doom emacs are Literate (org files that get\nexported \"tangled\" to indicated Elisp destinations).\n\n### Doom emacs\n\nDoom itself requires at least emacs 27+ and git 2.23+ among other things. More\ninfo on the [github repo](https://github.com/hlissner/doom-emacs).\n\n2023: I started to use Doom a lot more, before switching to primarily vanilla\nemacs in 2023-09. The configuration there is somewhat up to date, but not\nguaranteed as I don't really use doom anymore.\n\nThe emacs directory would be at `.doomemacs` (because `.emacs.d` is for\nchemacs). Relevant environment variables are set in `.exportenvs`, also see\n`.emacs-profiles.el`.\n\n## Terminal\n\nThe shell theme depends on the terminal theme. I use Kitty Terminal, where its\nconfig at `.config/kitty`. It uses customized Catppuccin Mocha theme. Font\nconfiguration varies depending on the system hence it should be in a separate\nfile `font.conf`. A `local.conf` file is recognized. Both of which are not\ntracked in this repo as they are platform-dependent.\n\n## Gemini and Spartan client\n\nMy primary client is Gelim on the terminal and Lagrange otherwise.\n\nGelim config is at `.config/gelim`. gelim is my own gemini and spartan client\nfor the terminal that isn't a full-blown TUI and tries to stay simple whilst\noffering many features and extensibility. It's still WIP so there won't be much\nconfiguration in there yet.\n\n## TODO\n\n- [x] add LSP and completion to emacs\n- [x] `.addpath` file\n- [x] Wait for nvim 0.5 to because more widely adopted in system packages, then\n  use full lua config + lsp\n- [ ] Flesh out emacs config to support *most* of my needs for programming and writing\n- [ ] (planning) Drop Doom support\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhedyhli%2Fdotfiles","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhedyhli%2Fdotfiles","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhedyhli%2Fdotfiles/lists"}