{"id":15712237,"url":"https://github.com/dariofad/dot-emacs","last_synced_at":"2026-05-17T00:42:57.255Z","repository":{"id":158835738,"uuid":"299092934","full_name":"dariofad/dot-emacs","owner":"dariofad","description":"My Emacs dotfiles as a programmer and a Japanese learner","archived":false,"fork":false,"pushed_at":"2023-08-04T07:32:57.000Z","size":1425,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-07-06T21:43:15.634Z","etag":null,"topics":["daemon","dot-files","emacs","japanese-language","lsp","presentations","programming","use-package"],"latest_commit_sha":null,"homepage":"","language":"Emacs Lisp","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/dariofad.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-09-27T18:23:24.000Z","updated_at":"2023-06-04T12:34:52.000Z","dependencies_parsed_at":null,"dependency_job_id":"8b2612bc-72a8-4ac1-b24f-dda60590e6c0","html_url":"https://github.com/dariofad/dot-emacs","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/dariofad/dot-emacs","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dariofad%2Fdot-emacs","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dariofad%2Fdot-emacs/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dariofad%2Fdot-emacs/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dariofad%2Fdot-emacs/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dariofad","download_url":"https://codeload.github.com/dariofad/dot-emacs/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dariofad%2Fdot-emacs/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":274250508,"owners_count":25249396,"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-09-09T02:00:10.223Z","response_time":80,"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":["daemon","dot-files","emacs","japanese-language","lsp","presentations","programming","use-package"],"created_at":"2024-10-03T21:15:15.876Z","updated_at":"2026-05-17T00:42:57.178Z","avatar_url":"https://github.com/dariofad.png","language":"Emacs Lisp","funding_links":[],"categories":[],"sub_categories":[],"readme":"# dot-emacs\n\nMy `.emacs.d` configuration files.\n\nTLDR:\n\n+ little Elisp knowledge required\n+ `use-package` macros and only packages from melpa\n+ Emacs daemon (server) on the background\n+ LSP (Bash, C/C++, Go, Javascript, Python, Rust, Typescript)\n+ LaTeX support (with latex-extra, AUCTeX)\n+ Japanese language support (with mozc)\n+ utilize native-comp if available\n+ Debian-based OS\n+ keybindings optimized for Ergodox EZ layout and Regolith (i3)\n\n**TOC**\n\n+ [Some notes about my setup](#some-notes-about-my-setup)\n+ [How I use Emacs](#how-i-use-emacs)\n  - [Bash commands](#bash-commands)\n+ [Features](#features)\n  - [Window Movement](#window-movement)\n  - [C/C++](#cpp)\n  - [Go](#go)\n  - [Javascript and Typescript](#javascript-and-typescript)\n  - [Python](#python)\n  - [Rust](#rust)\n  - [LaTeX](#latex)\n  - [Japanese Input](#japanese-input)\n+ [Q\u0026A](#questions-and-answers)\n\n\n# Some notes about my setup\n\nI mostly spend my day between Chrome, an Emacs frame, and a bash\nterminal.\n\nThere are four **reasons why I use Emacs**:\n\n+ setup shared across separate machines,\n+ no need to interact with the mouse,\n+ distraction-free (or focused) editing,\n+ high productivity independently to the task (writing, coding,\n   activity planning, studying).\n   \nI prefer having a **minimal** and easy to use **configuration**, and I\ntend to avoid changing it while working (although playing with Emacs\nis super fun!). Most of the improvements are made on the days off. So,\nnew features are introduced only if when they are really needed.\n\n# How I use Emacs\n\nEveryday, I **start Emacs** on the background right after boot typing\n`sem` in the terminal (see [here](#bash-functons)). On my machine this\ntakes ~2/3 seconds.\n\nThere are two options to edit a file:\n\n+ `sem \u003cPATH_NAME\u003e` to open the file with Emacs in a new frame,\n+ `semt \u003cPATH_NAME\u003e` to open the file in with Emacs in the terminal window.\n\nTo **stop Emacs** from running in the background, I run `kem`.\n  \nThere are ways I update my Emacs configuration:\n\n1. if it's just something I want to tweak right on the spot, I open a\n   new buffer, type some Elisp and then call `eval-region`. These are\n   modifications that do not persist with a restart of the daemon,\n2. if it's something more complex, I edit and save the dotfiles, then\n   restart the daemon running with `kim; sem`.\n  \n## Bash functions\n\nAdd the following at the end of your `.bashrc`\n\n```bash\n# start emacs daemon\nsem_start(){\n    local sem_echo=$(emacsclient -a false -e 't' 2\u003e/dev/null)\n    if [[ $sem_echo != \"t\" ]]; then\n\t\t# start emacs daemon\n\t\t$(emacs --daemon)\n\t\tlocal sem_initialized=1\n    fi\n    if [ -z $sem_initialized ]; then\n\t\tif [[ $# -eq 0 ]] ; then\n\t\t\techo \"serving\"\n\t\tfi\n\tfi\n}\n\n# start emacs daemon and open filename if argument is provided\nsem(){\n\tif [[ $# -eq 0 ]] ; then\n\t\tsem_start\n\telse\n\t\tsem_start \"silence\"\n\t\temacsclient -c $1 \u0026 disown\n\tfi\n}\n\n# start emacs daemon and open filename in the terminal window if argument is provided\nsemt(){\n\tif [[ $# -eq 0 ]] ; then\n\t\tsem_start\n\telse\n\t\tsem_start \"silence\"\n\t\temacsclient -nw $1\n\tfi\n}\n\n# kill emacs daemon\nkem(){\n\temacsclient -e \"(kill-emacs)\"\n}\n```\n\n# Features\n\nTake a look at some of the features, and don't forget to peek the Q\u0026A!\n\n## Window movement\n\nJumping between windows, switching buffers attached to windows,\nchanging windows layout, jumping to previous points are very important\nfeatures. I currently rely on `ace-window` and `rotate` packages. \n\nHere is how I use them.\n\nWindow jumps: `M-o 2`\n\n\u003cimg src=\"./img/window-jump.gif\" width=\"800\"\u003e\n\nLayout rotation: `ddrol` + `Enter`, then `C-x z`\n\n\u003cimg src=\"./img/layout-rotation.gif\" width=\"800\"\u003e\n\nA couple of functions based on registers: `C-\u003cf7\u003e` and `M-\u003cf7\u003e` \n\n\u003cimg src=\"./img/top-bottom-jumps.gif\" width=\"800\"\u003e\n\n## Cpp\n\nTips:\n\n+ Install `clang` and `clangd` on the system\n+ Verify installation evaluating `(executable-find \"clangd\")`\n+ Configure the file `compile_commands.json` in the root of your\n  project\n+ See the sources to get more hints\n+ Default style set to `linux`\n\n## Go\n\nTips:\n\n+ Install the `gopls` language server with `go install\n  golang.org/x/tools/gopls@latest`\n+ Add the go binary to the `PATH` and to the list of executables\n  `exec-path`\n+ Setup hooks as explained\n  [here](https://github.com/golang/tools/blob/master/gopls/doc/emacs.md)\n  \nExample of jump to definition using LSP: `S-l g g`, then `M-,` to jump back\n\n\u003cimg src=\"./img/go-jump-to-definition.gif\" width=\"800\"\u003e\n\n## Javascript and Typescript\n\nTips:\n\n+ Install the `Deno` runtime (see [here](https://deno.land/#installation))\n+ `Deno` already ships with a language server, a linter, and a\n  formatter\n+ Use a `tsconfig.json` to enable additional options\n\n## Python\n\nTips:\n\n+ Install `direnv` to your host (so that you can use virtual environments)\n+ Add an `.envrc` to your project and use a python layout\n+ Install `isort` and `yapf` with `pip` to automatically sort import\n  definitions and format code\n+ Open a `.py` file; `lsp-pyright` automatically installs the language\n  server if not available (this is currently done via Node.js)\n+ Look [here](https://github.com/purcell/envrc) if you need to work\n  with multiple virtual environments at the same time\n  \n## Rust\n\nTips:\n\n+ Add standard library code to your toolchain with `rustup component\n  add rust-src`\n+ Install `rust-analyzer` or `rls`\n+ You can use `rustfmt` as formatter\n\n## LaTeX\n\nTips:\n\nI don't use LSP for LaTeX, as\n[AUCTeX](https://www.gnu.org/software/auctex/) works smoothly.\n\nWhen you work on a complex document split across many source files,\nyou can use variables to set up the environment (see\n[here](https://www.gnu.org/software/auctex/manual/auctex.html#Multifile)).\nThis will allow you to run `TeX-command-master` and `TeX-view` from\nany of the source files.\n\nExample of environment configuration\n\n```\n%%% Local Variables: \n%%% mode: latex\n%%% TeX-master: \"../../../main.tex\"\n%%% reftex-default-bibliography: \"../../../bib/biblio.bib\"\n%%% End:\n```\n\n## Japanese Input\n\nTips:\n\n+ Install Japanese language support on your system\n+ Install the `emacs-mozc` program\n\nExample of taking notes in Japanese and English with Org mode: toggle\nEnglish/Japanese with `\u003cf7\u003e`\n\n\u003cimg src=\"./img/org-japanese.gif\" width=\"800\"\u003e\n\n# Questions and Answers\n\nI find this setup very practical. In the following there is list of\nconsiderations and remarks that may be useful.\n\n+ How much **time** does it take to get used to Emacs? If you are\n  thinking about getting started with Emacs, don't worry too much\n  about the time investment (it should take ~2 weeks to get used to\n  how it works). Try to stick to the default keybindings (you will\n  understand the reason later). Try to use vanilla Emacs (which is\n  indeed very powerful). You don't need Elisp to be productive. Try to\n  adjust your configuration progressively, and apply little changes\n  when you need it. Using Emacs is rewarding.\n\n+ Why using a **daemon** and not separate Emacs instances? Packages\n  are loaded only once, subsequent operations are instantaneous.\n\n+ Why `use-package`? It is super easy to use, and it permits to keep\n  the files tidy and readable. There are powerful alternatives as\n  `straight.el`, but I don't feel the need to use a package manager\n  yet.\n\n+ Why the first boot is _slower_? The first time Emacs is started all\n  the package archives are fetched, then the packages are compiled and\n  loaded.\n\n+ Do you only use packages from **melpa** and melpa-stable? Yes. When\n  I work on a new machine (or a VM) the setup boils down to creating a\n  symbolic link to my dotfiles and then run the command `sem`.\n  \n+ Why `package-native-compile`? Coding inside a VM with `lsp` is a bit\n  laggy (especially with Rust). Compiling and installing Emacs with\n  native compilation enabled significantly improves the experience. If\n  native compilation is available, `package-native-compile` tells the\n  built-in package manager to perform native compilation when\n  installing a package.\n  \n+ Do you always use Emacs instead of **IDEs**? Yes, up to now there\n  has been only one exception: Android. AOSP indexing takes a lot of\n  time (Emacs may freeze). Also, app development with Android Studio\n  is easier.\n  \n+ What about **LSP configuration**? I tend to rely only on LSP basic\n  functions (again, without changing the default keybindings). In\n  general, I think that language-specific command line tools are more\n  convenient when there is the need to trace, inspect or debug a\n  project. These tools can be neatly arranged into Makefiles recipes,\n  making it easy to reproduce the tests on different hosts, by\n  different devs, and with different setups.\n  \n+ Why LSP over **Eglot**? No strong preference. A while ago LSP was\n  easier to setup and provided more functions. Since I don't need all\n  of them to be productive, I think I will try out Eglot after it will\n  be merged into Emacs.\n  \n+ Why **Regolith**? Barely no setup cost, and when you need something\n  more advanced, you can directly edit the i3 configuration. I used to\n  be an **EXWM** user. The daily experience was incredible, but from\n  time to time it required to stop my activies, making me feel a bit\n  unproductive. I no longer have the same integration I had with EXWM,\n  but in case of problem (or when Emacs freezes), I can just do a\n  `kim; sem` to kill and restart the server instead of the whole\n  session.\n\n+ Some **commands** do not work. There are Emacs packages that rely on\n  external binaries that need to be available on the host (e.g.,\n  direnv). In these cases, I just ensure there are no errors at boot\n  time (Emacs installation or startup must not fail even when a binary\n  isn't available). You can find the relevant `prerequisite(s)` in the\n  comments.\n\n+ **Updates**? I plan to update this public version of the\n  configuration files from time to time.  There are many packages that\n  I would like to use in the future, but there is no reason to rush\n  and install them now.\n  \n+ Some **keybindings** seem unnatural. That's because I use a split\n[Ergodox EZ](https://ergodox-ez.com/) with a custom layout. \n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdariofad%2Fdot-emacs","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdariofad%2Fdot-emacs","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdariofad%2Fdot-emacs/lists"}