├── .github ├── FUNDING.yml ├── ISSUE_TEMPLATE │ ├── bug_report.md │ └── feature_request.md ├── PULL_REQUEST_TEMPLATE.md └── workflows │ ├── ci.yml │ ├── markdown-lint.yml │ ├── stale.yml │ └── unstale.yml ├── .gitignore ├── .markdownlint-cli2.yaml ├── .projectile ├── CHANGELOG.md ├── CONTRIBUTING.md ├── README.md ├── core ├── prelude-core.el ├── prelude-custom.el ├── prelude-editor.el ├── prelude-global-keybindings.el ├── prelude-linux.el ├── prelude-macos.el ├── prelude-mode.el ├── prelude-packages.el ├── prelude-ui.el ├── prelude-windows.el └── prelude-wsl.el ├── docs ├── cheatsheet.png ├── configuration.md ├── contributing.md ├── css │ └── extra.css ├── faq.md ├── index.md ├── installation.md ├── modules │ ├── clojure.md │ ├── common_lisp.md │ ├── company.md │ ├── dart.md │ ├── emacs_lisp.md │ ├── erc.md │ ├── fsharp.md │ ├── go.md │ ├── index.md │ ├── lisp.md │ ├── literate-programming.md │ ├── ocaml.md │ ├── orgmode.md │ ├── programming.md │ ├── python.md │ ├── ruby.md │ ├── rust.md │ └── scheme.md ├── prelude-cheatsheet.pdf ├── prelude-cheatsheet.tex ├── support.md ├── troubleshooting.md └── usage.md ├── init.el ├── mkdocs.yml ├── modules ├── prelude-c.el ├── prelude-clojure.el ├── prelude-coffee.el ├── prelude-common-lisp.el ├── prelude-company.el ├── prelude-css.el ├── prelude-dart.el ├── prelude-elixir.el ├── prelude-emacs-lisp.el ├── prelude-erc.el ├── prelude-erlang.el ├── prelude-evil.el ├── prelude-fsharp.el ├── prelude-go.el ├── prelude-haskell.el ├── prelude-helm-everywhere.el ├── prelude-helm.el ├── prelude-ido.el ├── prelude-ivy.el ├── prelude-js.el ├── prelude-key-chord.el ├── prelude-latex.el ├── prelude-lisp.el ├── prelude-literate-programming.el ├── prelude-lsp.el ├── prelude-lua.el ├── prelude-ocaml.el ├── prelude-org.el ├── prelude-perl.el ├── prelude-programming.el ├── prelude-python.el ├── prelude-racket.el ├── prelude-ruby.el ├── prelude-rust.el ├── prelude-scala.el ├── prelude-scheme.el ├── prelude-scss.el ├── prelude-selectrum.el ├── prelude-shell.el ├── prelude-ts.el ├── prelude-vertico.el ├── prelude-web.el ├── prelude-xml.el └── prelude-yaml.el ├── personal ├── .dir-locals.el ├── .gitkeep └── preload │ └── .gitkeep ├── prelude-cheatsheet.pdf ├── readthedocs.yml ├── sample ├── prelude-modules.el └── prelude-pinned-packages.el ├── utils └── installer.sh └── vendor ├── .gitkeep └── README.md /.github/FUNDING.yml: -------------------------------------------------------------------------------- 1 | # These are supported funding model platforms 2 | 3 | github: bbatsov 4 | ko_fi: bbatsov 5 | patreon: bbatsov 6 | liberapay: bbatsov 7 | custom: https://www.paypal.me/bbatsov 8 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/bug_report.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Bug Report 3 | about: Report an issue with Emacs Prelude you've discovered. 4 | --- 5 | 6 | *Use the template below when reporting bugs. Please, make sure that 7 | you're running the latest Emacs Prelude and that the problem you're reporting 8 | hasn't been reported (and potentially fixed) already.* 9 | 10 | **Remove all of the placeholder text in your final report!** 11 | 12 | ## Expected behavior 13 | 14 | ## Actual behavior 15 | 16 | ## Steps to reproduce the problem 17 | 18 | *This is extremely important! Providing us with a reliable way to reproduce 19 | a problem will expedite its solution.* 20 | 21 | ## Environment & Version information 22 | 23 | ### Emacs version 24 | 25 | *E.g. 24.5* (use M-x emacs-version to check it if unsure) 26 | 27 | ### Operating system 28 | 29 | *E.g. Fedora 23, OS X 10.11 "El Capitan", Windows 10, etc* 30 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/feature_request.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Feature Request 3 | about: Suggest new Emacs Prelude features or improvements to existing features. 4 | --- 5 | 6 | **Is your feature request related to a problem? Please describe.** 7 | 8 | A clear and concise description of what the problem is. Ex. I'm always frustrated when [...] 9 | 10 | **Describe the solution you'd like** 11 | 12 | A clear and concise description of what you want to happen. 13 | 14 | **Describe alternatives you've considered** 15 | 16 | A clear and concise description of any alternative solutions or features you've considered. 17 | 18 | **Additional context** 19 | 20 | Add any other context or screenshots about the feature request here. 21 | -------------------------------------------------------------------------------- /.github/PULL_REQUEST_TEMPLATE.md: -------------------------------------------------------------------------------- 1 | **Replace this placeholder text with a summary of the changes in your PR. 2 | The more detailed you are, the better.** 3 | 4 | ----------------- 5 | 6 | Before submitting the PR make sure the following things have been done (and denote this 7 | by checking the relevant checkboxes): 8 | 9 | - [ ] The commits are consistent with our [contribution guidelines](../blob/master/CONTRIBUTING.md) 10 | - [ ] You've updated the [changelog](../blob/master/CHANGELOG.md) (if adding/changing user-visible functionality) 11 | - [ ] You've updated the [user manual](../blob/master/doc) (if adding/changing user-visible functionality like modules, commands, configuration options, etc) 12 | 13 | Thanks! 14 | -------------------------------------------------------------------------------- /.github/workflows/ci.yml: -------------------------------------------------------------------------------- 1 | name: CI 2 | on: push 3 | jobs: 4 | build: 5 | runs-on: ubuntu-latest 6 | steps: 7 | - name: checkout 8 | uses: actions/checkout@v1 9 | - name: install emacs 10 | run: sudo apt-get update && sudo apt-get install -y emacs 11 | - name: put prelude in the right place 12 | run: ln -s $(pwd) $HOME/.emacs.d 13 | - name: load prelude 14 | run: emacs --batch --load init.el 15 | -------------------------------------------------------------------------------- /.github/workflows/markdown-lint.yml: -------------------------------------------------------------------------------- 1 | name: Markdown Lint 2 | 3 | on: [push, pull_request] 4 | 5 | jobs: 6 | lint: 7 | runs-on: ubuntu-latest 8 | steps: 9 | - uses: actions/checkout@v4 10 | with: 11 | fetch-depth: 0 12 | - uses: tj-actions/changed-files@v45 13 | id: changed-files 14 | with: 15 | files: '**/*.md' 16 | separator: "," 17 | - uses: DavidAnson/markdownlint-cli2-action@v19 18 | if: steps.changed-files.outputs.any_changed == 'true' 19 | with: 20 | globs: ${{ steps.changed-files.outputs.all_changed_files }} 21 | separator: "," 22 | -------------------------------------------------------------------------------- /.github/workflows/stale.yml: -------------------------------------------------------------------------------- 1 | name: Close inactive issues and pull requests 2 | on: 3 | schedule: 4 | - cron: "30 1 * * *" 5 | 6 | jobs: 7 | close-issues: 8 | runs-on: ubuntu-latest 9 | permissions: 10 | issues: write 11 | pull-requests: write 12 | steps: 13 | - uses: actions/stale@v9 14 | with: 15 | days-before-issue-stale: 30 16 | days-before-issue-close: 30 17 | stale-issue-label: "stale" 18 | exempt-issue-labels: "bug, high priority, good first issue, pinned" 19 | stale-issue-message: >- 20 | This issue has been automatically marked as stale because it has not 21 | had any recent activity. It will be closed soon if no further 22 | activity occurs. Thank you for your understanding! 23 | close-issue-message: >- 24 | This issue been automatically closed due to lack of activity. Feel free to re-open it 25 | if you ever come back to it. 26 | days-before-pr-stale: 30 27 | days-before-pr-close: 30 28 | exempt-pr-labels: "high priority, good first issue, pinned" 29 | stale-pr-message: >- 30 | This pull request has been automatically marked as stale because it has not 31 | had any recent activity. It will be closed soon if no further 32 | activity occurs. Thank you for your contribution and understanding! 33 | close-pr-message: >- 34 | This pull request been automatically closed due to lack of activity. Feel free to re-open it 35 | if you ever come back to it. 36 | repo-token: ${{ secrets.GITHUB_TOKEN }} 37 | -------------------------------------------------------------------------------- /.github/workflows/unstale.yml: -------------------------------------------------------------------------------- 1 | name: Unmark issues and pull requests as stale on activity 2 | on: 3 | issue_comment: 4 | types: [created] 5 | 6 | # actions/stale does this automatically, but only once a day. 7 | # This immediately removes the label when the user creates a comment. 8 | jobs: 9 | remove-stale-label: 10 | if: (github.repository == 'bbatsov/prelude') 11 | runs-on: ubuntu-latest 12 | permissions: 13 | issues: write 14 | pull-requests: write 15 | steps: 16 | - name: Remove stale label 17 | env: 18 | GH_TOKEN: ${{ github.token }} 19 | run: gh issue edit ${{ github.event.issue.number }} --remove-label "stale" -R ${{ github.repository }} 20 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | *~ 2 | *.elc 3 | auto-save-list 4 | recentf 5 | savehist 6 | saveplace 7 | eshell 8 | elpa 9 | el-get 10 | semanticdb 11 | url 12 | ede-projects.el 13 | .DS_Store 14 | custom.el 15 | places 16 | .smex-items 17 | savefile/ 18 | projectile-bookmarks.eld 19 | session* 20 | .cask 21 | tramp 22 | /var/pcache 23 | .emacs.desktop 24 | .emacs.desktop.lock 25 | network-security.data 26 | prelude-cheatsheet.el 27 | prelude-cheatsheet.aux 28 | prelude-cheatsheet.log 29 | transient/ 30 | var/ 31 | .cache/ 32 | .lsp-session* 33 | gotools/ 34 | eln-cache/ 35 | -------------------------------------------------------------------------------- /.markdownlint-cli2.yaml: -------------------------------------------------------------------------------- 1 | config: 2 | default: true 3 | # Use only dashes for unordered lists 4 | MD004: 5 | style: dash 6 | MD007: 7 | indent: 2 8 | MD029: 9 | style: ordered 10 | # Allow inline HTML 11 | MD033: false 12 | -------------------------------------------------------------------------------- /.projectile: -------------------------------------------------------------------------------- 1 | /elpa 2 | /savefile 3 | /.cask -------------------------------------------------------------------------------- /CHANGELOG.md: -------------------------------------------------------------------------------- 1 | 2 | 3 | # Change log 4 | 5 | ## master (unreleased) 6 | 7 | ### New features 8 | 9 | - [PR 1432](https://github.com/bbatsov/prelude/pull/1432): Allow directories of custom Emacs Lisp files in `personal/preload`. 10 | - Enable `org-habits`. 11 | - Neatly track `TODO` state changes in a drawer (LOGBOOK), thereby improving readability. 12 | - Add a module to enable Literate Programming (`prelude-literal-programming.el`). 13 | - Add a Racket module. 14 | - Add a Lua module. 15 | - Auto-install `racket-mode` if needed. 16 | - Add a F# module. 17 | - Auto-install `use-package`. 18 | - Add `prelude-vertico` module. Vertico a simpler alternative to `ivy-mode` and supersedes Selectrum. 19 | - [#1421](https://github.com/bbatsov/prelude/issues/1421): Make it possible to configure the TypeScript format action using `prelude-ts-format-action`. 20 | - [#1354](https://github.com/bbatsov/prelude/issues/1354): Remove default `C--` and `C-+` keybindings to increase/decrease the font size. 21 | - Add `prelude-projectile` user option, allowing Projectile integration to be disabled. 22 | - Add `prelude-hippie-expand` user option, allowing hippie-expand support to be disabled. 23 | 24 | ### Changes 25 | 26 | - Bind all essential `avy` commands to their recommended keybindings. 27 | - Remove `company-lsp`. 28 | - Replace `yank-pop` key-binding to `counse-yank-pop` for `ivy-mode`. 29 | - The keybinding for `proced` is now enabled unconditionally. 30 | - Replace prelude-go backend with `lsp` instead of unmaintained tools. 31 | - Use `rust-analyzer` as language server for prelude-rust and provide nicer syntax highlighting with `tree-sitter`. 32 | - Use `js2-mode` for Node.js specific `.cjs` and `.mjs` extensions. 33 | - Add `prelude-undo-tree` custom variable: allows user disable 34 | undo-tree integration. Enabled by default to maintain backward-compatibility. 35 | 36 | ### Bugs fixed 37 | 38 | - [PR 1433](https://github.com/bbatsov/prelude/pull/1433): Remove a duplicate `when` call in `modules/prelude-helm-everywhere.el` causing an emacs init error when `prelude-helm-everywhere` is enabled. 39 | - Fix `company` still being visible in the mode line. 40 | - [#1335](https://github.com/bbatsov/prelude/issues/1335): Workaround 41 | for `which-key` bug causing display issues in clients to `emacs --daemon`. 42 | - Fix **Edit on GitHub** link in ReadTheDocs site. 43 | - Fix fall back to sample `prelude-modules.el` not working if user has installed to non-default location. 44 | - Stop requiring `helm-config` since upstream has removed the module. 45 | - Require `typescript-mode` using `prelude-require-packages` to avoid error upon inclusion in `personal/prelude-modules.el`. 46 | - Turn off `super-save` in `rust-mode` to prevent severe hangs during autocomplete. 47 | - Update `prelude-dart.el` to use `lsp-dart-dap-setup` instead of deprecated `dap-dart-setup` function. 48 | 49 | ## 1.1.0 (2021-02-14) 50 | 51 | ### New features 52 | 53 | - Enable `nlinum-mode` or `display-line-numbers-mode` by default. Can be disabled by setting `prelude-minimalistic-ui` to `t`. 54 | - Enable site-wide installation for Prelude. 55 | - Auto-installs `julia-mode` if needed. 56 | - Auto-install `adoc-mode` for AsciiDoc files. 57 | - Add the `ag` package. It provides a nice alternative to `grep` and has nice Projectile integration. 58 | - Added additional configuration modules for WSL (`prelude-wsl`) and Windows (`prelude-windows`). 59 | - Add `prelude-selectrum` module. Selectrum a simpler alternative to `ivy-mode`. 60 | 61 | ### Changes 62 | 63 | - [#1292](https://github.com/bbatsov/prelude/issues/1292): Add `prelude-python-mode-set-encoding-automatically` defcustom inn `prelude-python.el` module with nil default value. 64 | - [#1278](https://github.com/bbatsov/prelude/issues/1278): Don't disable `menu-bar-mode` unless `prelude-minimalistic-ui` is enabled. 65 | - [#1277](https://github.com/bbatsov/prelude/issues/1277): Make it possible to disable the creation of `Super`-based keybindings via `prelude-super-keybindings`. 66 | - Removed deprecated alias `prelude-ensure-module-deps`. 67 | - Remove `prelude-fullscreen`, as these days people can use `toggle-frame-fullscreen` instead. (it was introduced in Emacs 24.4) 68 | - Removed `beacon-mode`. 69 | - Added `transient/` to `.gitignore`. 70 | - Fallback to `sample/prelude-modules.el` in the absence of a `prelude-modules.el` in one's personal folder. 71 | - [Ruby] Don't auto-insert coding comments. 72 | - Hide (via `diminish`) `editorconfig-mode`, `super-save`, `company`, `abbrev` and `ivy` in the modeline. 73 | - Use `lsp-workspace-restart` function instead of deprecated `lsp-restart-workspace`. 74 | - Bind all online search commands under `C-c C-/` to avoid a conflict with `counsel-git` or `magit-file-dispatch`. 75 | - Bound `magit-file-mode` to `C-c g` (it's also bound to `C-c M-g` if you decide to utilize this keybinding for something else. 76 | - Added `.cache/` and `lsp-session*` to `.gitignore`. These are generated by `lsp`. 77 | 78 | ### Bugs fixed 79 | 80 | - [#1302](https://github.com/bbatsov/prelude/issues/1302): `C-a` should be bound to `org-beginning-of-line` in org-mode buffers. 81 | 82 | ## 1.0.0 (2020-09-15) 83 | 84 | Initial "stable" release after 9 years of development. 85 | -------------------------------------------------------------------------------- /CONTRIBUTING.md: -------------------------------------------------------------------------------- 1 | # Contributing 2 | 3 | If you discover issues, have ideas for improvements or new features, or 4 | want to contribute a new module, please report them to the 5 | [issue tracker][1] of the repository or submit a pull request. Please, 6 | try to follow these guidelines when you do so. 7 | 8 | ## Issue reporting 9 | 10 | - Check that the [issue has not already been reported][2]. 11 | - Check that the issue has not already been fixed in the latest code 12 | (a.k.a. `master`). 13 | - Be clear, concise and precise in your description of the problem. 14 | - Open an issue with a descriptive title and a summary in grammatically correct, 15 | complete sentences. 16 | - Include any relevant code to the issue summary. 17 | 18 | ## Pull requests 19 | 20 | - Read [how to properly contribute to open source projects on GitHub][3]. 21 | - Use a topic branch to easily amend a pull request later, if necessary. 22 | - Write [good commit messages][4]. 23 | - Update the [changelog][5]. 24 | - Use the same coding conventions as the rest of the project. 25 | - Verify your Emacs Lisp code with `checkdoc` (C-c ? d). 26 | - Open a [pull request][6] that relates to *only* one subject with a clear title 27 | and description in grammatically correct, complete sentences. 28 | 29 | [1]: https://github.com/bbatsov/prelude/issues 30 | [2]: https://github.com/bbatsov/prelude/issues?q=is:issue 31 | [3]: http://gun.io/blog/how-to-github-fork-branch-and-pull-request 32 | [4]: http://tbaggery.com/2008/04/19/a-note-about-git-commit-messages.html 33 | [5]: https://github.com/bbatsov/prelude/blob/master/CHANGELOG.md 34 | [6]: https://help.github.com/articles/using-pull-requests 35 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | [![License GPL 3][badge-license]](http://www.gnu.org/licenses/gpl-3.0.txt) 2 | [![CI](https://github.com/bbatsov/prelude/workflows/CI/badge.svg)](https://github.com/bbatsov/prelude/actions/workflows/ci.yml) 3 | [![Patreon](https://img.shields.io/badge/patreon-donate-orange.svg)](https://www.patreon.com/bbatsov) 4 | 5 | Emacs Prelude 6 | ============= 7 | 8 | Prelude is an Emacs distribution that aims to enhance the default 9 | Emacs experience. Prelude alters a lot of the default settings, 10 | bundles a plethora of additional packages and adds its own core 11 | library to the mix. The final product offers an easy to use Emacs 12 | configuration for Emacs newcomers and lots of additional power for 13 | Emacs power users. 14 | 15 | Prelude is compatible **ONLY with GNU Emacs 25.1+**. In general you're 16 | advised to always run Prelude with the latest stable Emacs release. 17 | 18 | You can support the development of Prelude via 19 | [GitHub Sponsors](https://github.com/sponsors/bbatsov), 20 | [ko-fi](https://ko-fi.com/bbatsov), 21 | [PayPal](https://www.paypal.me/bbatsov) and 22 | [Patreon](https://www.patreon.com/bbatsov). 23 | 24 | ## Features 25 | 26 | - Improved UX, that's still in line with Emacs traditions 27 | - Sane defaults of baseline Emacs functionality 28 | - Automatic installation of many major programming modes on demand 29 | - A curated set of 3rd party packages to enhance the base functionality 30 | - Simple modular architecture 31 | - Easy customization 32 | 33 | Check out our [user manual](https://prelude.emacsredux.com) for more information. 34 | 35 | ## Fast Forward 36 | 37 | Assuming you're using an Unix-like OS (`*BSD`, `GNU/Linux`, `macOS`, `Solaris`, 38 | etc), you already have a recent version of Emacs installed, as well as `git` & `curl` you 39 | can skip the whole manual and just type in your favorite shell the 40 | following command: 41 | 42 | ```shell 43 | curl -L https://git.io/epre | sh 44 | ``` 45 | 46 | You can now power up your Emacs, sit back and enjoy Prelude. 47 | 48 | There are two environment variables you can use to control the 49 | source repository and the installation directory. To change the 50 | installation directory: 51 | 52 | ```shell 53 | export PRELUDE_INSTALL_DIR="$HOME/.emacs.d" && curl -L https://github.com/bbatsov/prelude/raw/master/utils/installer.sh | sh 54 | ``` 55 | 56 | To change the source repository: 57 | 58 | ```shell 59 | export PRELUDE_URL="https://github.com/yourname/prelude.git" && curl -L https://github.com/bbatsov/prelude/raw/master/utils/installer.sh | sh 60 | ``` 61 | 62 | Note that the installer will back up any existing `.emacs` file or 63 | `.emacs.d` since it will unpack Prelude's code in `.emacs.d`. If 64 | you're doing a manual install make sure you don't have a `.emacs` file 65 | or back up your existing `.emacs.d` directory manually. 66 | 67 | **Important:** Don't forget to adjust your `prelude-modules.el` file in your personal directory 68 | once the installation is done. By default most of the modules 69 | that ship with Prelude are **not** loaded. 70 | 71 | ### Try Before You "Buy" 72 | 73 | If you're using Emacs 29+ there's a simple way to try Prelude (or any other Emacs distro for that matter). 74 | Just clone Prelude's repo somewhere and do the following: 75 | 76 | ```shell 77 | emacs --init-dir ~/path/to/prelude 78 | ``` 79 | 80 | ## Philosophy 81 | 82 | Prelude's philosophy is quite simple: 83 | 84 | - simple 85 | - easy to understand and extend 86 | - stable 87 | - a foundation for you to build upon, as opposed to some end-user product 88 | 89 | This means that it intentionally doesn't pack all the bells and whistles that it could. 90 | Prelude aims to enhance the classic Emacs experience without deviating a lot from it - e.g. 91 | it would never enable something like `evil-mode` (vim keybindings) by default and so on. 92 | 93 | All the third-party packages that it bundles are carefully vetted and are known to be of 94 | good quality and to have reliable maintainers. That generally means that Prelude's unlikely 95 | to immediate adopt some shiny new package, that has established tried and true alternatives. 96 | 97 | In practice this translates to the following: 98 | 99 | - Prelude is less opinionated than distros like Spacemacs and Doom Emacs (meaning it's closer to the standard Emacs experience) 100 | - Prelude installs relatively few additional packages by default 101 | - Most modules in Prelude are opt-in instead of opt-out (you'll notice the default config enables only a handful of modules) 102 | - Most modules (e.g. modules for programming languages) are pretty short and feature setup only for essential packages (in some cases that be just the major mode for the language in question) 103 | - You don't really need to track Prelude's upstream - you're encouraged to just fork it and use it as the basis for your own configuration. 104 | 105 | Remember that the ultimate goal of every Emacs user is to create an Emacs setup that reflects their own experience, needs, goals and ideas. Just like Lisp, 106 | Emacs is nothing but a raw building material for the perfect editing experience. 107 | 108 | More installation options are discussed [here](https://prelude.emacsredux.com/en/latest/installation/). 109 | 110 | ## User Manual 111 | 112 | While Emacs Prelude is pretty simple at its core, it does have some specifics that 113 | are worth learning - e.g. configuration options, load order of modules and personal settings 114 | and so on. 115 | 116 | Check out our [user manual](https://prelude.emacsredux.com) for more information. 117 | 118 | You can also find a lot of information about specific Prelude features and the rationale behind them on 119 | my Emacs blog [Emacs Redux](https://emacsredux.com). 120 | 121 | ## crux and super-save 122 | 123 | A lot of utility commands that used to be part of Prelude were eventually extracted to the [crux](https://github.com/bbatsov/crux) package, 124 | so they'd be easily available to more people. 125 | These days Prelude simply depends on that package. 126 | 127 | The [super-save](https://github.com/bbatsov/super-save) package also used to be part of Prelude in the past. 128 | 129 | ## Known issues 130 | 131 | Check out the project's 132 | [issue list](https://github.com/bbatsov/prelude/issues?sort=created&direction=desc&state=open) 133 | a list of unresolved issues. By the way - feel free to fix any of them 134 | and send me a pull request. :-) 135 | 136 | ## Support 137 | 138 | Support is available via several channels: 139 | 140 | - Prelude's Google Group 141 | - Prelude's Freenode channel (`#prelude-emacs`) 142 | - [Gitter](https://gitter.im/bbatsov/prelude) 143 | 144 | ## Contributors 145 | 146 | Here's a [list](https://github.com/bbatsov/prelude/contributors) of all the people who have contributed to the 147 | development of Emacs Prelude. 148 | 149 | ## Bugs & Improvements 150 | 151 | Bug reports and suggestions for improvements are always 152 | welcome. GitHub pull requests are even better! :-) 153 | 154 | ## License 155 | 156 | Copyright © 2011-2025 Bozhidar Batsov and 157 | [contributors](https://github.com/bbatsov/prelude/contributors). 158 | 159 | Distributed under the GNU General Public License, version 3 160 | 161 | [badge-license]: https://img.shields.io/badge/license-GPL_3-green.svg 162 | -------------------------------------------------------------------------------- /core/prelude-core.el: -------------------------------------------------------------------------------- 1 | ;;; prelude-core.el --- Emacs Prelude: Core Prelude functions. 2 | ;; 3 | ;; Copyright © 2011-2025 Bozhidar Batsov 4 | ;; 5 | ;; Author: Bozhidar Batsov 6 | ;; URL: https://github.com/bbatsov/prelude 7 | 8 | ;; This file is not part of GNU Emacs. 9 | 10 | ;;; Commentary: 11 | 12 | ;; Here are the definitions of most of the general-purpose functions and 13 | ;; commands added by Prelude. Some modules define additional module-specific 14 | ;; functions and commands. 15 | ;; 16 | ;; Note that many of the original core Prelude commands were extracted to the 17 | ;; crux package (Prelude installs it automatically). Prelude's auto-save 18 | ;; functionality was extracted to the super-save package. 19 | 20 | ;;; License: 21 | 22 | ;; This program is free software; you can redistribute it and/or 23 | ;; modify it under the terms of the GNU General Public License 24 | ;; as published by the Free Software Foundation; either version 3 25 | ;; of the License, or (at your option) any later version. 26 | ;; 27 | ;; This program is distributed in the hope that it will be useful, 28 | ;; but WITHOUT ANY WARRANTY; without even the implied warranty of 29 | ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 30 | ;; GNU General Public License for more details. 31 | ;; 32 | ;; You should have received a copy of the GNU General Public License 33 | ;; along with GNU Emacs; see the file COPYING. If not, write to the 34 | ;; Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, 35 | ;; Boston, MA 02110-1301, USA. 36 | 37 | ;;; Code: 38 | 39 | (require 'cl-lib) 40 | 41 | (defun prelude-buffer-mode (buffer-or-name) 42 | "Retrieve the `major-mode' of BUFFER-OR-NAME." 43 | (with-current-buffer buffer-or-name 44 | major-mode)) 45 | 46 | (defun prelude-search (query-url prompt) 47 | "Open the search url constructed with the QUERY-URL. 48 | PROMPT sets the `read-string prompt." 49 | (browse-url 50 | (concat query-url 51 | (url-hexify-string 52 | (if mark-active 53 | (buffer-substring (region-beginning) (region-end)) 54 | (read-string prompt)))))) 55 | 56 | (defmacro prelude-install-search-engine (search-engine-name search-engine-url search-engine-prompt) 57 | "Given some information regarding a search engine, install the interactive command to search through them" 58 | `(defun ,(intern (format "prelude-%s" search-engine-name)) () 59 | ,(format "Search %s with a query or region if any." search-engine-name) 60 | (interactive) 61 | (prelude-search ,search-engine-url ,search-engine-prompt))) 62 | 63 | (prelude-install-search-engine "google" "http://www.google.com/search?q=" "Google: ") 64 | (prelude-install-search-engine "youtube" "http://www.youtube.com/results?search_query=" "Search YouTube: ") 65 | (prelude-install-search-engine "github" "https://github.com/search?q=" "Search GitHub: ") 66 | (prelude-install-search-engine "duckduckgo" "https://duckduckgo.com/?t=lm&q=" "Search DuckDuckGo: ") 67 | 68 | (defun prelude-recompile-init () 69 | "Byte-compile all your dotfiles again." 70 | (interactive) 71 | (byte-recompile-directory prelude-dir 0)) 72 | 73 | (defvar prelude-tips 74 | '("Press to open a file with external program." 75 | "Press to navigate a project's files." 76 | "Press to open a recently visited file." 77 | "Press to run grep on a project." 78 | "Press to switch between projects." 79 | "Press to expand the selected region." 80 | "Press to search in Google." 81 | "Press to search in GitHub." 82 | "Press to search in YouTube." 83 | "Press to search in DuckDuckGo." 84 | "Press to rename the current buffer and the file it's visiting if any." 85 | "Press to open a terminal in Emacs." 86 | "Press to kill all the buffers, but the active one." 87 | "Press to run magit-status." 88 | "Press to delete the current file and buffer." 89 | "Press to swap two windows." 90 | "Press or to open a line beneath the current one." 91 | "Press to open a line above the current one." 92 | "Press in a Elisp buffer to launch an interactive Elisp shell." 93 | "Press to kill a line backwards." 94 | "Press or to kill the whole line." 95 | "Press or to join lines." 96 | "Press or to jump to the start of a word in any visible window." 97 | "Press to toggle the menu bar." 98 | "Explore the Prelude menu to find out about some of Prelude extensions to Emacs." 99 | "Access the official Emacs manual by pressing .")) 100 | 101 | (defun prelude-tip-of-the-day () 102 | "Display a random entry from `prelude-tips'." 103 | (interactive) 104 | (when (and prelude-tips (not (window-minibuffer-p))) 105 | ;; pick a new random seed 106 | (random t) 107 | (message 108 | (concat "Prelude tip: " (nth (random (length prelude-tips)) prelude-tips))))) 109 | 110 | (defun prelude-eval-after-init (form) 111 | "Add `(lambda () FORM)' to `after-init-hook'. 112 | 113 | If Emacs has already finished initialization, also eval FORM immediately." 114 | (let ((func (list 'lambda nil form))) 115 | (add-hook 'after-init-hook func) 116 | (when after-init-time 117 | (eval form)))) 118 | 119 | (require 'epl) 120 | 121 | (defun prelude-update () 122 | "Update Prelude to its latest version." 123 | (interactive) 124 | (when (y-or-n-p "Do you want to update Prelude? ") 125 | (message "Updating installed packages...") 126 | (epl-upgrade) 127 | (message "Updating Prelude...") 128 | (cd prelude-dir) 129 | (shell-command "git pull") 130 | (prelude-recompile-init) 131 | (message "Update finished. Restart Emacs to complete the process."))) 132 | 133 | (defun prelude-update-packages (&optional arg) 134 | "Update Prelude's packages. 135 | This includes package installed via `prelude-require-package'. 136 | 137 | With a prefix ARG updates all installed packages." 138 | (interactive "P") 139 | (when (y-or-n-p "Do you want to update Prelude's packages? ") 140 | (if arg 141 | (epl-upgrade) 142 | (epl-upgrade (cl-remove-if-not (lambda (p) (memq (epl-package-name p) prelude-packages)) 143 | (epl-installed-packages)))) 144 | (message "Update finished. Restart Emacs to complete the process."))) 145 | 146 | (defun prelude-wrap-with (s) 147 | "Create a wrapper function for smartparens using S." 148 | `(lambda (&optional arg) 149 | (interactive "P") 150 | (sp-wrap-with-pair ,s))) 151 | 152 | (provide 'prelude-core) 153 | ;;; prelude-core.el ends here 154 | -------------------------------------------------------------------------------- /core/prelude-custom.el: -------------------------------------------------------------------------------- 1 | ;;; prelude-custom.el --- Emacs Prelude: Prelude's customizable variables. 2 | ;; 3 | ;; Copyright © 2011-2025 Bozhidar Batsov 4 | ;; 5 | ;; Author: Bozhidar Batsov 6 | ;; URL: https://github.com/bbatsov/prelude 7 | 8 | ;; This file is not part of GNU Emacs. 9 | 10 | ;;; Commentary: 11 | 12 | ;; Refinements of the core editing experience in Emacs. 13 | 14 | ;;; License: 15 | 16 | ;; This program is free software; you can redistribute it and/or 17 | ;; modify it under the terms of the GNU General Public License 18 | ;; as published by the Free Software Foundation; either version 3 19 | ;; of the License, or (at your option) any later version. 20 | ;; 21 | ;; This program is distributed in the hope that it will be useful, 22 | ;; but WITHOUT ANY WARRANTY; without even the implied warranty of 23 | ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 24 | ;; GNU General Public License for more details. 25 | ;; 26 | ;; You should have received a copy of the GNU General Public License 27 | ;; along with GNU Emacs; see the file COPYING. If not, write to the 28 | ;; Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, 29 | ;; Boston, MA 02110-1301, USA. 30 | 31 | ;;; Code: 32 | 33 | ;; customize 34 | (defgroup prelude nil 35 | "Emacs Prelude configuration." 36 | :prefix "prelude-" 37 | :group 'convenience) 38 | 39 | (defcustom prelude-minimalistic-ui nil 40 | "Controls whether to display the menu-bar and line numbers. 41 | Note that the toolbar is always hidden regardless of this setting." 42 | :type 'boolean 43 | :group 'prelude 44 | :package-version '(prelude . "1.1")) 45 | 46 | (defcustom prelude-super-keybindings t 47 | "Controls whether to use the Super key in keybindings. 48 | They can be problematic in some operating systems (e.g. Windows) 49 | or desktop environments that make heavy use of them." 50 | :type 'boolean 51 | :group 'prelude 52 | :package-version '(prelude . "1.1")) 53 | 54 | (defcustom prelude-auto-save t 55 | "Non-nil values enable Prelude's auto save." 56 | :type 'boolean 57 | :group 'prelude) 58 | 59 | (defcustom prelude-guru t 60 | "Non-nil values enable `guru-mode'." 61 | :type 'boolean 62 | :group 'prelude) 63 | 64 | (defcustom prelude-whitespace t 65 | "Non-nil values enable Prelude's whitespace visualization." 66 | :type 'boolean 67 | :group 'prelude) 68 | 69 | (defcustom prelude-undo-tree t 70 | "Non-nil values enable Prelude's undo-tree integration." 71 | :type 'boolean 72 | :group 'prelude) 73 | 74 | (defcustom prelude-clean-whitespace-on-save t 75 | "Cleanup whitespace from file before it's saved. 76 | Will only occur if `prelude-whitespace' is also enabled." 77 | :type 'boolean 78 | :group 'prelude) 79 | 80 | (defcustom prelude-flyspell t 81 | "Non-nil values enable Prelude's flyspell support." 82 | :type 'boolean 83 | :group 'prelude) 84 | 85 | (defcustom prelude-user-init-file (expand-file-name "personal/" 86 | user-emacs-directory) 87 | "Path to your personal customization file. 88 | Prelude recommends you only put personal customizations in the 89 | personal folder. This variable allows you to specify a specific 90 | folder as the one that should be visited when running 91 | `crux-find-user-init-file'. This can be easily set to the desired buffer 92 | in Lisp by putting `(setq prelude-user-init-file load-file-name)' 93 | in the desired elisp file." 94 | :type 'string 95 | :group 'prelude) 96 | 97 | (defcustom prelude-indent-sensitive-modes 98 | '(conf-mode coffee-mode haml-mode python-mode slim-mode yaml-mode) 99 | "Modes for which auto-indenting is suppressed." 100 | :type 'list 101 | :group 'prelude) 102 | 103 | (defcustom prelude-format-on-save t 104 | "Run mode specific format on file before it's saved. 105 | Currently only applies to tide-mode." 106 | :type 'boolean 107 | :group 'prelude) 108 | 109 | (defcustom prelude-yank-indent-modes '(LaTeX-mode TeX-mode) 110 | "Modes in which to indent regions that are yanked (or yank-popped). 111 | Only modes that don't derive from `prog-mode' should be listed here." 112 | :type 'list 113 | :group 'prelude) 114 | 115 | (defcustom prelude-yank-indent-threshold 1000 116 | "Threshold (# chars) over which indentation does not automatically occur." 117 | :type 'number 118 | :group 'prelude) 119 | 120 | (defcustom prelude-theme 'zenburn 121 | "The default color theme, change this in your /personal/preload config." 122 | :type 'symbol 123 | :group 'prelude) 124 | 125 | (defcustom prelude-projectile t 126 | "Non-nil values enable Prelude's Projectile integration." 127 | :type 'boolean 128 | :group 'prelude) 129 | 130 | (defcustom prelude-hippie-expand t 131 | "Non-nil values enable Prelude's hippie-expand support." 132 | :type 'boolean 133 | :group 'prelude) 134 | 135 | (provide 'prelude-custom) 136 | 137 | ;;; prelude-custom.el ends here 138 | -------------------------------------------------------------------------------- /core/prelude-global-keybindings.el: -------------------------------------------------------------------------------- 1 | ;;; prelude-global-keybindings.el --- Emacs Prelude: some useful keybindings. 2 | ;; 3 | ;; Copyright © 2011-2025 Bozhidar Batsov 4 | ;; 5 | ;; Author: Bozhidar Batsov 6 | ;; URL: https://github.com/bbatsov/prelude 7 | 8 | ;; This file is not part of GNU Emacs. 9 | 10 | ;;; Commentary: 11 | 12 | ;; Lots of useful keybindings. 13 | 14 | ;;; License: 15 | 16 | ;; This program is free software; you can redistribute it and/or 17 | ;; modify it under the terms of the GNU General Public License 18 | ;; as published by the Free Software Foundation; either version 3 19 | ;; of the License, or (at your option) any later version. 20 | ;; 21 | ;; This program is distributed in the hope that it will be useful, 22 | ;; but WITHOUT ANY WARRANTY; without even the implied warranty of 23 | ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 24 | ;; GNU General Public License for more details. 25 | ;; 26 | ;; You should have received a copy of the GNU General Public License 27 | ;; along with GNU Emacs; see the file COPYING. If not, write to the 28 | ;; Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, 29 | ;; Boston, MA 02110-1301, USA. 30 | 31 | ;;; Code: 32 | 33 | ;; Align your code in a pretty way. 34 | (global-set-key (kbd "C-x \\") 'align-regexp) 35 | 36 | ;; Window switching. (C-x o goes to the next window) 37 | (global-set-key (kbd "C-x O") (lambda () 38 | (interactive) 39 | (other-window -1))) ;; back one 40 | 41 | ;; Indentation help 42 | (global-set-key (kbd "C-^") 'crux-top-join-line) 43 | 44 | ;; Start proced in a similar manner to dired 45 | (global-set-key (kbd "C-x p") 'proced) 46 | 47 | ;; Start eshell or switch to it if it's active. 48 | (global-set-key (kbd "C-x m") 'eshell) 49 | 50 | ;; Start a new eshell even if one is active. 51 | (global-set-key (kbd "C-x M") (lambda () (interactive) (eshell t))) 52 | 53 | ;; Start a regular shell if you prefer that. 54 | (global-set-key (kbd "C-x M-m") 'shell) 55 | 56 | ;; If you want to be able to M-x without meta 57 | (global-set-key (kbd "C-x C-m") 'smex) 58 | 59 | ;; A complementary binding to the apropos-command (C-h a) 60 | (define-key 'help-command "A" 'apropos) 61 | 62 | ;; A quick major mode help with discover-my-major 63 | (define-key 'help-command (kbd "C-m") 'discover-my-major) 64 | 65 | (define-key 'help-command (kbd "C-f") 'find-function) 66 | (define-key 'help-command (kbd "C-k") 'find-function-on-key) 67 | (define-key 'help-command (kbd "C-v") 'find-variable) 68 | (define-key 'help-command (kbd "C-l") 'find-library) 69 | 70 | (define-key 'help-command (kbd "C-i") 'info-display-manual) 71 | 72 | ;; replace zap-to-char functionality with the more powerful zop-to-char 73 | (global-set-key (kbd "M-z") 'zop-up-to-char) 74 | (global-set-key (kbd "M-Z") 'zop-to-char) 75 | 76 | ;; kill lines backward 77 | (global-set-key (kbd "C-") 'crux-kill-line-backwards) 78 | 79 | (global-set-key [remap kill-whole-line] 'crux-kill-whole-line) 80 | 81 | ;; Activate occur easily inside isearch 82 | (define-key isearch-mode-map (kbd "C-o") 'isearch-occur) 83 | 84 | (when prelude-hippie-expand 85 | ;; use hippie-expand instead of dabbrev 86 | (global-set-key (kbd "M-/") 'hippie-expand)) 87 | 88 | ;; replace buffer-menu with ibuffer 89 | (global-set-key (kbd "C-x C-b") 'ibuffer) 90 | 91 | ;; toggle menu-bar visibility 92 | (global-set-key (kbd "") 'menu-bar-mode) 93 | 94 | ;; Magit creates some global keybindings by default 95 | ;; but it's a nice to complement them with this one 96 | (global-set-key (kbd "C-c g") 'magit-file-dispatch) 97 | 98 | (global-set-key (kbd "C-=") 'er/expand-region) 99 | 100 | ;; recommended avy keybindings 101 | (global-set-key (kbd "C-:") 'avy-goto-char) 102 | (global-set-key (kbd "C-'") 'avy-goto-char-2) 103 | (global-set-key (kbd "M-g f") 'avy-goto-line) 104 | (global-set-key (kbd "M-g w") 'avy-goto-word-1) 105 | (global-set-key (kbd "M-g e") 'avy-goto-word-0) 106 | 107 | ;; additional avy keybindings 108 | (global-set-key (kbd "s-,") 'avy-goto-char) 109 | (global-set-key (kbd "s-.") 'avy-goto-word-or-subword-1) 110 | (global-set-key (kbd "C-c v") 'avy-goto-word-or-subword-1) 111 | 112 | ;; improved window navigation with ace-window 113 | (global-set-key (kbd "s-w") 'ace-window) 114 | (global-set-key [remap other-window] 'ace-window) 115 | 116 | (provide 'prelude-global-keybindings) 117 | 118 | ;;; prelude-global-keybindings.el ends here 119 | -------------------------------------------------------------------------------- /core/prelude-linux.el: -------------------------------------------------------------------------------- 1 | ;;; prelude-linux.el --- Emacs Prelude: linux specific settings. 2 | ;; 3 | ;; Copyright © 2011-2025 Bozhidar Batsov 4 | ;; 5 | ;; Author: Stanislav Arnaudov 6 | ;; URL: https://github.com/bbatsov/prelude 7 | 8 | ;; This file is not part of GNU Emacs. 9 | 10 | ;;; Commentary: 11 | 12 | ;; Some Linux specific stuff. 13 | 14 | ;;; License: 15 | 16 | ;; This program is free software; you can redistribute it and/or 17 | ;; modify it under the terms of the GNU General Public License 18 | ;; as published by the Free Software Foundation; either version 3 19 | ;; of the License, or (at your option) any later version. 20 | ;; 21 | ;; This program is distributed in the hope that it will be useful, 22 | ;; but WITHOUT ANY WARRANTY; without even the implied warranty of 23 | ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 24 | ;; GNU General Public License for more details. 25 | ;; 26 | ;; You should have received a copy of the GNU General Public License 27 | ;; along with GNU Emacs; see the file COPYING. If not, write to the 28 | ;; Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, 29 | ;; Boston, MA 02110-1301, USA. 30 | 31 | ;;; Code: 32 | 33 | ;; On Linux Emacs doesn't use the shell PATH if it's not started from 34 | ;; the shell. Let's fix that: 35 | (prelude-require-packages '(exec-path-from-shell)) 36 | 37 | (require 'exec-path-from-shell) 38 | (exec-path-from-shell-initialize) 39 | 40 | (provide 'prelude-linux) 41 | ;;; prelude-linux.el ends here 42 | -------------------------------------------------------------------------------- /core/prelude-macos.el: -------------------------------------------------------------------------------- 1 | ;;; prelude-macos.el --- Emacs Prelude: macOS specific settings. 2 | ;; 3 | ;; Copyright © 2011-2025 Bozhidar Batsov 4 | ;; 5 | ;; Author: Bozhidar Batsov 6 | ;; URL: https://github.com/bbatsov/prelude 7 | 8 | ;; This file is not part of GNU Emacs. 9 | 10 | ;;; Commentary: 11 | 12 | ;; Some macOS specific stuff. 13 | 14 | ;;; License: 15 | 16 | ;; This program is free software; you can redistribute it and/or 17 | ;; modify it under the terms of the GNU General Public License 18 | ;; as published by the Free Software Foundation; either version 3 19 | ;; of the License, or (at your option) any later version. 20 | ;; 21 | ;; This program is distributed in the hope that it will be useful, 22 | ;; but WITHOUT ANY WARRANTY; without even the implied warranty of 23 | ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 24 | ;; GNU General Public License for more details. 25 | ;; 26 | ;; You should have received a copy of the GNU General Public License 27 | ;; along with GNU Emacs; see the file COPYING. If not, write to the 28 | ;; Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, 29 | ;; Boston, MA 02110-1301, USA. 30 | 31 | ;;; Code: 32 | 33 | ;; On macOS Emacs doesn't use the shell PATH if it's not started from 34 | ;; the shell. Let's fix that: 35 | (prelude-require-packages '(exec-path-from-shell)) 36 | 37 | (require 'exec-path-from-shell) 38 | (exec-path-from-shell-initialize) 39 | 40 | ;; It's all in the Meta 41 | (setq ns-function-modifier 'hyper) 42 | 43 | (defun prelude-swap-meta-and-super () 44 | "Swap the mapping of Meta and Super. 45 | Very useful for people using their Mac with a 46 | Windows external keyboard from time to time." 47 | (interactive) 48 | (if (eq mac-command-modifier 'super) 49 | (progn 50 | (setq mac-command-modifier 'meta) 51 | (setq mac-option-modifier 'super) 52 | (message "Command is now bound to META and Option is bound to SUPER.")) 53 | (setq mac-command-modifier 'super) 54 | (setq mac-option-modifier 'meta) 55 | (message "Command is now bound to SUPER and Option is bound to META."))) 56 | 57 | (define-key prelude-mode-map (kbd "C-c w") 'prelude-swap-meta-and-super) 58 | 59 | ;; There's no point in hiding the menu bar on macOS, so let's not do it 60 | (menu-bar-mode +1) 61 | 62 | ;; Enable emoji, and stop the UI from freezing when trying to display them. 63 | (when (fboundp 'set-fontset-font) 64 | (set-fontset-font t 'unicode "Apple Color Emoji" nil 'prepend)) 65 | 66 | 67 | (provide 'prelude-macos) 68 | ;;; prelude-macos.el ends here 69 | -------------------------------------------------------------------------------- /core/prelude-mode.el: -------------------------------------------------------------------------------- 1 | ;;; prelude-mode.el --- Emacs Prelude: minor mode 2 | ;; 3 | ;; Copyright © 2011-2025 Bozhidar Batsov 4 | ;; 5 | ;; Author: Bozhidar Batsov 6 | ;; URL: https://github.com/bbatsov/prelude 7 | 8 | ;; This file is not part of GNU Emacs. 9 | 10 | ;;; Commentary: 11 | 12 | ;; A minor mode defining a local keymap, plus a menu. 13 | 14 | ;;; License: 15 | 16 | ;; This program is free software; you can redistribute it and/or 17 | ;; modify it under the terms of the GNU General Public License 18 | ;; as published by the Free Software Foundation; either version 3 19 | ;; of the License, or (at your option) any later version. 20 | ;; 21 | ;; This program is distributed in the hope that it will be useful, 22 | ;; but WITHOUT ANY WARRANTY; without even the implied warranty of 23 | ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 24 | ;; GNU General Public License for more details. 25 | ;; 26 | ;; You should have received a copy of the GNU General Public License 27 | ;; along with GNU Emacs; see the file COPYING. If not, write to the 28 | ;; Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, 29 | ;; Boston, MA 02110-1301, USA. 30 | 31 | ;;; Code: 32 | (require 'easymenu) 33 | (require 'imenu-anywhere) 34 | (require 'crux) 35 | 36 | (defvar prelude-mode-map 37 | (let ((map (make-sparse-keymap))) 38 | (define-key map (kbd "C-c o") 'crux-open-with) 39 | (define-key map (kbd "C-c C-/ g") 'prelude-google) 40 | (define-key map (kbd "C-c C-/ h") 'prelude-github) 41 | (define-key map (kbd "C-c C-/ y") 'prelude-youtube) 42 | (define-key map (kbd "C-c C-/ d") 'prelude-duckduckgo) 43 | ;; mimic popular IDEs binding, note that it doesn't work in a terminal session 44 | (define-key map (kbd "C-a") 'crux-move-beginning-of-line) 45 | (define-key map [(shift return)] 'crux-smart-open-line) 46 | (define-key map (kbd "M-o") 'crux-smart-open-line) 47 | (define-key map [(control shift return)] 'crux-smart-open-line-above) 48 | (define-key map [(control shift up)] 'move-text-up) 49 | (define-key map [(control shift down)] 'move-text-down) 50 | (define-key map [(meta shift up)] 'move-text-up) 51 | (define-key map [(meta shift down)] 'move-text-down) 52 | (define-key map (kbd "C-c n") 'crux-cleanup-buffer-or-region) 53 | (define-key map (kbd "C-c f") 'crux-recentf-find-file) 54 | (define-key map (kbd "C-M-z") 'crux-indent-defun) 55 | (define-key map (kbd "C-c u") 'crux-view-url) 56 | (define-key map (kbd "C-c e") 'crux-eval-and-replace) 57 | (define-key map (kbd "C-c s") 'crux-swap-windows) 58 | (define-key map (kbd "C-c D") 'crux-delete-file-and-buffer) 59 | (define-key map (kbd "C-c d") 'crux-duplicate-current-line-or-region) 60 | (define-key map (kbd "C-c M-d") 'crux-duplicate-and-comment-current-line-or-region) 61 | (define-key map (kbd "C-c r") 'crux-rename-buffer-and-file) 62 | (define-key map (kbd "C-c t") 'crux-visit-term-buffer) 63 | (define-key map (kbd "C-c k") 'crux-kill-other-buffers) 64 | (define-key map (kbd "C-c TAB") 'crux-indent-rigidly-and-copy-to-clipboard) 65 | (define-key map (kbd "C-c I") 'crux-find-user-init-file) 66 | (define-key map (kbd "C-c S") 'crux-find-shell-init-file) 67 | (define-key map (kbd "C-c i") 'imenu-anywhere) 68 | (when prelude-projectile 69 | ;; extra prefix for projectile 70 | (when prelude-super-keybindings 71 | (define-key map (kbd "s-p") 'projectile-command-map)) 72 | (define-key map (kbd "C-c p") 'projectile-command-map)) 73 | ;; make some use of the Super key 74 | (when prelude-super-keybindings 75 | ;; crux 76 | (define-key map (kbd "s-r") 'crux-recentf-find-file) 77 | (define-key map (kbd "s-j") 'crux-top-join-line) 78 | (define-key map (kbd "s-k") 'crux-kill-whole-line) 79 | (define-key map (kbd "s-o") 'crux-smart-open-line-above) 80 | ;; magit 81 | (define-key map (kbd "s-m m") 'magit-status) 82 | (define-key map (kbd "s-m j") 'magit-dispatch) 83 | (define-key map (kbd "s-m k") 'magit-file-dispatch) 84 | (define-key map (kbd "s-m l") 'magit-log-buffer-file) 85 | (define-key map (kbd "s-m b") 'magit-blame) 86 | ;; misc 87 | (when prelude-hippie-expand 88 | (define-key map (kbd "s-/") 'hippie-expand))) 89 | (easy-menu-define prelude-mode-menu map 90 | "Prelude's menu." 91 | '("Prelude" 92 | ("Files" 93 | ["Open with..." crux-open-with] 94 | ["Re-open as root" crux-reopen-as-root] 95 | ["Delete file and buffer" crux-delete-file-and-buffer] 96 | ["Rename buffer and file" crux-rename-buffer-and-file] 97 | ["Find init file" crux-find-user-init-file] 98 | ["Find custom file" crux-find-user-custom-file] 99 | ["Find shell config file" crux-find-shell-init-file]) 100 | ("Buffers" 101 | ["Clean up buffer or region" crux-cleanup-buffer-or-region] 102 | ["Kill other buffers" crux-kill-other-buffers]) 103 | ("Editing" 104 | ["Go to beginning of line" crux-move-beginning-of-line] 105 | ["Kill line" crux-smart-kill-line] 106 | ["Kill whole line" crux-kill-whole-line] 107 | ["Insert empty line below" crux-smart-open-line] 108 | ["Insert empty line above" crux-smart-open-line-above] 109 | ["Move up" move-text-up] 110 | ["Move down" move-text-down] 111 | ["Duplicate line or region" crux-duplicate-current-line-or-region] 112 | ["Indent rigidly and copy to clipboard" crux-indent-rigidly-and-copy-to-clipboard] 113 | ["Indent defun" crux-indent-defun] 114 | ["Insert date" crux-insert-date] 115 | ["Eval and replace" crux-eval-and-replace]) 116 | ("Windows" 117 | ["Swap windows" crux-swap-windows]) 118 | ("General" 119 | ["Visit term buffer" crux-visit-term-buffer] 120 | ["Search in Google" prelude-google] 121 | ["View URL" crux-view-url]))) 122 | map) 123 | "Keymap for Prelude mode.") 124 | 125 | ;; define minor mode 126 | (define-minor-mode prelude-mode 127 | "Minor mode to consolidate Emacs Prelude extensions. 128 | 129 | \\{prelude-mode-map}" 130 | :lighter " Pre" 131 | :keymap prelude-mode-map 132 | :global t) 133 | 134 | (provide 'prelude-mode) 135 | ;;; prelude-mode.el ends here 136 | -------------------------------------------------------------------------------- /core/prelude-ui.el: -------------------------------------------------------------------------------- 1 | ;;; prelude-ui.el --- Emacs Prelude: UI optimizations and tweaks. 2 | ;; 3 | ;; Copyright © 2011-2025 Bozhidar Batsov 4 | ;; 5 | ;; Author: Bozhidar Batsov 6 | ;; URL: https://github.com/bbatsov/prelude 7 | 8 | ;; This file is not part of GNU Emacs. 9 | 10 | ;;; Commentary: 11 | 12 | ;; We dispense with most of the point and click UI, reduce the startup noise, 13 | ;; configure smooth scolling and a nice theme that's easy on the eyes (zenburn). 14 | 15 | ;;; License: 16 | 17 | ;; This program is free software; you can redistribute it and/or 18 | ;; modify it under the terms of the GNU General Public License 19 | ;; as published by the Free Software Foundation; either version 3 20 | ;; of the License, or (at your option) any later version. 21 | ;; 22 | ;; This program is distributed in the hope that it will be useful, 23 | ;; but WITHOUT ANY WARRANTY; without even the implied warranty of 24 | ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 25 | ;; GNU General Public License for more details. 26 | ;; 27 | ;; You should have received a copy of the GNU General Public License 28 | ;; along with GNU Emacs; see the file COPYING. If not, write to the 29 | ;; Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, 30 | ;; Boston, MA 02110-1301, USA. 31 | 32 | ;;; Code: 33 | 34 | ;; the toolbar is just a waste of valuable screen estate 35 | ;; in a tty tool-bar-mode does not properly auto-load, and is 36 | ;; already disabled anyway 37 | (when (fboundp 'tool-bar-mode) 38 | (tool-bar-mode -1)) 39 | 40 | (when prelude-minimalistic-ui 41 | (menu-bar-mode -1)) 42 | 43 | ;; the blinking cursor is nothing, but an annoyance 44 | (blink-cursor-mode -1) 45 | 46 | ;; disable the annoying bell ring 47 | (setq ring-bell-function 'ignore) 48 | 49 | ;; disable startup screen 50 | (setq inhibit-startup-screen t) 51 | 52 | ;; nice scrolling 53 | (setq scroll-margin 0 54 | scroll-conservatively 100000 55 | scroll-preserve-screen-position 1) 56 | 57 | ;; mode line settings 58 | (line-number-mode t) 59 | (column-number-mode t) 60 | (size-indication-mode t) 61 | 62 | ;; show line numbers at the beginning of each line 63 | (unless prelude-minimalistic-ui 64 | ;; there's a built-in linum-mode, but we're using 65 | ;; display-line-numbers-mode or nlinum-mode, 66 | ;; as it's supposedly faster 67 | (if (fboundp 'global-display-line-numbers-mode) 68 | (global-display-line-numbers-mode) 69 | (global-nlinum-mode t))) 70 | 71 | ;; enable y/n answers 72 | (fset 'yes-or-no-p 'y-or-n-p) 73 | 74 | ;; more useful frame title, that show either a file or a 75 | ;; buffer name (if the buffer isn't visiting a file) 76 | (setq frame-title-format 77 | '("" invocation-name " Prelude - " (:eval (if (buffer-file-name) 78 | (abbreviate-file-name (buffer-file-name)) 79 | "%b")))) 80 | 81 | ;; use zenburn as the default theme 82 | (when prelude-theme 83 | (load-theme prelude-theme t)) 84 | 85 | ;; show available keybindings after you start typing 86 | ;; add to hook when running as a daemon as a workaround for a 87 | ;; which-key bug 88 | ;; https://github.com/justbur/emacs-which-key/issues/306 89 | (if (daemonp) 90 | (add-hook 'server-after-make-frame-hook 'which-key-mode) 91 | (which-key-mode +1)) 92 | 93 | (provide 'prelude-ui) 94 | ;;; prelude-ui.el ends here 95 | -------------------------------------------------------------------------------- /core/prelude-windows.el: -------------------------------------------------------------------------------- 1 | ;;; prelude-windows.el --- Emacs Prelude: Windows-specific setup. 2 | ;; 3 | ;; Copyright © 2011-2025 Bozhidar Batsov 4 | ;; 5 | ;; URL: https://github.com/bbatsov/prelude 6 | 7 | ;; This file is not part of GNU Emacs. 8 | 9 | ;;; Commentary: 10 | 11 | ;; Additional setup that's useful when running Emacs in Windows. 12 | 13 | ;;; License: 14 | 15 | ;; This program is free software; you can redistribute it and/or 16 | ;; modify it under the terms of the GNU General Public License 17 | ;; as published by the Free Software Foundation; either version 3 18 | ;; of the License, or (at your option) any later version. 19 | ;; 20 | ;; This program is distributed in the hope that it will be useful, 21 | ;; but WITHOUT ANY WARRANTY; without even the implied warranty of 22 | ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 23 | ;; GNU General Public License for more details. 24 | ;; 25 | ;; You should have received a copy of the GNU General Public License 26 | ;; along with GNU Emacs; see the file COPYING. If not, write to the 27 | ;; Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, 28 | ;; Boston, MA 02110-1301, USA. 29 | 30 | ;;; Code: 31 | 32 | ;; Teach Emacs how to interpret various modifier keys 33 | (setq w32-pass-lwindow-to-system nil) 34 | (setq w32-lwindow-modifier 'super) ; Left Windows key 35 | 36 | (setq w32-pass-rwindow-to-system nil) 37 | (setq w32-rwindow-modifier 'super) ; Right Windows key 38 | 39 | (setq w32-pass-apps-to-system nil) 40 | (setq w32-apps-modifier 'hyper) ; Menu/App key 41 | 42 | ;; Git setup (assuming you've installed Git for Windows) 43 | (when (file-exists-p "C:/Program Files/Git/bin") 44 | (add-to-list 'exec-path "C:/Program Files/Git/bin") 45 | (add-to-list 'exec-path "C:/Program Files/Git/mingw64/bin") 46 | (setenv "PATH" (concat "C:/Program Files/Git/bin;" "C:/Program Files/Git/mingw64/bin;" (getenv "PATH")))) 47 | 48 | ;; needed for arc-mode (it allows you to open archives in Emacs) 49 | (if (file-exists-p "C:/Program Files/7-Zip") 50 | (add-to-list 'exec-path "C:/Program Files/7-Zip") 51 | (message "7-Zip not found. It's a good idea to install it.")) 52 | 53 | (provide 'prelude-windows) 54 | ;;; prelude-windows.el ends here 55 | -------------------------------------------------------------------------------- /core/prelude-wsl.el: -------------------------------------------------------------------------------- 1 | ;;; prelude-wsl.el --- Emacs Prelude: WSL-specific setup. 2 | ;; 3 | ;; Copyright © 2011-2025 Bozhidar Batsov 4 | ;; 5 | ;; URL: https://github.com/bbatsov/prelude 6 | 7 | ;; This file is not part of GNU Emacs. 8 | 9 | ;;; Commentary: 10 | 11 | ;; Additional setup that's useful when running Emacs in WSL. 12 | 13 | ;;; License: 14 | 15 | ;; This program is free software; you can redistribute it and/or 16 | ;; modify it under the terms of the GNU General Public License 17 | ;; as published by the Free Software Foundation; either version 3 18 | ;; of the License, or (at your option) any later version. 19 | ;; 20 | ;; This program is distributed in the hope that it will be useful, 21 | ;; but WITHOUT ANY WARRANTY; without even the implied warranty of 22 | ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 23 | ;; GNU General Public License for more details. 24 | ;; 25 | ;; You should have received a copy of the GNU General Public License 26 | ;; along with GNU Emacs; see the file COPYING. If not, write to the 27 | ;; Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, 28 | ;; Boston, MA 02110-1301, USA. 29 | 30 | ;;; Code: 31 | 32 | ;; teach Emacs how to open links with your default browser 33 | (let ((cmd-exe "/mnt/c/Windows/System32/cmd.exe") 34 | (cmd-args '("/c" "start"))) 35 | (when (file-exists-p cmd-exe) 36 | (setq browse-url-generic-program cmd-exe 37 | browse-url-generic-args cmd-args 38 | browse-url-browser-function 'browse-url-generic 39 | search-web-default-browser 'browse-url-generic))) 40 | 41 | (provide 'prelude-wsl) 42 | ;;; prelude-wsl.el ends here 43 | -------------------------------------------------------------------------------- /docs/cheatsheet.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bbatsov/prelude/3cf24d83eaadc426196b0bc49148c94260f78dff/docs/cheatsheet.png -------------------------------------------------------------------------------- /docs/contributing.md: -------------------------------------------------------------------------------- 1 | # Contributing 2 | 3 | ## Issues 4 | 5 | Report issues and suggest features and improvements on the [GitHub 6 | issue tracker](https://github.com/bbatsov/prelude/issues). Don't ask 7 | questions on the issue tracker - use the [support 8 | channels](support.md) instead. 9 | 10 | If you want to file a bug, please provide all the necessary info 11 | listed in our issue reporting template (it's loaded automatically when 12 | you create a new GitHub issue). 13 | 14 | ## Patches 15 | 16 | Patches in any form are always welcome! GitHub pull requests are even 17 | better! :-) 18 | 19 | Before submitting a patch or a pull request make sure that your patch 20 | is in line with the [contribution 21 | guidelines](https://github.com/bbatsov/prelude/blob/master/CONTRIBUTING.md). 22 | 23 | ## Documentation 24 | 25 | Good documentation is just as important as good code. Please, 26 | consider improving and extending this manual. 27 | 28 | ### Working on the Manual 29 | 30 | The manual is generated from the markdown files in the 31 | [docs](https://github.com/bbatsov/prelude/tree/master/docs) folder of 32 | Prelude's GitHub repo and is published to [Read the 33 | Docs](https://readthedocs.org). The [MkDocs](http://www.mkdocs.org/) 34 | tool is used to convert the markdown sources to HTML. 35 | 36 | To make changes to the manual you simply have to change the files 37 | under `docs`. The manual will be regenerated automatically when changes 38 | to those files are merged in `master` (or the latest stable branch). 39 | 40 | You can install `MkDocs` locally and use the command `mkdocs serve` to 41 | see the result of changes you make to the manual locally: 42 | 43 | ```sh 44 | cd path/to/prelude/repo 45 | mkdocs serve 46 | ``` 47 | 48 | If you want to make changes to the manual's page structure you'll have to edit 49 | [mkdocs.yml](https://github.com/bbatsov/prelude/blob/master/mkdocs.yml). 50 | 51 | ## Donations 52 | 53 | You can support the development of Prelude via 54 | [GitHub Sponsors](https://github.com/sponsors/bbatsov), 55 | [PayPal](https://www.paypal.me/bbatsov) and 56 | [Patreon](https://www.patreon.com/bbatsov). 57 | -------------------------------------------------------------------------------- /docs/css/extra.css: -------------------------------------------------------------------------------- 1 | /* By default kbd doesn't stand out very much. Let's fix this! */ 2 | kbd { 3 | padding: 3px 5px; 4 | border: solid 1px #ccc; 5 | background-color: #fcfcfc; 6 | border-radius: 3px; 7 | box-shadow: inset 0 -1px 0 #bbb; 8 | display: inline-block; 9 | } 10 | 11 | /* The default font-size for code blocks is 75% which makes code 12 | hard to read. */ 13 | code { 14 | font-size: 90%; 15 | } 16 | -------------------------------------------------------------------------------- /docs/faq.md: -------------------------------------------------------------------------------- 1 | # Frequently Asked Questions 2 | 3 | ## What's the origin of the name Emacs Prelude? 4 | 5 | I wanted an Emacs experience that was both as sleek and as powerful 6 | as the legendary sports car [Honda Prelude](https://en.wikipedia.org/wiki/Honda_Prelude). 7 | I also wanted a name with `el` in it. :-) 8 | 9 | ## Why doesn't Prelude use `use-package`? 10 | 11 | While `use-package` provides a nice way of structuring your 12 | configuration (especially if you're into single-file setups), it also adds a layer of complexity as it's just a macro 13 | that expands to some "traditional" configuration code. One aspect of `use-package` that's a bit tricky is where to place cross-package configuration, as it can potentially go to different configuration blocks. 14 | 15 | Given how modular the structure of Prelude is, there's relatively little to be gained by adopting `use-package` everywhere, but end users are free to use `use-package` for their personal configuration. 16 | 17 | !!! Note 18 | 19 | I have a stripped-down version of Prelude for personal use, based on `use-package` [here](https://github.com/bbatsov/emacs.d). 20 | I guess it might be of interest to some of you. 21 | 22 | **Update (2023):** There are now plans to include `use-package` in Emacs 29, which will likely increase its prominence. Prelude 1.2 auto-installs `use-package` and newer Prelude modules might make use of `use-package`. `prelude-vertico` is one such example. 23 | 24 | ## Why does Prelude use MELPA instead of MELPA Stable by default? 25 | 26 | Mostly because many package authors/maintainers don't have the habit to cut 27 | "stable" releases of their projects. It seems that's changing for the better 28 | in recent years, so Prelude's defaults might change down the road. 29 | 30 | ## Why is Zenburn the default color theme? 31 | 32 | No particular reason other than the fact that I like it a lot and happen to maintain 33 | its Emacs port. I believe it's pretty nice improvement over the default Emacs theme, but your perspective might be different. 34 | -------------------------------------------------------------------------------- /docs/index.md: -------------------------------------------------------------------------------- 1 | # Emacs Prelude 2 | 3 | Prelude is an Emacs distribution that aims to enhance the default 4 | Emacs experience. Prelude alters a lot of the default settings, 5 | bundles a plethora of additional packages and adds its own core 6 | library to the mix. The final product offers an easy to use Emacs 7 | configuration for Emacs newcomers and lots of additional power for 8 | Emacs power users. 9 | 10 | !!! Important 11 | 12 | Prelude is compatible **ONLY with GNU Emacs 25.1+**. In general you're 13 | advised to always run Prelude with the latest stable Emacs release. 14 | 15 | You can support the development of Prelude via 16 | [GitHub Sponsors](https://github.com/sponsors/bbatsov), 17 | [ko-fi](https://www.ko-fi.com/bbatsov), 18 | [PayPal](https://www.paypal.me/bbatsov) and 19 | [Patreon](https://www.patreon.com/bbatsov). 20 | 21 | ## Features 22 | 23 | - Improved UX, that's still in line with Emacs traditions 24 | - Sane defaults of baseline Emacs functionality 25 | - Automatic installation of many major programming modes on demand 26 | - A curated set of 3rd party packages to enhance the base functionality 27 | - Simple modular architecture 28 | - Easy customization 29 | 30 | ## Package Highlights 31 | 32 | Here are some of the essential 3rd party packages that Prelude adds to Emacs: 33 | 34 | - [ace-window](https://github.com/abo-abo/ace-window) 35 | (effective navigation between multiple windows) 36 | - [avy](https://github.com/abo-abo/avy) 37 | (effective navigation) 38 | - [crux](https://github.com/bbatsov/crux) 39 | (lots of useful editing commands) 40 | - [diff-hl](https://github.com/dgutov/diff-hl) 41 | (shows colorful diff markers in the gutter when you're editing files 42 | under version control) 43 | - [easy-kill](https://github.com/leoliu/easy-kill) 44 | - [editorconfig-mode](https://github.com/editorconfig/editorconfig-emacs) 45 | (teaches Emacs to respect [.editorconfig](https://editorconfig.org/)) 46 | - [expand-region](https://github.com/magnars/expand-region.el) 47 | - [flycheck](https://www.flycheck.org/) 48 | (modern integration with many lint tools) 49 | - [guru-mode](https://github.com/bbatsov/guru-mode) 50 | (an Emacs guru that helps you learn basic Emacs keybindings) 51 | - [projectile](https://github.com/bbatsov/projectile) 52 | (powerful project navigation/interaction package) 53 | - [magit](https://magit.vc/) 54 | (the best git client in the known universe) 55 | - [git-timemachine](https://codeberg.org/pidu/git-timemachine) 56 | (navigate quickly through different versions of one file) 57 | - `nlinum` 58 | (line numbers in your buffers) 59 | - [smartparens](https://github.com/Fuco1/smartparens) 60 | (powerful package for dealing with expressions and matched 61 | delimiters in programming languages) 62 | - [super-save](https://github.com/bbatsov/super-save) 63 | (auto-save buffers when moving around) 64 | - [which-key](https://github.com/justbur/emacs-which-key) 65 | (shows you possible keybindings when you type a partial keybinding) 66 | - [zenburn-theme](https://github.com/bbatsov/zenburn-emacs) 67 | (Prelude's default color theme) 68 | - [undo-tree](https://elpa.gnu.org/packages/undo-tree.html) 69 | (A powerful way to navigate your editing history) 70 | 71 | On top of this Prelude bundles a bunch of smaller packages and makes 72 | many more packages available via optional modules. 73 | 74 | ## Programming Languages Support 75 | 76 | The following programming languages have enhanced support in Prelude: 77 | 78 | - C/C++ 79 | - [Clojure](modules/clojure.md) 80 | - CoffeeScript 81 | - [Common Lisp](modules/common_lisp.md) 82 | - CSS 83 | - [Dart](modules/dart.md) 84 | - [Emacs Lisp](modules/emacs_lisp.md) 85 | - Erlang 86 | - Elixir 87 | - [F#](modules/fsharp.md) 88 | - Go 89 | - Haskell 90 | - JavaScript 91 | - LaTeX 92 | - [Lisp Base](modules/lisp.md) (common foundation for Lisp modules) 93 | - Lua 94 | - Markdown 95 | - [OCaml](modules/ocaml.md) 96 | - Org Mode 97 | - Perl 98 | - [Python](modules/python.md) 99 | - Racket 100 | - [Ruby](modules/ruby.md) 101 | - [Rust](modules/rust.md) 102 | - Scala 103 | - [Scheme](modules/scheme.md) 104 | - SCSS 105 | - TypeScript 106 | - HTML (via `web-mode`) 107 | - XML 108 | - YAML 109 | 110 | On top of this - basic support for many other programming languages 111 | will be auto-installed when needed (e.g. the first time you open a 112 | source file for some language). 113 | 114 | ## Philosophy 115 | 116 | Prelude's philosophy is quite simple: 117 | 118 | - simple 119 | - easy to understand and extend 120 | - stable 121 | - a foundation for you to build upon, as opposed to some end-user product 122 | 123 | This means that it intentionally doesn't pack all the bells and 124 | whistles that it could. Prelude aims to enhance the classic Emacs 125 | experience without deviating a lot from it - e.g. it would never 126 | enable something like `evil-mode` (vim keybindings) by default and so 127 | on. 128 | 129 | All the third-party packages that it bundles are carefully vetted and 130 | are known to be of good quality and to have reliable maintainers. That 131 | generally means that Prelude's unlikely to immediately adopt some 132 | shiny new package, that has established tried and true alternatives. 133 | 134 | In practice this translates to the following: 135 | 136 | - Prelude is less opinionated than distros like Spacemacs and Doom 137 | Emacs (meaning it's closer to the standard Emacs experience) 138 | - Prelude installs relatively few additional packages by default 139 | - Most modules in Prelude are opt-in instead of opt-out (you'll notice 140 | the default config enables only a handful of modules) 141 | - Most modules (for example, modules for programming languages) are 142 | pretty short and feature setup only for essential packages (in some 143 | cases that would be just the major mode for the language in 144 | question) 145 | - You don't really need to track Prelude's upstream - you're 146 | encouraged to just fork it and use it as the basis for your own 147 | configuration. 148 | 149 | Remember that the ultimate goal of every Emacs user is to create an 150 | Emacs setup that reflects their own experience, needs, goals and 151 | ideas. Just like Lisp, Emacs is nothing but a raw building material 152 | for the perfect editing experience. 153 | -------------------------------------------------------------------------------- /docs/modules/clojure.md: -------------------------------------------------------------------------------- 1 | # Prelude Clojure 2 | 3 | !!! Note 4 | 5 | This module builds on top of the shared [Lisp Base](lisp.md) module. 6 | 7 | ## Clojure Mode 8 | 9 | This module bundles `clojure-mode`, a major mode for programming in Clojure, 10 | and some sensible defaults for it. 11 | 12 | ## CIDER 13 | 14 | This module also bundles [CIDER](https://docs.cider.mx), a popular interactive 15 | programming environment for Clojure. 16 | 17 | Intentionally, Prelude doesn't install by default popular CIDER plugins like 18 | `clj-refactor`, `sayid`, etc, as those can be overwhelming to newcomers and 19 | are easy to setup if you need them. 20 | 21 | ## CIDER Alternatives 22 | 23 | Depending on your preferences you might want to use `inf-clojure` or `clojure-lsp` 24 | alongside/instead of CIDER, but you'll have to set them up yourselves. 25 | 26 | ## Fun trivia 27 | 28 | I'm the author of CIDER and `inf-clojure` and the primary maintainer of `clojure-mode`. I'm also a co-maintainer of `clj-refactor`. I guess I love Clojure! :-) 29 | -------------------------------------------------------------------------------- /docs/modules/common_lisp.md: -------------------------------------------------------------------------------- 1 | # Prelude Common Lisp 2 | 3 | !!! Note 4 | 5 | This module builds on top of the shared [Lisp Base](lisp.md) module. 6 | 7 | ## lisp-mode 8 | 9 | Not much to say here, as `lisp-mode` is configured in the "Lisp Base" module. 10 | 11 | ## SLIME 12 | 13 | This module bundles [SLIME](https://common-lisp.net/project/slime/), a popular interactive 14 | programming environment for SLIME, and enables many of its essential features. 15 | 16 | SLIME supports many Common Lisp implementations: 17 | 18 | - CMU Common Lisp (CMUCL) 19 | - Steel Bank Common Lisp (SBCL) 20 | - Clozure CL (a.k.a. OpenMCL) 21 | - LispWorks 22 | - Allegro CL 23 | - CLISP 24 | - Scieneer CL 25 | - ECL 26 | - Corman CL 27 | - ABCL 28 | 29 | The default config assumes the usage of [Clozure CL](https://github.com/Clozure/ccl) on macOS and 30 | of [SBCL](http://www.sbcl.org/) everywhere else. That's something you can easily 31 | tweak via `slime-default-lisp`. 32 | 33 | You can start SLIME with `M-x slime`. 34 | -------------------------------------------------------------------------------- /docs/modules/company.md: -------------------------------------------------------------------------------- 1 | # Prelude Company 2 | 3 | !!! Note 4 | 5 | This module is enabled by default. 6 | 7 | [company](https://company-mode.github.io/) is a completion library. 8 | 9 | This module simply provides some reasonable defaults for it and enables `company-mode`: 10 | 11 | ``` 12 | (setq company-idle-delay 0.5) 13 | (setq company-show-numbers t) 14 | (setq company-tooltip-limit 10) 15 | (setq company-minimum-prefix-length 2) 16 | (setq company-tooltip-align-annotations t) 17 | ;; invert the navigation direction if the the completion popup-isearch-match 18 | ;; is displayed on top (happens near the bottom of windows) 19 | (setq company-tooltip-flip-when-above t) 20 | 21 | (global-company-mode 1) 22 | ``` 23 | 24 | You can adjust the configuration further in your personal config. 25 | 26 | `company-mode` has [many extensions](https://github.com/company-mode/company-mode/wiki/Third-Party-Packages) 27 | for various programming languages. 28 | Some of Prelude's modules will install and enable the relevant extensions when necessary. 29 | -------------------------------------------------------------------------------- /docs/modules/dart.md: -------------------------------------------------------------------------------- 1 | # Prelude Dart 2 | 3 | !!! Note 4 | 5 | This module builds on top of the lsp-module. 6 | 7 | The dart module is powered by [lsp-dart](https://emacs-lsp.github.io/lsp-dart/). 8 | 9 | Some features it provides: 10 | 11 | - Flutter integration 12 | - Tree views 13 | - Run pub 14 | - Debug 15 | - Run tests 16 | 17 | Some essential commands: 18 | 19 | - `lsp-dart-pub-get` - Run pub get or flutter pub get on project root. 20 | - `lsp-dart-pub-upgrade` - Run pub upgrade or flutter pub upgrade on project root. 21 | - `lsp-dart-pub-outdated` - Run pub outdated or flutter pub outdated on project root. 22 | - `lsp-dart-run-all-tests` - Run all tests from project. 23 | - `lsp-dart-run-test-file` - Run all tests from current test buffer. 24 | -------------------------------------------------------------------------------- /docs/modules/emacs_lisp.md: -------------------------------------------------------------------------------- 1 | # Prelude Emacs Lisp 2 | 3 | !!! Note 4 | 5 | This module builds on top of the shared [Lisp Base](lisp.md) module. 6 | 7 | ## Elisp-mode 8 | 9 | The module establishes some sensible defaults for `elisp-mode` and 10 | shortens its modeline name to "EL". 11 | 12 | It establishes a few extra keybidings (inspired by SLIME): 13 | 14 | - `C-c C-z` (`prelude-visit-ielm`) 15 | - `C-c C-c` (`eval-defun`) 16 | - `C-c C-b` (`eval-buffer`) 17 | 18 | The module also enables auto-recompilation of Elisp files on save. 19 | 20 | ## IELM 21 | 22 | IELM is an Elisp REPL bundled with Emacs. Prelude tweaks a bit it's default 23 | configuration to align it with the `elisp-mode` configuration. 24 | 25 | ## elisp-slime-nav 26 | 27 | The module bundles [elisp-slime-nav](https://github.com/purcell/elisp-slime-nav), 28 | which allows you to jump to definitions with `C-.` (use `C-,` to jump back) and describe a symbol with 29 | `C-c C-d (C-)d`. 30 | 31 | ## Minibuffer evaluation 32 | 33 | `smartparens-mode` is conditionally enabled for `eval-expression` (`M-:`) command. 34 | -------------------------------------------------------------------------------- /docs/modules/erc.md: -------------------------------------------------------------------------------- 1 | # Prelude ERC 2 | 3 | ERC is a popular IRC client bundled with Emacs. 4 | ERC is both powerful and complex, that's why Prelude bundles 5 | some configuration for it, together with a few handy commands 6 | like `start-irc` and `stop-irc`. 7 | 8 | ## Customizing Server list 9 | 10 | If you want to join a list of servers on `M-x start-irc`, other than 11 | the default list, please redefine the variable `my-fav-irc` as follows 12 | in your personal config: 13 | 14 | ```emacs-lisp 15 | (setq my-fav-irc '("irc.freenode.net" 16 | "irc.oftc.net" 17 | "irc.mozilla.org" 18 | "irc.gnome.org")) 19 | ``` 20 | 21 | ## Customizing Last Quit Message 22 | 23 | If you want to customize your IRC Last Quit Message from *Asta la 24 | vista* to something more funkier, please redefine `bye-irc-message` as 25 | follows: 26 | 27 | ```emacs-lisp 28 | (setq bye-erc-message "adios") 29 | ``` 30 | 31 | ## Reading NickServ passwords from auth-source plugin 32 | 33 | If you want to automatically authenticate while logging into IRC 34 | servers set the `erc-prompt-for-password` to nil as follows: 35 | 36 | ```emacs-lisp 37 | (setq erc-prompt-for-password nil) 38 | ``` 39 | 40 | Now you can set password in plaintext in `.authinfo` file in the netRC 41 | format or you it encrypted in `.authinfo.gpg` file after setting up gpg 42 | in Emacs. 43 | 44 | ## Opening all ERC buffers in a new perspective 45 | 46 | Many a time when we start IRC with the `start-irc` command, all the 47 | channels open in our existing workspace, which can be annoying to 48 | some; especially to those who like to organize their buffers into 49 | separate groups (perspectives). To avoid this scenario, it is better 50 | to group all the ERC buffers into one perspective called `IRC` when 51 | `start-irc` is called. To enable this set the `prelude-new-irc-persp` 52 | variable to true as follows: 53 | 54 | ```emacs-lisp 55 | (setq prelude-new-irc-persp t) 56 | ``` 57 | -------------------------------------------------------------------------------- /docs/modules/fsharp.md: -------------------------------------------------------------------------------- 1 | # Prelude F # 2 | 3 | !!! Note 4 | 5 | This module builds on top of the shared [Programming](programming.md) module. 6 | 7 | ## F# mode 8 | 9 | This module uses 10 | [`fsharp-mode`](https://github.com/fsharp/emacs-fsharp-mode) and 11 | `eglot-fsharp` with almost no extra configuration. 12 | -------------------------------------------------------------------------------- /docs/modules/go.md: -------------------------------------------------------------------------------- 1 | # Prelude Go 2 | 3 | This module builds on top of the shared [Programming](programming.md) 4 | module, as well as the `prelude-lsp` module. 5 | 6 | The following keybindings are set by default, which are not present in 7 | each mode's default bindings: 8 | 9 | - C-c a (`go-test-current-project`) 10 | - C-c m (`go-test-current-file`) 11 | - C-c . (`go-test-current-test`) 12 | - C-c b (`go-run`) 13 | - C-h f (`godoc-at-point`) 14 | 15 | Run C-h m for all the key bindings and other documentation. 16 | 17 | There are two ways to manage projects in Go: `$GOPATH` and with Go 18 | modules. Modules are the newer, recommended method. Read [Using Go 19 | Modules](https://go.dev/blog/using-go-modules) to learn about this, if 20 | you are unfamiliar with the subject. Many of the tools used by Prelude 21 | Go may provide functions that are broken with modules. There is 22 | usually another function that will work properly; when in doubt, use a 23 | function provided by `lsp-mode` which is documented below. 24 | 25 | Generics were added to Go in 1.18. `gopls`, the backend for `lsp-mode` 26 | setup herein, supports generics as long as `gopls` itself was built 27 | with 1.18+. Other minor modes may not support generics yet. 28 | 29 | ## Go Mode 30 | 31 | `prelude-go` builds on several useful Go tools, and establishes sensible 32 | defaults. The major mode is `go-mode`. Documentation is available at [github.com/dominikh/go-mode.el](https://github.com/dominikh/go-mode.el) 33 | 34 | ## Go Projectile 35 | 36 | [Projectile](https://github.com/bbatsov/projectile) integration is 37 | provided by [go-projectile](https://github.com/dougm/go-projectile). 38 | 39 | This provides: 40 | 41 | - Projectile integration 42 | - Switching GOPATH if desired per project (customizable via 43 | `customize`) 44 | - Ability to download all commonly used `go` tools via M-x 45 | go-projectile-install-tools and update them via M-x 46 | go-projectile-update-tools 47 | - Very basic refactoring via `go-projectile-rewrite` (uses `gofmt -r`) 48 | - Support for `go get` and `go get -u` via `go-projectile-get` and 49 | `go-projectile-update`. 50 | 51 | See its documentation for details. 52 | 53 | ## LSP Mode and LSP UI 54 | 55 | [LSP](https://microsoft.github.io/language-server-protocol/) (Language 56 | Server Protocol) is a protocol that allows editors to use an external 57 | "language server" to provide features like autocompletion, 58 | documentation, and code navigation rather than implementing these 59 | features separately in each editor. Emacs supports LSP via 60 | `lsp-mode`. The language server used is 61 | [gopls](https://github.com/golang/tools/tree/master/gopls). 62 | 63 | To install `gopls`, change to a directory outside of `$GOPATH` or any 64 | module (e.g., `/tmp`) and execute: 65 | 66 | ``` 67 | go install golang.org/x/tools/gopls@latest 68 | ``` 69 | 70 | Ensure that `gopls` is in your `$PATH`. 71 | 72 | Excellent documentation for `lsp-mode` and `lsp-ui` are provided at [emacs-lsp.github.io/lsp-mode/](https://emacs-lsp.github.io/lsp-mode/) 73 | 74 | If a feature, such as documentation, refactoring, indenting, etc. is 75 | provided by `lsp`, you should use it instead of calling to another 76 | tool. `gopls` is the officially maintained tool that supercedes 77 | functionality in other tools, like `gocode`, and works properly with 78 | modules and generics. 79 | 80 | Company support is automatically added that works with `lsp`. 81 | 82 | ## GoTest 83 | 84 | [gotest](https://github.com/nlamirault/gotest.el) is also provided 85 | while editing Go files in order to run tests more easily. The bindings 86 | provided by `prelude-go` are listed at the top because `gotest` does 87 | not set any. 88 | -------------------------------------------------------------------------------- /docs/modules/index.md: -------------------------------------------------------------------------------- 1 | # Modules 2 | 3 | !!! Note 4 | 5 | Most modules are not currently documented. Helping out with their 6 | documentation is a great way to contribute to the project! 7 | 8 | Prelude provides extra functionality through modules. Some modules may 9 | require extra steps to enable all functionality. These steps and the 10 | functionality provided by these modules are documented on the 11 | following links. 12 | 13 | ## What's a module? 14 | 15 | Prelude modules are plain old Elisp libraries - there's absolutely 16 | nothing magical about them. Most of them simply install a few Emacs 17 | packages and provide some sensible baseline configuration for them. 18 | Here's a real example. 19 | 20 | ``` emacs-lisp 21 | ;;; prelude-ruby.el --- Emacs Prelude: A nice setup for Ruby (and Rails) devs. 22 | ;; 23 | ;;; Code: 24 | 25 | (require 'prelude-programming) 26 | 27 | (prelude-require-packages '(inf-ruby yari)) 28 | 29 | ;; We never want to edit Rubinius bytecode 30 | (add-to-list 'completion-ignored-extensions ".rbc") 31 | 32 | ;; Map yari to C-h R 33 | (define-key 'help-command (kbd "R") 'yari) 34 | 35 | (with-eval-after-load 'ruby-mode 36 | (defun prelude-ruby-mode-defaults () 37 | ;; Don't auto-insert encoding comments 38 | ;; Those are almost never needed in Ruby 2+ 39 | (setq ruby-insert-encoding-magic-comment nil) 40 | (inf-ruby-minor-mode +1) 41 | ;; CamelCase aware editing operations 42 | (subword-mode +1)) 43 | 44 | (setq prelude-ruby-mode-hook 'prelude-ruby-mode-defaults) 45 | 46 | (add-hook 'ruby-mode-hook (lambda () 47 | (run-hooks 'prelude-ruby-mode-hook)))) 48 | 49 | (provide 'prelude-ruby) 50 | ;;; prelude-ruby.el ends here 51 | ``` 52 | 53 | To use a module you simple have to require it. No new concepts. No magic. 54 | 55 | ## Programming Language Modules 56 | 57 | The following programming languages have enhanced support in Prelude: 58 | 59 | - C/C++ 60 | - [Clojure](clojure.md) 61 | - CoffeeScript 62 | - [Common Lisp](common_lisp.md) 63 | - CSS 64 | - [Dart](dart.md) 65 | - Elixir 66 | - [Emacs Lisp](emacs_lisp.md) 67 | - Erlang 68 | - Go 69 | - Haskell 70 | - JavaScript 71 | - LaTeX 72 | - [Lisp Base](lisp.md) (common foundation for Lisp modules) 73 | - LSP (common foundation for all modules relying on `lsp-mode`) 74 | - Lua 75 | - Markdown 76 | - OCaml 77 | - Perl 78 | - [Programming Base](programming.md) (common foundation for programming modules) 79 | - [Python](python.md) 80 | - Racket 81 | - [Ruby](ruby.md) 82 | - Rust 83 | - Scala 84 | - [Scheme](scheme.md) 85 | - SCSS 86 | - Shell 87 | - TypeScript 88 | - Web 89 | - XML 90 | - YAML 91 | 92 | ## Other Modules 93 | 94 | - [Company](company.md) 95 | - [ERC](erc.md) 96 | - evil 97 | - helm 98 | - ido 99 | - ivy 100 | - key-chord 101 | - Org Mode 102 | - selectrum 103 | - vertico 104 | -------------------------------------------------------------------------------- /docs/modules/lisp.md: -------------------------------------------------------------------------------- 1 | # Prelude Lisp 2 | 3 | Basic shared configuration for Lisp-like programming languages. Currently 4 | it does only two things: 5 | 6 | - Enables `smartparens-strict-mode` in Lisp major modes and REPL buffers 7 | - Enables `rainbow-delimiters` in Lisp major modes and REPL buffers 8 | -------------------------------------------------------------------------------- /docs/modules/literate-programming.md: -------------------------------------------------------------------------------- 1 | # Prelude Literate Programming 2 | 3 | Prelude's `prelude-literate-programming` module enables some 4 | additional functionality for `org-mode` - the parent mode the native 5 | markdown language of Emacs. 6 | 7 | It also enables viewing and interaction of Python Notebooks within Emacs. 8 | 9 | Here are some features it provides: 10 | 11 | - syntax highlighting of code blocks in Emacs Orgmode 12 | - executing code blocks and printing their output in the org file 13 | - viewing python notebooks within Emacs 14 | - Using Emacs to interact with python notebooks and other remote compute engines 15 | 16 | It makes an attempt to enable [literate programming](http://www.literateprogramming.com/knuthweb.pdf) 17 | from within emacs 18 | -------------------------------------------------------------------------------- /docs/modules/ocaml.md: -------------------------------------------------------------------------------- 1 | # Prelude OCaml 2 | 3 | !!! Note 4 | 5 | This module builds on top of the shared [Programming](programming.md) module. 6 | 7 | ## Overview 8 | 9 | Prelude provides powerful out-of-the-box experience for programming in OCaml: 10 | 11 | - major-mode for editing OCaml code (`tuareg-mode`) 12 | - integration with `utop`, OCaml's modern top-level (you can think of it as a REPL) 13 | - linting via `flycheck` or `merlin` 14 | - code completion via `merlin` 15 | 16 | You can get similar experience using OCaml's LSP server, but it's based on Merlin internally and the setup with LSP is a bit more involved. 17 | 18 | ## Packages 19 | 20 | When the `prelude-ocaml` is enabled it will install 3 packages: 21 | 22 | - `tuareg-mode` 23 | - `utop` 24 | - `merlin` 25 | - `flycheck-ocaml` 26 | 27 | ## Environment Setup 28 | 29 | These setups for ocaml assume that you are using the OPAM package 30 | manager (). 31 | 32 | Because of the apparent complexity of getting Emacs environment 33 | variables setup to use opam correctly, it is instead easier to use 34 | opam itself to execute any necessary commands. 35 | 36 | Also, the standard OCaml toplevel usage has been replaced in favor 37 | of UTOP, the universal toplevel, and we assume that you are using 38 | the Jane Street Core libraries rather than the regular OCaml 39 | standard libraries 40 | 41 | The minimum required setup for using Prelude's OCaml setup would be 42 | to install OPAM, and then, minimally `opam install core utop'. A 43 | good getting started guide is available at 44 | 45 | 46 | ## Configuration 47 | 48 | Prelude disables Merlin's own linting in favor of Flycheck. It also 49 | leverages Merlin's company-mode backend instead of using directly 50 | Merlin's rudimentary auto-completion system. 51 | -------------------------------------------------------------------------------- /docs/modules/orgmode.md: -------------------------------------------------------------------------------- 1 | # Prelude OrgMode 2 | 3 | !!! Note 4 | This module builds on the Emacs OrgMode Functionality 5 | 6 | ## OrgMode 7 | 8 | The module establishes some sensible defaults for `orgmode` 9 | 10 | It establishes a few extra keybidings: 11 | 12 | - `C-c l` (`org-store-link`) 13 | - `C-c a` (`org-agenda`) 14 | - `C-c b` (`org-switchb`) 15 | 16 | ## org-habits 17 | 18 | It enables [org-habits](https://orgmode.org/manual/Tracking-your-habits.html "org-habits") and [tracks TODO state changes](https://orgmode.org/manual/Tracking-TODO-state-changes.html "todo-state-changes") into a 19 | [drawer](https://orgmode.org/manual/Drawers.html "org-drawers"). 20 | -------------------------------------------------------------------------------- /docs/modules/programming.md: -------------------------------------------------------------------------------- 1 | # Prelude Programming 2 | 3 | Prelude's programming module enables some additional functionality 4 | for `prog-mode` - the parent mode for all major programming modes in Emacs. 5 | 6 | Here are some features it provides: 7 | 8 | - spell-checking of comments (via `flyspell-prog-mode`) 9 | - auto-pairing of delimiters like parentheses (via `smartparens`) 10 | - visual ques for whitespace (via `whitespace-mode`) 11 | - highlighting code annotations (via `hl-todo`) 12 | - linter integration (via `flycheck`) 13 | - showing current definition name in the modeline (via `which-func`) 14 | 15 | Most of this boils down to enabling a bunch of minor modes in `prog-mode-hook`. 16 | -------------------------------------------------------------------------------- /docs/modules/python.md: -------------------------------------------------------------------------------- 1 | # Prelude Python 2 | 3 | !!! Note 4 | 5 | This module builds on top of the shared [Programming](programming.md) module. 6 | 7 | ## Python Mode 8 | 9 | Emacs comes with Python programming support through the built-in 10 | `python-mode`. Whenever you are editing Python code run `C-h m` to 11 | look at the Python mode key bindings. Alternatively look at the 12 | menu bar entries under Python. To toggle the menu bar press `F12`. 13 | 14 | ## Anaconda Mode 15 | 16 | Prelude bundles the powerful 17 | [anaconda-mode](https://github.com/pythonic-emacs/anaconda-mode), 18 | which provides code navigation, documentation lookup and completion for Python. 19 | 20 | Anaconda has integration with popular modes like `company` and `eldoc`. 21 | 22 | ## Syntax checking 23 | 24 | Prelude ships with [Flycheck](https://github.com/flycheck/flycheck), 25 | an on the fly syntax checker. Flycheck has support for two Python 26 | syntax checkers, [Pylint](http://www.pylint.org/) and 27 | [Flake8](http://flake8.readthedocs.org/en/latest/). In 28 | order to have Flycheck support on the fly syntax checking for 29 | Python you need to have either of these installed and accessible to 30 | Emacs. In order to manually choose a checker run `C-c ! s`. 31 | 32 | ## Automatic insertion of file encoding comments 33 | 34 | You can have Prelude auto-detect the encoding of a source buffer and 35 | insert the appropriate `# coding:` comments. If you wish to enable 36 | this, add the following to your configuration: 37 | 38 | ```emacs-lisp 39 | (setq prelude-python-mode-set-encoding-automatically t) 40 | ``` 41 | 42 | !!! Note 43 | 44 | Previously `prelude-python` had this feature enabled by default (up to Prelude 1.1), but 45 | it is only necessary on Python 2, because Python 3 uses utf-8 46 | as the default file encoding. In 2020 Python 2 became deprecated, so that 47 | functionality became mostly obsolete. 48 | -------------------------------------------------------------------------------- /docs/modules/ruby.md: -------------------------------------------------------------------------------- 1 | # Prelude Ruby 2 | 3 | !!! Note 4 | 5 | This module builds on top of the shared [Programming](programming.md) module. 6 | 7 | ## Ruby Mode 8 | 9 | Emacs comes with Ruby programming support through the built-in 10 | `ruby-mode`. Whenever you are editing Ruby code run `C-h m` to 11 | look at the Ruby mode key bindings. Alternatively look at the 12 | menu bar entries under Ruby. To toggle the menu bar press `F12`. 13 | 14 | Prelude enables `CamelCase` aware editing in Ruby code (via `subword-mode`). 15 | 16 | ## inf-ruby 17 | 18 | The module bundles the [inf-ruby](https://github.com/nonsequitur/inf-ruby) package which allows you to run a Ruby 19 | REPL (e.g. `irb` or `pry`) in an Emacs buffer and interact with it from 20 | Ruby source buffers. 21 | 22 | ## yari 23 | 24 | The module bundles the [yari](https://github.com/hron/yari.el) package which allows you to search in Ruby's RI 25 | documentation. Use `C-h R` to invoke it. 26 | -------------------------------------------------------------------------------- /docs/modules/rust.md: -------------------------------------------------------------------------------- 1 | # Prelude Rust 2 | 3 | !!! Note 4 | 5 | This module builds on top of the shared [Programming](programming.md) module. 6 | 7 | ## Package Prerequisites 8 | 9 | For the proper functioning of this module, you'll need to install the 10 | following packages in your system: 11 | 12 | - `rustc` (Rust compiler) 13 | - `cargo` (Rust package manager) 14 | - `rustfmt` (Rust tool for formatting code) 15 | - `rust-analyzer` (Rust Language Server, required for `prelude-lsp` feature) 16 | 17 | ## Rust Mode 18 | 19 | Emacs comes with Rust programming support through the built-in 20 | `rust-mode`. Whenever you are editing Rust code run C-h m to 21 | look at the Rust mode key bindings. 22 | 23 | ## Syntax highlighting 24 | 25 | [tree-sitter-mode](https://emacs-tree-sitter.github.io/) is used for nicer 26 | syntax highlighting. 27 | 28 | ## Syntax checking 29 | 30 | Prelude ships with [Flycheck](https://github.com/flycheck/flycheck), 31 | an on the fly syntax checker. Flycheck has support for Rust. Rust is 32 | automatically setup in flycheck, by executing 33 | `flycheck-rust-setup`. If the current file is part of a Cargo project, 34 | flycheck is configured according to the Cargo project layout. 35 | 36 | ## Cargo integration 37 | 38 | Along with `rust-mode`, `cargo-minor-mode` is also configured. You can 39 | give cargo commands from inside the buffer to run cargo commands, like 40 | C-c C-c C-b for `cargo-process-build`, C-c C-c 41 | C-t for `cargo-process-test` and C-c C-c C-r for 42 | `cargo-process-run` 43 | -------------------------------------------------------------------------------- /docs/modules/scheme.md: -------------------------------------------------------------------------------- 1 | # Prelude Scheme 2 | 3 | !!! Note 4 | 5 | This module builds on top of the shared [Lisp Base](lisp.md) module. 6 | 7 | ## lisp-mode 8 | 9 | Not much to say here, as `scheme-mode` is configured to use Prelude's 10 | default Lisp settings. 11 | 12 | ## Geiser 13 | 14 | This module bundles [Geiser](https://www.nongnu.org/geiser/), a popular interactive 15 | programming environment for Scheme. People familiar with Common Lisp's SLIME will 16 | feel right at home with Geiser. 17 | 18 | Note that Geiser supports many Scheme implementations: 19 | 20 | - Guile 2.2 or better 21 | - Chicken 4.8.0 or better 22 | - MIT/GNU Scheme 9.1 or better 23 | - Chibi Scheme 0.7 or better 24 | - Chez Scheme 9.4 or better 25 | - Gambit 4.9 or better 26 | - Racket 6.0 or better 27 | 28 | You can fire Geiser with `M-x geiser`. 29 | -------------------------------------------------------------------------------- /docs/prelude-cheatsheet.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bbatsov/prelude/3cf24d83eaadc426196b0bc49148c94260f78dff/docs/prelude-cheatsheet.pdf -------------------------------------------------------------------------------- /docs/support.md: -------------------------------------------------------------------------------- 1 | # Support 2 | 3 | Prelude currently has several official & unofficial support channels. 4 | 5 | For questions, suggestions and support refer to one of them. Please, don't 6 | use the support channels to report issues, as this makes them harder to track. 7 | 8 | ## Gitter 9 | 10 | Most internal discussions about the development of Prelude happen on its 11 | [gitter channel](https://gitter.im/bbatsov/prelude). You can often find 12 | Prelude's maintainers there and get some interesting news from the project's 13 | kitchen. 14 | 15 | ## Mailing List 16 | 17 | The [official mailing list](https://groups.google.com/forum/#!forum/emacs-prelude) is 18 | hosted at Google Groups. It's a low-traffic list, so don't be too hesitant to subscribe. 19 | 20 | ## Freenode 21 | 22 | If you're into IRC you can visit the `#prelude` channel on Freenode. 23 | It's not actively 24 | monitored by the Prelude maintainers themselves, but still you can get support 25 | from other Prelude users there. 26 | 27 | ## Stackoverflow 28 | 29 | We're also encouraging users to ask Prelude-related questions on StackOverflow. 30 | 31 | When doing so you should use the 32 | [emacs-prelude](https://stackoverflow.com/questions/tagged/emacs-prelude) tag. 33 | -------------------------------------------------------------------------------- /docs/troubleshooting.md: -------------------------------------------------------------------------------- 1 | # Troubleshooting 2 | 3 | ## Updating bundled packages 4 | 5 | Generally it's a good idea to do a package update before running 6 | updating Prelude, since the latest Prelude code might depend on newer 7 | versions of the bundled packages than you would currently have 8 | installed. 9 | 10 | If you're doing manual Prelude updates you should always do a package update first. 11 | 12 | M-x package-list-packages RET U x 13 | 14 | That's not necessary if you're using `M-x prelude-update`, since it 15 | will automatically update the installed packages. 16 | 17 | ## Problems with flyspell-mode 18 | 19 | Prelude makes heavy use of the flyspell-mode package for spell 20 | checking of various things. The proper operation of flyspell depends 21 | on the presence of the `aspell` program and an `en` dictionary on your 22 | system. You can install `aspell` and the dictionary on macOS with 23 | `homebrew` like this: 24 | 25 | ```shell 26 | brew install aspell --with-lang=en 27 | ``` 28 | 29 | On Linux distros - just use your distro's package manager. 30 | 31 | ## Ugly colors in the terminal Emacs version 32 | 33 | If your Emacs looks considerably uglier in a terminal (compared to the 34 | GUI version) try adding this to your `.bashrc` or `.zshrc`: 35 | 36 | ```bash 37 | export TERM=xterm-256color 38 | ``` 39 | 40 | Source the `.bashrc` file and start Emacs again. 41 | 42 | ## MELPA error on initial startup 43 | 44 | If you get some http connection error related to the MELPA repo 45 | just do a manual `M-x package-refresh-contents` and restart Emacs 46 | afterwards. 47 | 48 | ## Warnings on arrow navigation in editor buffers 49 | 50 | This is not a bug - it's a feature! I firmly believe that the one true 51 | way to use Emacs is by using it the way it was intended to be used (as 52 | far as navigation is concerned at least). 53 | 54 | If you'd like to be take this a step further and disable the arrow key navigation 55 | completely put this in your personal config: 56 | 57 | ```emacs-lisp 58 | (setq guru-warn-only nil) 59 | ``` 60 | 61 | To disable `guru-mode` completely add the following snippet to your 62 | personal Emacs config: 63 | 64 | ```emacs-lisp 65 | (setq prelude-guru nil) 66 | ``` 67 | 68 | ## Customized C-a behavior 69 | 70 | Prelude overrides `C-a` to behave as described 71 | [here](http://emacsredux.com/blog/2013/05/22/smarter-navigation-to-the-beginning-of-a-line/). If 72 | you don't like that simply add this to your personal config: 73 | 74 | ```emacs-lisp 75 | (global-set-key [remap move-beginning-of-line] 76 | 'move-beginning-of-line) 77 | ``` 78 | 79 | If you're using term-mode or ansi-term-mode, the above will not 80 | restore the default behaviour of sending the C-a key sequence directly 81 | to the terminal. As a workaround, you can remove the C-a binding from 82 | prelude-mode specifically for these as described 83 | [here](https://emacsredux.com/blog/2013/09/25/removing-key-bindings-from-minor-mode-keymaps/) 84 | by adding something like the following to your personal config: 85 | 86 | ```emacs-lisp 87 | (defun my-term-mode-hook () 88 | (let ((oldmap (cdr (assoc 'prelude-mode minor-mode-map-alist))) 89 | (newmap (make-sparse-keymap))) 90 | (set-keymap-parent newmap oldmap) 91 | (define-key newmap (kbd "C-a") nil) 92 | (make-local-variable 'minor-mode-overriding-map-alist) 93 | (push `(prelude-mode . ,newmap) minor-mode-overriding-map-alist))) 94 | 95 | (add-hook 'term-mode-hook 'my-term-mode-hook) 96 | ``` 97 | 98 | ## Poor ido matching performance on large datasets 99 | 100 | Prelude's `ido` module swaps the default `ido` flex matching with the 101 | more powerful [ido-flx](https://github.com/lewang/flx). 102 | 103 | The sorting algorithm `flx` uses is more complex, but yields better results. 104 | 105 | On slower machines, it may be necessary to lower `flx-ido-threshold` to 106 | ensure a smooth experience. 107 | 108 | ```emacs-lisp 109 | (setq flx-ido-threshold 1000) 110 | ``` 111 | 112 | You can always disable the improved sorting algorithm all together like this: 113 | 114 | ```emacs-lisp 115 | (flx-ido-mode -1) 116 | ``` 117 | 118 | ## Windows compatibility 119 | 120 | While everything in Prelude should work fine in Windows, I test it only 121 | with GNU/Linux & macOS, so there might be Windows-specific problems from time to 122 | time. This situation will probably improve over time. 123 | -------------------------------------------------------------------------------- /mkdocs.yml: -------------------------------------------------------------------------------- 1 | site_name: "Prelude: A sleek, modern, simple and powerful Emacs experience for everyone" 2 | repo_url: https://github.com/bbatsov/prelude 3 | copyright: "Copyright (C) 2011-2025 Bozhidar Batsov and Prelude contributors" 4 | docs_dir: docs 5 | nav: 6 | - Home: index.md 7 | - Installation: installation.md 8 | - Usage: usage.md 9 | - Configuration: configuration.md 10 | - Modules: 11 | - Overview: modules/index.md 12 | - Company: modules/company.md 13 | - ERC: modules/erc.md 14 | - Programming: modules/programming.md 15 | - Lisp: modules/lisp.md 16 | - Emacs Lisp: modules/emacs_lisp.md 17 | - Common Lisp: modules/common_lisp.md 18 | - Scheme: modules/scheme.md 19 | - Clojure: modules/clojure.md 20 | - Dart: modules/dart.md 21 | - Python: modules/python.md 22 | - Ruby: modules/ruby.md 23 | - Rust: modules/rust.md 24 | - F#: modules/fsharp.md 25 | - Go: modules/go.md 26 | - FAQ: faq.md 27 | - Troubleshooting: troubleshooting.md 28 | - Contributing: contributing.md 29 | - Support: support.md 30 | extra_css: 31 | - css/extra.css 32 | markdown_extensions: 33 | - admonition 34 | theme: readthedocs 35 | -------------------------------------------------------------------------------- /modules/prelude-c.el: -------------------------------------------------------------------------------- 1 | ;;; prelude-c.el --- Emacs Prelude: cc-mode configuration. 2 | ;; 3 | ;; Copyright © 2011-2025 Bozhidar Batsov 4 | ;; 5 | ;; Author: Bozhidar Batsov 6 | ;; URL: https://github.com/bbatsov/prelude 7 | 8 | ;; This file is not part of GNU Emacs. 9 | 10 | ;;; Commentary: 11 | 12 | ;; Some basic configuration for cc-mode and the modes derived from it. 13 | 14 | ;;; License: 15 | 16 | ;; This program is free software; you can redistribute it and/or 17 | ;; modify it under the terms of the GNU General Public License 18 | ;; as published by the Free Software Foundation; either version 3 19 | ;; of the License, or (at your option) any later version. 20 | ;; 21 | ;; This program is distributed in the hope that it will be useful, 22 | ;; but WITHOUT ANY WARRANTY; without even the implied warranty of 23 | ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 24 | ;; GNU General Public License for more details. 25 | ;; 26 | ;; You should have received a copy of the GNU General Public License 27 | ;; along with GNU Emacs; see the file COPYING. If not, write to the 28 | ;; Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, 29 | ;; Boston, MA 02110-1301, USA. 30 | 31 | ;;; Code: 32 | 33 | (require 'prelude-programming) 34 | 35 | (defun prelude-c-mode-common-defaults () 36 | (setq c-default-style "k&r" 37 | c-basic-offset 4) 38 | (c-set-offset 'substatement-open 0)) 39 | 40 | (setq prelude-c-mode-common-hook 'prelude-c-mode-common-defaults) 41 | 42 | ;; this will affect all modes derived from cc-mode, like 43 | ;; java-mode, php-mode, etc 44 | (add-hook 'c-mode-common-hook (lambda () 45 | (run-hooks 'prelude-c-mode-common-hook))) 46 | 47 | (defun prelude-makefile-mode-defaults () 48 | (whitespace-toggle-options '(tabs)) 49 | (setq indent-tabs-mode t )) 50 | 51 | (setq prelude-makefile-mode-hook 'prelude-makefile-mode-defaults) 52 | 53 | (add-hook 'makefile-mode-hook (lambda () 54 | (run-hooks 'prelude-makefile-mode-hook))) 55 | (provide 'prelude-c) 56 | 57 | ;;; prelude-c.el ends here 58 | -------------------------------------------------------------------------------- /modules/prelude-clojure.el: -------------------------------------------------------------------------------- 1 | ;;; prelude-clojure.el --- Emacs Prelude: Clojure programming configuration. 2 | ;; 3 | ;; Copyright © 2011-2025 Bozhidar Batsov 4 | ;; 5 | ;; Author: Bozhidar Batsov 6 | ;; URL: https://github.com/bbatsov/prelude 7 | 8 | ;; This file is not part of GNU Emacs. 9 | 10 | ;;; Commentary: 11 | 12 | ;; A basic setup for Clojure programming based on clojure-mode 13 | ;; and CIDER. 14 | 15 | ;;; License: 16 | 17 | ;; This program is free software; you can redistribute it and/or 18 | ;; modify it under the terms of the GNU General Public License 19 | ;; as published by the Free Software Foundation; either version 3 20 | ;; of the License, or (at your option) any later version. 21 | ;; 22 | ;; This program is distributed in the hope that it will be useful, 23 | ;; but WITHOUT ANY WARRANTY; without even the implied warranty of 24 | ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 25 | ;; GNU General Public License for more details. 26 | ;; 27 | ;; You should have received a copy of the GNU General Public License 28 | ;; along with GNU Emacs; see the file COPYING. If not, write to the 29 | ;; Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, 30 | ;; Boston, MA 02110-1301, USA. 31 | 32 | ;;; Code: 33 | 34 | (require 'prelude-lisp) 35 | (prelude-require-packages '(clojure-mode cider)) 36 | 37 | (with-eval-after-load 'clojure-mode 38 | (defun prelude-clojure-mode-defaults () 39 | (subword-mode +1) 40 | (run-hooks 'prelude-lisp-coding-hook)) 41 | 42 | (setq prelude-clojure-mode-hook 'prelude-clojure-mode-defaults) 43 | 44 | (add-hook 'clojure-mode-hook (lambda () 45 | (run-hooks 'prelude-clojure-mode-hook)))) 46 | 47 | (with-eval-after-load 'cider 48 | (setq nrepl-log-messages t) 49 | 50 | (add-hook 'cider-mode-hook 'eldoc-mode) 51 | 52 | (defun prelude-cider-repl-mode-defaults () 53 | (subword-mode +1) 54 | (run-hooks 'prelude-interactive-lisp-coding-hook)) 55 | 56 | (setq prelude-cider-repl-mode-hook 'prelude-cider-repl-mode-defaults) 57 | 58 | (add-hook 'cider-repl-mode-hook (lambda () 59 | (run-hooks 'prelude-cider-repl-mode-hook)))) 60 | 61 | (provide 'prelude-clojure) 62 | 63 | ;;; prelude-clojure.el ends here 64 | -------------------------------------------------------------------------------- /modules/prelude-coffee.el: -------------------------------------------------------------------------------- 1 | ;;; prelude-coffee.el --- Emacs Prelude: CoffeeScript programming support. 2 | ;; 3 | ;; Copyright © 2011-2025 Bozhidar Batsov 4 | ;; 5 | ;; Author: Bozhidar Batsov 6 | ;; URL: https://github.com/bbatsov/prelude 7 | 8 | ;; This file is not part of GNU Emacs. 9 | 10 | ;;; Commentary: 11 | 12 | ;; CoffeeScript is a nice little language that comples to JavaScript. 13 | 14 | ;;; License: 15 | 16 | ;; This program is free software; you can redistribute it and/or 17 | ;; modify it under the terms of the GNU General Public License 18 | ;; as published by the Free Software Foundation; either version 3 19 | ;; of the License, or (at your option) any later version. 20 | ;; 21 | ;; This program is distributed in the hope that it will be useful, 22 | ;; but WITHOUT ANY WARRANTY; without even the implied warranty of 23 | ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 24 | ;; GNU General Public License for more details. 25 | ;; 26 | ;; You should have received a copy of the GNU General Public License 27 | ;; along with GNU Emacs; see the file COPYING. If not, write to the 28 | ;; Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, 29 | ;; Boston, MA 02110-1301, USA. 30 | 31 | ;;; Code: 32 | 33 | (require 'prelude-programming) 34 | (prelude-require-package 'coffee-mode) 35 | 36 | (with-eval-after-load 'coffee-mode 37 | ;; CoffeeScript uses two spaces. 38 | (setq coffee-tab-width 2) 39 | 40 | ;; remove the "Generated by CoffeeScript" header 41 | (add-to-list 'coffee-args-compile "--no-header") 42 | 43 | (defun prelude-coffee-mode-defaults () 44 | ;; Update the already compiled js on save 45 | (and (buffer-file-name) 46 | (file-exists-p (buffer-file-name)) 47 | (file-exists-p (coffee-compiled-file-name (buffer-file-name))) 48 | (coffee-cos-mode t)) 49 | (subword-mode +1)) 50 | 51 | (setq prelude-coffee-mode-hook 'prelude-coffee-mode-defaults) 52 | 53 | (add-hook 'coffee-mode-hook (lambda () 54 | (run-hooks 'prelude-coffee-mode-hook)))) 55 | (provide 'prelude-coffee) 56 | 57 | ;;; prelude-coffee.el ends here 58 | -------------------------------------------------------------------------------- /modules/prelude-common-lisp.el: -------------------------------------------------------------------------------- 1 | ;;; prelude-common-lisp.el --- Emacs Prelude: lisp-mode and SLIME config. 2 | ;; 3 | ;; Copyright © 2011-2025 Bozhidar Batsov 4 | ;; 5 | ;; Author: Bozhidar Batsov 6 | ;; URL: https://github.com/bbatsov/prelude 7 | 8 | ;; This file is not part of GNU Emacs. 9 | 10 | ;;; Commentary: 11 | 12 | ;; Configuration for lisp-mode and SLIME. 13 | 14 | ;;; License: 15 | 16 | ;; This program is free software; you can redistribute it and/or 17 | ;; modify it under the terms of the GNU General Public License 18 | ;; as published by the Free Software Foundation; either version 3 19 | ;; of the License, or (at your option) any later version. 20 | ;; 21 | ;; This program is distributed in the hope that it will be useful, 22 | ;; but WITHOUT ANY WARRANTY; without even the implied warranty of 23 | ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 24 | ;; GNU General Public License for more details. 25 | ;; 26 | ;; You should have received a copy of the GNU General Public License 27 | ;; along with GNU Emacs; see the file COPYING. If not, write to the 28 | ;; Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, 29 | ;; Boston, MA 02110-1301, USA. 30 | 31 | ;;; Code: 32 | 33 | (require 'prelude-lisp) 34 | 35 | (prelude-require-package 'slime) 36 | 37 | ;; the SBCL configuration file is in Common Lisp 38 | (add-to-list 'auto-mode-alist '("\\.sbclrc\\'" . lisp-mode)) 39 | 40 | ;; Open files with .cl extension in lisp-mode 41 | (add-to-list 'auto-mode-alist '("\\.cl\\'" . lisp-mode)) 42 | 43 | (add-hook 'lisp-mode-hook (lambda () (run-hooks 'prelude-lisp-coding-hook))) 44 | 45 | (with-eval-after-load "slime" 46 | ;; a list of alternative Common Lisp implementations that can be 47 | ;; used with SLIME. Note that their presence render 48 | ;; inferior-lisp-program useless. This variable holds a list of 49 | ;; programs and if you invoke SLIME with a negative prefix 50 | ;; argument, M-- M-x slime, you can select a program from that list. 51 | (setq slime-lisp-implementations 52 | '((ccl ("ccl")) 53 | (clisp ("clisp" "-q")) 54 | (cmucl ("cmucl" "-quiet")) 55 | (sbcl ("sbcl" "--noinform") :coding-system utf-8-unix))) 56 | 57 | ;; select the default value from slime-lisp-implementations 58 | (if (and (eq system-type 'darwin) 59 | (executable-find "ccl")) 60 | ;; default to Clozure CL on macOS 61 | (setq slime-default-lisp 'ccl) 62 | ;; default to SBCL on Linux and Windows 63 | (setq slime-default-lisp 'sbcl)) 64 | 65 | ;; Add fancy slime contribs 66 | (setq slime-contribs '(slime-fancy slime-cl-indent)) 67 | 68 | (setq slime-complete-symbol-function 'slime-fuzzy-complete-symbol 69 | slime-fuzzy-completion-in-place t 70 | slime-enable-evaluate-in-emacs t 71 | slime-autodoc-use-multiline-p t) 72 | 73 | ;; rainbow-delimeters messes up colors in slime-repl, and doesn't seem to work 74 | ;; anyway, so we won't use prelude-lisp-coding-defaults. 75 | (add-hook 'slime-repl-mode-hook (lambda () 76 | (smartparens-strict-mode +1) 77 | (whitespace-mode -1))) 78 | 79 | (define-key slime-mode-map (kbd "C-c C-s") 'slime-selector)) 80 | 81 | (provide 'prelude-common-lisp) 82 | 83 | ;;; prelude-common-lisp.el ends here 84 | -------------------------------------------------------------------------------- /modules/prelude-company.el: -------------------------------------------------------------------------------- 1 | ;;; prelude-company.el --- company-mode setup 2 | ;; 3 | ;; Copyright © 2011-2025 Bozhidar Batsov 4 | ;; 5 | ;; Author: Bozhidar Batsov 6 | ;; URL: https://github.com/bbatsov/prelude 7 | 8 | ;; This file is not part of GNU Emacs. 9 | 10 | ;;; Commentary: 11 | 12 | ;; company-mode config. 13 | 14 | ;;; License: 15 | 16 | ;; This program is free software; you can redistribute it and/or 17 | ;; modify it under the terms of the GNU General Public License 18 | ;; as published by the Free Software Foundation; either version 3 19 | ;; of the License, or (at your option) any later version. 20 | ;; 21 | ;; This program is distributed in the hope that it will be useful, 22 | ;; but WITHOUT ANY WARRANTY; without even the implied warranty of 23 | ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 24 | ;; GNU General Public License for more details. 25 | ;; 26 | ;; You should have received a copy of the GNU General Public License 27 | ;; along with GNU Emacs; see the file COPYING. If not, write to the 28 | ;; Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, 29 | ;; Boston, MA 02110-1301, USA. 30 | 31 | ;;; Code: 32 | (prelude-require-packages '(company)) 33 | 34 | (require 'company) 35 | (require 'diminish) 36 | 37 | (setq company-idle-delay 0.5) 38 | (setq company-show-numbers t) 39 | (setq company-tooltip-limit 10) 40 | (setq company-minimum-prefix-length 2) 41 | (setq company-tooltip-align-annotations t) 42 | ;; invert the navigation direction if the the completion popup-isearch-match 43 | ;; is displayed on top (happens near the bottom of windows) 44 | (setq company-tooltip-flip-when-above t) 45 | 46 | (global-company-mode 1) 47 | (diminish 'company-mode) 48 | 49 | (provide 'prelude-company) 50 | ;;; prelude-company.el ends here 51 | -------------------------------------------------------------------------------- /modules/prelude-css.el: -------------------------------------------------------------------------------- 1 | ;;; prelude-css.el --- Emacs Prelude: css support 2 | ;; 3 | ;; Copyright © 2011-2025 Bozhidar Batsov 4 | ;; 5 | ;; Author: Bozhidar Batsov 6 | ;; URL: https://github.com/bbatsov/prelude 7 | 8 | ;; This file is not part of GNU Emacs. 9 | 10 | ;;; Commentary: 11 | 12 | ;; Some basic configuration for css-mode. 13 | 14 | ;;; License: 15 | 16 | ;; This program is free software; you can redistribute it and/or 17 | ;; modify it under the terms of the GNU General Public License 18 | ;; as published by the Free Software Foundation; either version 3 19 | ;; of the License, or (at your option) any later version. 20 | ;; 21 | ;; This program is distributed in the hope that it will be useful, 22 | ;; but WITHOUT ANY WARRANTY; without even the implied warranty of 23 | ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 24 | ;; GNU General Public License for more details. 25 | ;; 26 | ;; You should have received a copy of the GNU General Public License 27 | ;; along with GNU Emacs; see the file COPYING. If not, write to the 28 | ;; Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, 29 | ;; Boston, MA 02110-1301, USA. 30 | 31 | ;;; Code: 32 | 33 | (with-eval-after-load 'css-mode 34 | (prelude-require-packages '(rainbow-mode)) 35 | 36 | (setq css-indent-offset 2) 37 | 38 | (defun prelude-css-mode-defaults () 39 | (rainbow-mode +1) 40 | (run-hooks 'prelude-prog-mode-hook)) 41 | 42 | (setq prelude-css-mode-hook 'prelude-css-mode-defaults) 43 | 44 | (add-hook 'css-mode-hook (lambda () 45 | (run-hooks 'prelude-css-mode-hook)))) 46 | 47 | (provide 'prelude-css) 48 | ;;; prelude-css.el ends here 49 | -------------------------------------------------------------------------------- /modules/prelude-dart.el: -------------------------------------------------------------------------------- 1 | ;;; prelude-dart.el --- Emacs Prelude: Dart programming configuration. 2 | ;; 3 | ;; Copyright © 2011-2025 Bozhidar Batsov 4 | ;; 5 | ;; Author: Rafael Medina 6 | ;; URL: https://github.com/bbatsov/prelude 7 | 8 | ;; This file is not part of GNU Emacs. 9 | 10 | ;;; Commentary: 11 | 12 | ;; Basic configuration for programming in Dart. 13 | 14 | ;;; License: 15 | 16 | ;; This program is free software; you can redistribute it and/or 17 | ;; modify it under the terms of the GNU General Public License 18 | ;; as published by the Free Software Foundation; either version 3 19 | ;; of the License, or (at your option) any later version. 20 | ;; 21 | ;; This program is distributed in the hope that it will be useful, 22 | ;; but WITHOUT ANY WARRANTY; without even the implied warranty of 23 | ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 24 | ;; GNU General Public License for more details. 25 | ;; 26 | ;; You should have received a copy of the GNU General Public License 27 | ;; along with GNU Emacs; see the file COPYING. If not, write to the 28 | ;; Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, 29 | ;; Boston, MA 02110-1301, USA. 30 | 31 | ;;; Code: 32 | 33 | (require 'prelude-lsp) 34 | (prelude-require-packages '(lsp-dart)) 35 | 36 | (with-eval-after-load 'lsp-dart 37 | (add-hook 'dart-mode-hook #'lsp)) 38 | 39 | (with-eval-after-load 'dart-mode 40 | (defun prelude-dart-mode-defaults () 41 | 42 | (setq dap-launch-configuration-providers '(dap-debug-template-configurations-provider)) 43 | 44 | ;; Add to default dart-mode key bindings 45 | (lsp-dart-define-key "s o" #'lsp-dart-show-outline) 46 | (lsp-dart-define-key "s f" #'lsp-dart-show-flutter-outline) 47 | (lsp-dart-dap-setup)) 48 | 49 | (setq prelude-dart-mode-hook 'prelude-dart-mode-defaults) 50 | 51 | (add-hook 'dart-mode-hook (lambda () 52 | (run-hooks 'prelude-dart-mode-hook)))) 53 | 54 | (provide 'prelude-dart) 55 | 56 | ;;; prelude-dart.el ends here 57 | -------------------------------------------------------------------------------- /modules/prelude-elixir.el: -------------------------------------------------------------------------------- 1 | ;;; prelude-elixir.el --- Emacs Prelude: Elixir programming support. 2 | ;; 3 | ;; Copyright © 2014-2025 Samuel Tonini 4 | ;; 5 | ;; Author: Samuel Tonini 6 | 7 | ;; This file is not part of GNU Emacs. 8 | 9 | ;;; Commentary: 10 | 11 | ;; Some basic configuration for Elixir development. 12 | 13 | ;;; License: 14 | 15 | ;; This program is free software; you can redistribute it and/or 16 | ;; modify it under the terms of the GNU General Public License 17 | ;; as published by the Free Software Foundation; either version 3 18 | ;; of the License, or (at your option) any later version. 19 | ;; 20 | ;; This program is distributed in the hope that it will be useful, 21 | ;; but WITHOUT ANY WARRANTY; without even the implied warranty of 22 | ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 23 | ;; GNU General Public License for more details. 24 | ;; 25 | ;; You should have received a copy of the GNU General Public License 26 | ;; along with GNU Emacs; see the file COPYING. If not, write to the 27 | ;; Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, 28 | ;; Boston, MA 02110-1301, USA. 29 | 30 | ;;; Code: 31 | 32 | (require 'prelude-programming) 33 | 34 | (prelude-require-packages '(elixir-mode alchemist)) 35 | 36 | (provide 'prelude-elixir) 37 | 38 | ;;; prelude-elixir.el ends here 39 | -------------------------------------------------------------------------------- /modules/prelude-emacs-lisp.el: -------------------------------------------------------------------------------- 1 | ;;; prelude-emacs-lisp.el --- Emacs Prelude: Nice config for Elisp programming. 2 | ;; 3 | ;; Copyright © 2011-2025 Bozhidar Batsov 4 | ;; 5 | ;; Author: Bozhidar Batsov 6 | ;; URL: https://github.com/bbatsov/prelude 7 | 8 | ;; This file is not part of GNU Emacs. 9 | 10 | ;;; Commentary: 11 | 12 | ;; Nice config for Elisp Programming. 13 | 14 | ;;; License: 15 | 16 | ;; This program is free software; you can redistribute it and/or 17 | ;; modify it under the terms of the GNU General Public License 18 | ;; as published by the Free Software Foundation; either version 3 19 | ;; of the License, or (at your option) any later version. 20 | ;; 21 | ;; This program is distributed in the hope that it will be useful, 22 | ;; but WITHOUT ANY WARRANTY; without even the implied warranty of 23 | ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 24 | ;; GNU General Public License for more details. 25 | ;; 26 | ;; You should have received a copy of the GNU General Public License 27 | ;; along with GNU Emacs; see the file COPYING. If not, write to the 28 | ;; Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, 29 | ;; Boston, MA 02110-1301, USA. 30 | 31 | ;;; Code: 32 | 33 | (require 'prelude-lisp) 34 | (require 'crux) 35 | 36 | (prelude-require-packages '(elisp-slime-nav rainbow-mode)) 37 | 38 | (defun prelude-recompile-elc-on-save () 39 | "Recompile your elc when saving an elisp file." 40 | (add-hook 'after-save-hook 41 | (lambda () 42 | (when (and 43 | (string-prefix-p prelude-dir (file-truename buffer-file-name)) 44 | (file-exists-p (byte-compile-dest-file buffer-file-name))) 45 | (emacs-lisp-byte-compile))) 46 | nil 47 | t)) 48 | 49 | (defun prelude-visit-ielm () 50 | "Switch to default `ielm' buffer. 51 | Start `ielm' if it's not already running." 52 | (interactive) 53 | (crux-start-or-switch-to 'ielm "*ielm*")) 54 | 55 | (define-key emacs-lisp-mode-map (kbd "C-c C-z") 'prelude-visit-ielm) 56 | (define-key emacs-lisp-mode-map (kbd "C-c C-c") 'eval-defun) 57 | (define-key emacs-lisp-mode-map (kbd "C-c C-b") 'eval-buffer) 58 | 59 | (defun prelude-conditional-emacs-lisp-checker () 60 | "Don't check doc style in Emacs Lisp test files." 61 | (let ((file-name (buffer-file-name))) 62 | (when (and file-name (string-match-p ".*-tests?\\.el\\'" file-name)) 63 | (setq-local flycheck-checkers '(emacs-lisp))))) 64 | 65 | (defun prelude-emacs-lisp-mode-defaults () 66 | "Sensible defaults for `emacs-lisp-mode'." 67 | (run-hooks 'prelude-lisp-coding-hook) 68 | (eldoc-mode +1) 69 | (prelude-recompile-elc-on-save) 70 | (rainbow-mode +1) 71 | (setq mode-name "EL") 72 | (prelude-conditional-emacs-lisp-checker)) 73 | 74 | (setq prelude-emacs-lisp-mode-hook 'prelude-emacs-lisp-mode-defaults) 75 | 76 | (add-hook 'emacs-lisp-mode-hook (lambda () 77 | (run-hooks 'prelude-emacs-lisp-mode-hook))) 78 | 79 | (add-to-list 'auto-mode-alist '("Cask\\'" . emacs-lisp-mode)) 80 | 81 | ;; ielm is an interactive Emacs Lisp shell 82 | (defun prelude-ielm-mode-defaults () 83 | "Sensible defaults for `ielm'." 84 | (run-hooks 'prelude-interactive-lisp-coding-hook) 85 | (eldoc-mode +1)) 86 | 87 | (setq prelude-ielm-mode-hook 'prelude-ielm-mode-defaults) 88 | 89 | (add-hook 'ielm-mode-hook (lambda () 90 | (run-hooks 'prelude-ielm-mode-hook))) 91 | 92 | (with-eval-after-load "elisp-slime-nav" 93 | (diminish 'elisp-slime-nav-mode)) 94 | (with-eval-after-load "rainbow-mode" 95 | (diminish 'rainbow-mode)) 96 | (with-eval-after-load "eldoc" 97 | (diminish 'eldoc-mode)) 98 | 99 | (with-eval-after-load "ielm" 100 | (define-key ielm-map (kbd "M-(") (prelude-wrap-with "(")) 101 | (define-key ielm-map (kbd "M-\"") (prelude-wrap-with "\""))) 102 | 103 | ;; enable elisp-slime-nav-mode 104 | (dolist (hook '(emacs-lisp-mode-hook ielm-mode-hook)) 105 | (add-hook hook 'elisp-slime-nav-mode)) 106 | 107 | (defun conditionally-enable-smartparens-mode () 108 | "Enable `smartparens-mode' in the minibuffer, during `eval-expression'." 109 | (if (eq this-command 'eval-expression) 110 | (smartparens-mode 1))) 111 | 112 | (add-hook 'minibuffer-setup-hook 'conditionally-enable-smartparens-mode) 113 | 114 | (provide 'prelude-emacs-lisp) 115 | 116 | ;;; prelude-emacs-lisp.el ends here 117 | -------------------------------------------------------------------------------- /modules/prelude-erc.el: -------------------------------------------------------------------------------- 1 | ;;; prelude-erc.el --- Emacs Prelude: ERC mode configuration. 2 | ;; 3 | ;; Copyright © 2011-2025 Bozhidar Batsov 4 | ;; 5 | ;; Author: Bozhidar Batsov 6 | ;; URL: https://github.com/bbatsov/prelude 7 | 8 | ;; This file is not part of GNU Emacs. 9 | 10 | ;;; Commentary: 11 | 12 | ;; Some basic configuration for ERC mode, which should make your 13 | ;; IRC experience a bit more pleasant. 14 | 15 | ;;; License: 16 | 17 | ;; This program is free software; you can redistribute it and/or 18 | ;; modify it under the terms of the GNU General Public License 19 | ;; as published by the Free Software Foundation; either version 3 20 | ;; of the License, or (at your option) any later version. 21 | ;; 22 | ;; This program is distributed in the hope that it will be useful, 23 | ;; but WITHOUT ANY WARRANTY; without even the implied warranty of 24 | ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 25 | ;; GNU General Public License for more details. 26 | ;; 27 | ;; You should have received a copy of the GNU General Public License 28 | ;; along with GNU Emacs; see the file COPYING. If not, write to the 29 | ;; Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, 30 | ;; Boston, MA 02110-1301, USA. 31 | 32 | ;;; Code: 33 | 34 | (require 'erc) 35 | (require 'erc-log) 36 | (require 'erc-notify) 37 | (require 'erc-spelling) 38 | (require 'erc-autoaway) 39 | 40 | ;; Interpret mIRC-style color commands in IRC chats 41 | (setq erc-interpret-mirc-color t) 42 | 43 | ;; The following are commented out by default, but users of other 44 | ;; non-Emacs IRC clients might find them useful. 45 | ;; Kill buffers for channels after /part 46 | (setq erc-kill-buffer-on-part t) 47 | ;; Kill buffers for private queries after quitting the server 48 | (setq erc-kill-queries-on-quit t) 49 | ;; Kill buffers for server messages after quitting the server 50 | (setq erc-kill-server-buffer-on-quit t) 51 | 52 | ;; open query buffers in the current window 53 | (setq erc-query-display 'buffer) 54 | 55 | ;; exclude boring stuff from tracking 56 | (erc-track-mode t) 57 | (setq erc-track-exclude-types '("JOIN" "NICK" "PART" "QUIT" "MODE" 58 | "324" "329" "332" "333" "353" "477")) 59 | 60 | ;; logging 61 | (setq erc-log-channels-directory "~/.erc/logs/") 62 | 63 | (if (not (file-exists-p erc-log-channels-directory)) 64 | (mkdir erc-log-channels-directory t)) 65 | 66 | (setq erc-save-buffer-on-part t) 67 | ;; FIXME - this advice is wrong and is causing problems on Emacs exit 68 | ;; (defadvice save-buffers-kill-emacs (before save-logs (arg) activate) 69 | ;; (save-some-buffers t (lambda () (when (eq major-mode 'erc-mode) t)))) 70 | 71 | ;; truncate long irc buffers 72 | (erc-truncate-mode +1) 73 | 74 | ;; enable spell checking 75 | (when prelude-flyspell 76 | (erc-spelling-mode 1)) 77 | ;; set different dictionaries by different servers/channels 78 | ;;(setq erc-spelling-dictionaries '(("#emacs" "american"))) 79 | 80 | (defvar erc-notify-nick-alist nil 81 | "Alist of nicks and the last time they tried to trigger a 82 | notification") 83 | 84 | (defvar erc-notify-timeout 10 85 | "Number of seconds that must elapse between notifications from 86 | the same person.") 87 | 88 | (defun erc-notify-allowed-p (nick &optional delay) 89 | "Return non-nil if a notification should be made for NICK. 90 | If DELAY is specified, it will be the minimum time in seconds 91 | that can occur between two notifications. The default is 92 | `erc-notify-timeout'." 93 | (unless delay (setq delay erc-notify-timeout)) 94 | (let ((cur-time (time-to-seconds (current-time))) 95 | (cur-assoc (assoc nick erc-notify-nick-alist)) 96 | (last-time nil)) 97 | (if cur-assoc 98 | (progn 99 | (setq last-time (cdr cur-assoc)) 100 | (setcdr cur-assoc cur-time) 101 | (> (abs (- cur-time last-time)) delay)) 102 | (push (cons nick cur-time) erc-notify-nick-alist) 103 | t))) 104 | 105 | ;; autoaway setup 106 | (setq erc-auto-discard-away t) 107 | (setq erc-autoaway-idle-seconds 600) 108 | (setq erc-autoaway-use-emacs-idle t) 109 | 110 | ;; utf-8 always and forever 111 | (setq erc-server-coding-system '(utf-8 . utf-8)) 112 | 113 | 114 | (defvar my-fav-irc '( "irc.freenode.net" ) 115 | "Stores the list of IRC servers that you want to connect to with start-irc.") 116 | 117 | (defvar bye-irc-message "Asta la vista" 118 | "Message string to be sent while quitting IRC.") 119 | 120 | (defcustom prelude-new-irc-persp nil 121 | "True (t) means start IRC in new perspective." 122 | :type 'boolean 123 | :require 'prelude-erc 124 | :group 'prelude) 125 | 126 | (defun connect-to-erc (server) 127 | "Connects securely to IRC SERVER over TLS at port 6697." 128 | (erc-tls :server server 129 | :port 6697 130 | :nick erc-nick )) 131 | 132 | (defun start-irc () 133 | "Connect to IRC?" 134 | (interactive) 135 | (when (y-or-n-p "Do you want to start IRC? ") 136 | (when prelude-new-irc-persp 137 | (persp-switch "IRC")) 138 | (mapcar 'connect-to-erc my-fav-irc))) 139 | 140 | (defun filter-server-buffers () 141 | (delq nil 142 | (mapcar 143 | (lambda (x) (and (erc-server-buffer-p x) x)) 144 | (buffer-list)))) 145 | 146 | (defun stop-irc () 147 | "Disconnects from all irc servers." 148 | (interactive) 149 | (when prelude-new-irc-persp 150 | (persp-switch "IRC")) 151 | (dolist (buffer (filter-server-buffers)) 152 | (message "Server buffer: %s" (buffer-name buffer)) 153 | (with-current-buffer buffer 154 | (erc-quit-server bye-irc-message))) 155 | (when prelude-new-irc-persp 156 | (persp-kill "IRC"))) 157 | 158 | (provide 'prelude-erc) 159 | 160 | ;;; prelude-erc.el ends here 161 | -------------------------------------------------------------------------------- /modules/prelude-erlang.el: -------------------------------------------------------------------------------- 1 | ;;; prelude-erlang.el --- Emacs Prelude: Erlang programming support. 2 | ;; 3 | ;; Copyright © 2011-2025 Gleb Peregud 4 | ;; 5 | ;; Author: Gleb Peregud 6 | 7 | ;; This file is not part of GNU Emacs. 8 | 9 | ;;; Commentary: 10 | 11 | ;; Erlang is a concurrent functional language. 12 | 13 | ;;; License: 14 | 15 | ;; This program is free software; you can redistribute it and/or 16 | ;; modify it under the terms of the GNU General Public License 17 | ;; as published by the Free Software Foundation; either version 3 18 | ;; of the License, or (at your option) any later version. 19 | ;; 20 | ;; This program is distributed in the hope that it will be useful, 21 | ;; but WITHOUT ANY WARRANTY; without even the implied warranty of 22 | ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 23 | ;; GNU General Public License for more details. 24 | ;; 25 | ;; You should have received a copy of the GNU General Public License 26 | ;; along with GNU Emacs; see the file COPYING. If not, write to the 27 | ;; Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, 28 | ;; Boston, MA 02110-1301, USA. 29 | 30 | ;;; Code: 31 | 32 | (require 'prelude-programming) 33 | (prelude-require-packages '(erlang)) 34 | 35 | (defcustom wrangler-path nil 36 | "The location of wrangler elisp directory." 37 | :group 'prelude-erlang 38 | :type 'string 39 | :safe 'stringp) 40 | 41 | (when prelude-projectile 42 | (require 'projectile)) 43 | 44 | (when (require 'erlang-start nil t) 45 | 46 | (with-eval-after-load 'erlang-mode 47 | (flymake-mode)) 48 | 49 | (when (not (null wrangler-path)) 50 | (add-to-list 'load-path wrangler-path) 51 | (require 'wrangler))) 52 | 53 | (when prelude-projectile 54 | (add-hook 'erlang-mode-hook (lambda () 55 | (setq erlang-compile-function 'projectile-compile-project)))) 56 | 57 | (provide 'prelude-erlang) 58 | 59 | ;;; prelude-erlang.el ends here 60 | -------------------------------------------------------------------------------- /modules/prelude-evil.el: -------------------------------------------------------------------------------- 1 | ;;; prelude-evil.el --- Emacs Prelude: evil-mode configuration. 2 | ;; 3 | ;; Copyright © 2011-2025 Bozhidar Batsov 4 | ;; 5 | ;; Author: Bozhidar Batsov 6 | ;; URL: https://github.com/bbatsov/prelude 7 | 8 | ;; This file is not part of GNU Emacs. 9 | 10 | ;;; Commentary: 11 | 12 | ;; Some basic configuration for evil-mode. 13 | 14 | ;;; License: 15 | 16 | ;; This program is free software; you can redistribute it and/or 17 | ;; modify it under the terms of the GNU General Public License 18 | ;; as published by the Free Software Foundation; either version 3 19 | ;; of the License, or (at your option) any later version. 20 | ;; 21 | ;; This program is distributed in the hope that it will be useful, 22 | ;; but WITHOUT ANY WARRANTY; without even the implied warranty of 23 | ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 24 | ;; GNU General Public License for more details. 25 | ;; 26 | ;; You should have received a copy of the GNU General Public License 27 | ;; along with GNU Emacs; see the file COPYING. If not, write to the 28 | ;; Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, 29 | ;; Boston, MA 02110-1301, USA. 30 | 31 | ;;; Code: 32 | 33 | ;;; goto-chg lets you use the g-; and g-, to go to recent changes 34 | ;;; evil-visualstar enables searching visual selection with * 35 | ;;; evil-numbers enables vim style numeric incrementing and decrementing 36 | 37 | (prelude-require-packages '(evil goto-chg evil-surround evil-visualstar evil-numbers)) 38 | 39 | (require 'evil-visualstar) 40 | 41 | (setq evil-mode-line-format 'before) 42 | 43 | (setq evil-emacs-state-cursor '("red" box)) 44 | (setq evil-normal-state-cursor '("gray" box)) 45 | (setq evil-visual-state-cursor '("gray" box)) 46 | (setq evil-insert-state-cursor '("gray" bar)) 47 | (setq evil-motion-state-cursor '("gray" box)) 48 | 49 | ;; prevent esc-key from translating to meta-key in terminal mode 50 | (setq evil-esc-delay 0) 51 | 52 | (evil-mode 1) 53 | (global-evil-surround-mode 1) 54 | 55 | (define-key evil-normal-state-map (kbd "C-A") 56 | 'evil-numbers/inc-at-pt) 57 | (define-key evil-normal-state-map (kbd "C-S-A") 58 | 'evil-numbers/dec-at-pt) 59 | 60 | ;; 61 | ;; Other useful Commands 62 | ;; 63 | (evil-ex-define-cmd "W" 'evil-write-all) 64 | (evil-ex-define-cmd "Tree" 'speedbar-get-focus) 65 | (evil-ex-define-cmd "linum" 'linum-mode) 66 | (evil-ex-define-cmd "Align" 'align-regexp) 67 | 68 | (defun prelude-yank-to-end-of-line () 69 | "Yank to end of line." 70 | (interactive) 71 | (evil-yank (point) (point-at-eol))) 72 | 73 | (define-key evil-normal-state-map 74 | (kbd "Y") 'prelude-yank-to-end-of-line) 75 | 76 | (defun prelude-shift-left-visual () 77 | "Shift left and restore visual selection." 78 | (interactive) 79 | (evil-shift-left (region-beginning) (region-end)) 80 | (evil-normal-state) 81 | (evil-visual-restore)) 82 | 83 | (defun prelude-shift-right-visual () 84 | "Shift right and restore visual selection." 85 | (interactive) 86 | (evil-shift-right (region-beginning) (region-end)) 87 | (evil-normal-state) 88 | (evil-visual-restore)) 89 | 90 | (define-key evil-visual-state-map (kbd ">") 'prelude-shift-right-visual) 91 | (define-key evil-visual-state-map (kbd "<") 'prelude-shift-left-visual) 92 | 93 | ;; Scrolling 94 | (defun prelude-evil-scroll-down-other-window () 95 | (interactive) 96 | (scroll-other-window)) 97 | 98 | (defun prelude-evil-scroll-up-other-window () 99 | (interactive) 100 | (scroll-other-window '-)) 101 | 102 | (define-key evil-normal-state-map 103 | (kbd "C-S-d") 'prelude-evil-scroll-down-other-window) 104 | 105 | (define-key evil-normal-state-map 106 | (kbd "C-S-u") 'prelude-evil-scroll-up-other-window) 107 | 108 | ;; 109 | ;; Magit from avsej 110 | ;; 111 | (evil-add-hjkl-bindings magit-log-mode-map 'emacs) 112 | (evil-add-hjkl-bindings magit-commit-mode-map 'emacs) 113 | (evil-add-hjkl-bindings magit-branch-manager-mode-map 'emacs 114 | "K" 'magit-discard 115 | "L" 'magit-log) 116 | (evil-add-hjkl-bindings magit-status-mode-map 'emacs 117 | "K" 'magit-discard 118 | "l" 'magit-log 119 | "h" 'magit-diff-toggle-refine-hunk) 120 | 121 | (setq evil-shift-width 2) 122 | 123 | ;;; enable avy with evil-mode 124 | (define-key evil-normal-state-map (kbd "SPC") 'avy-goto-word-1) 125 | 126 | ;;; snagged from Eric S. Fraga 127 | ;;; http://lists.gnu.org/archive/html/emacs-orgmode/2012-05/msg00153.html 128 | (defun prelude-evil-key-bindings-for-org () 129 | ;;(message "Defining evil key bindings for org") 130 | (evil-declare-key 'normal org-mode-map 131 | "gk" 'outline-up-heading 132 | "gj" 'outline-next-visible-heading 133 | "H" 'org-beginning-of-line ; smarter behaviour on headlines etc. 134 | "L" 'org-end-of-line ; smarter behaviour on headlines etc. 135 | "t" 'org-todo ; mark a TODO item as DONE 136 | ",c" 'org-cycle 137 | (kbd "TAB") 'org-cycle 138 | ",e" 'org-export-dispatch 139 | ",n" 'outline-next-visible-heading 140 | ",p" 'outline-previous-visible-heading 141 | ",t" 'org-set-tags-command 142 | ",u" 'outline-up-heading 143 | "$" 'org-end-of-line ; smarter behaviour on headlines etc. 144 | "^" 'org-beginning-of-line ; ditto 145 | "-" 'org-ctrl-c-minus ; change bullet style 146 | "<" 'org-metaleft ; out-dent 147 | ">" 'org-metaright ; indent 148 | )) 149 | (prelude-evil-key-bindings-for-org) 150 | (provide 'prelude-evil) 151 | -------------------------------------------------------------------------------- /modules/prelude-fsharp.el: -------------------------------------------------------------------------------- 1 | ;;; prelude-fsharp.el --- Emacs Prelude: F# programming support. 2 | ;; 3 | ;; Author: Andre Boechat 4 | 5 | ;; This file is not part of GNU Emacs. 6 | 7 | ;;; Commentary: 8 | 9 | ;; Basic setup for F# programming based on fsharp-mode and Eglot. 10 | 11 | ;;; License: 12 | 13 | ;; This program is free software; you can redistribute it and/or 14 | ;; modify it under the terms of the GNU General Public License 15 | ;; as published by the Free Software Foundation; either version 3 16 | ;; of the License, or (at your option) any later version. 17 | ;; 18 | ;; This program is distributed in the hope that it will be useful, 19 | ;; but WITHOUT ANY WARRANTY; without even the implied warranty of 20 | ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 21 | ;; GNU General Public License for more details. 22 | ;; 23 | ;; You should have received a copy of the GNU General Public License 24 | ;; along with GNU Emacs; see the file COPYING. If not, write to the 25 | ;; Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, 26 | ;; Boston, MA 02110-1301, USA. 27 | 28 | ;;; Code: 29 | 30 | (require 'prelude-programming) 31 | (prelude-require-packages '(fsharp-mode eglot-fsharp)) 32 | 33 | (with-eval-after-load 'fsharp-mode 34 | (defun prelude-fsharp-mode-defaults () 35 | ;; A reasonable default path to the F# compiler and interpreter on 36 | ;; Unix-like systems. 37 | ;; https://github.com/fsharp/emacs-fsharp-mode#compiler-and-repl-paths 38 | (setq inferior-fsharp-program "dotnet fsi --readline-") 39 | (require 'eglot-sharp)) 40 | 41 | (setq prelude-fsharp-mode-hook 'prelude-fsharp-mode-defaults) 42 | 43 | (add-hook 'fsharp-mode-hook (lambda () 44 | (run-hooks 'prelude-sharp-mode-hook)))) 45 | 46 | (provide 'prelude-fsharp) 47 | 48 | ;;; prelude-fsharp.el ends here 49 | -------------------------------------------------------------------------------- /modules/prelude-go.el: -------------------------------------------------------------------------------- 1 | ;;; prelude-go.el --- Emacs Prelude: Go programming support. 2 | ;; 3 | ;; Author: Doug MacEachern 4 | ;; URL: https://github.com/bbatsov/prelude 5 | 6 | ;; This file is not part of GNU Emacs. 7 | 8 | ;;; Commentary: 9 | 10 | ;; Prelude configuration for Go 11 | 12 | ;;; License: 13 | 14 | ;; This program is free software; you can redistribute it and/or 15 | ;; modify it under the terms of the GNU General Public License 16 | ;; as published by the Free Software Foundation; either version 3 17 | ;; of the License, or (at your option) any later version. 18 | ;; 19 | ;; This program is distributed in the hope that it will be useful, 20 | ;; but WITHOUT ANY WARRANTY; without even the implied warranty of 21 | ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 22 | ;; GNU General Public License for more details. 23 | ;; 24 | ;; You should have received a copy of the GNU General Public License 25 | ;; along with GNU Emacs; see the file COPYING. If not, write to the 26 | ;; Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, 27 | ;; Boston, MA 02110-1301, USA. 28 | 29 | ;;; Code: 30 | 31 | (require 'prelude-programming) 32 | (require 'prelude-lsp) 33 | 34 | (prelude-require-packages '(go-mode 35 | go-projectile 36 | lsp-mode 37 | lsp-ui 38 | company 39 | gotest)) 40 | 41 | (when prelude-projectile 42 | (require 'go-projectile)) 43 | 44 | ;; Ignore go test -c output files 45 | (add-to-list 'completion-ignored-extensions ".test") 46 | 47 | (define-key 'help-command (kbd "G") 'godoc) 48 | 49 | ;; Fix: super-save will cause go files to be saved when lsp-mode does 50 | ;; certain things, triggering lsp-format-buffer. This causes, inter alia, 51 | ;; commas to disappear when typing go function invocations 52 | (add-to-list 'super-save-predicates 53 | (lambda () (not (eq major-mode 'go-mode)))) 54 | 55 | (with-eval-after-load 'go-mode 56 | (defun prelude-go-mode-defaults () 57 | ;; Add to default go-mode key bindings 58 | (let ((map go-mode-map)) 59 | (define-key map (kbd "C-c a") 'go-test-current-project) ;; current package, really 60 | (define-key map (kbd "C-c m") 'go-test-current-file) 61 | (define-key map (kbd "C-c .") 'go-test-current-test) 62 | (define-key map (kbd "C-c b") 'go-run) 63 | (define-key map (kbd "C-h f") 'godoc-at-point)) 64 | 65 | ;; Prefer goimports to gofmt if installed 66 | (let ((goimports (executable-find "goimports"))) 67 | (when goimports 68 | (setq gofmt-command goimports))) 69 | 70 | ;; stop whitespace being highlighted 71 | (whitespace-toggle-options '(tabs)) 72 | 73 | ;; CamelCase aware editing operations 74 | (subword-mode +1)) 75 | 76 | ;; if yas is present, this enables yas-global-mode 77 | ;; which provides completion via company 78 | (if (fboundp 'yas-global-mode) 79 | (yas-global-mode)) 80 | 81 | ;; configure lsp for go 82 | (defun lsp-go-install-save-hooks () 83 | (add-hook 'before-save-hook #'lsp-format-buffer t t) 84 | (add-hook 'before-save-hook #'lsp-organize-imports t t)) 85 | (add-hook 'go-mode-hook #'lsp-go-install-save-hooks) 86 | (add-hook 'go-mode-hook #'lsp-deferred) 87 | 88 | (setq prelude-go-mode-hook 'prelude-go-mode-defaults) 89 | (add-hook 'go-mode-hook (lambda () 90 | (run-hooks 'prelude-go-mode-hook)))) 91 | 92 | (provide 'prelude-go) 93 | ;;; prelude-go.el ends here 94 | -------------------------------------------------------------------------------- /modules/prelude-haskell.el: -------------------------------------------------------------------------------- 1 | ;;; prelude-haskell.el --- Emacs Prelude: Nice config for Haskell programming. 2 | ;; 3 | ;; Copyright © 2011-2025 Bozhidar Batsov 4 | ;; 5 | ;; Author: Bozhidar Batsov 6 | ;; URL: https://github.com/bbatsov/prelude 7 | 8 | ;; This file is not part of GNU Emacs. 9 | 10 | ;;; Commentary: 11 | 12 | ;; Nice config for Haskell programming. 13 | 14 | ;;; License: 15 | 16 | ;; This program is free software; you can redistribute it and/or 17 | ;; modify it under the terms of the GNU General Public License 18 | ;; as published by the Free Software Foundation; either version 3 19 | ;; of the License, or (at your option) any later version. 20 | ;; 21 | ;; This program is distributed in the hope that it will be useful, 22 | ;; but WITHOUT ANY WARRANTY; without even the implied warranty of 23 | ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 24 | ;; GNU General Public License for more details. 25 | ;; 26 | ;; You should have received a copy of the GNU General Public License 27 | ;; along with GNU Emacs; see the file COPYING. If not, write to the 28 | ;; Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, 29 | ;; Boston, MA 02110-1301, USA. 30 | 31 | ;;; Code: 32 | 33 | (require 'prelude-programming) 34 | (prelude-require-packages '(haskell-mode)) 35 | 36 | (with-eval-after-load 'haskell-mode 37 | (defun prelude-haskell-mode-defaults () 38 | (subword-mode +1) 39 | (eldoc-mode +1) 40 | (haskell-indentation-mode +1) 41 | (interactive-haskell-mode +1)) 42 | 43 | (setq prelude-haskell-mode-hook 'prelude-haskell-mode-defaults) 44 | 45 | (add-hook 'haskell-mode-hook (lambda () 46 | (run-hooks 'prelude-haskell-mode-hook)))) 47 | 48 | (provide 'prelude-haskell) 49 | 50 | ;;; prelude-haskell.el ends here 51 | -------------------------------------------------------------------------------- /modules/prelude-helm-everywhere.el: -------------------------------------------------------------------------------- 1 | ;;; prelude-helm-everywhere.el --- Enable Helm everywhere 2 | ;; 3 | ;; Copyright © 2014-2025 Tu, Do Hoang 4 | ;; 5 | ;; Author: Tu, Do Hoang (tuhdo1710@gmail.com) 6 | ;; URL: https://github.com/bbatsov/prelude 7 | 8 | ;; This file is not part of GNU Emacs. 9 | 10 | ;;; Commentary: 11 | 12 | ;; Enable Helm everywhere with global key bindings to replace common 13 | ;; global bindings and `helm-mode' is activated to replace `completing-read' 14 | ;; with `helm-completing-read-default', so users can use Helm with every prompt. 15 | 16 | ;;; License: 17 | 18 | ;; This program is free software; you can redistribute it and/or 19 | ;; modify it under the terms of the GNU General Public License 20 | ;; as published by the Free Software Foundation; either version 3 21 | ;; of the License, or (at your option) any later version. 22 | ;; 23 | ;; This program is distributed in the hope that it will be useful, 24 | ;; but WITHOUT ANY WARRANTY; without even the implied warranty of 25 | ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 26 | ;; GNU General Public License for more details. 27 | ;; 28 | ;; You should have received a copy of the GNU General Public License 29 | ;; along with GNU Emacs; see the file COPYING. If not, write to the 30 | ;; Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, 31 | ;; Boston, MA 02110-1301, USA. 32 | 33 | ;;; Code: 34 | (require 'prelude-helm) 35 | (prelude-require-packages '(helm-descbinds helm-ag)) 36 | (require 'helm-eshell) 37 | 38 | (global-set-key (kbd "M-x") 'helm-M-x) 39 | (global-set-key (kbd "C-x C-m") 'helm-M-x) 40 | (global-set-key (kbd "M-y") 'helm-show-kill-ring) 41 | (global-set-key (kbd "C-x b") 'helm-mini) 42 | (global-set-key (kbd "C-x C-b") 'helm-buffers-list) 43 | (global-set-key (kbd "C-x C-f") 'helm-find-files) 44 | (global-set-key (kbd "C-h f") 'helm-apropos) 45 | (global-set-key (kbd "C-h r") 'helm-info-emacs) 46 | (global-set-key (kbd "C-h C-l") 'helm-locate-library) 47 | (define-key prelude-mode-map (kbd "C-c f") 'helm-recentf) 48 | 49 | (define-key minibuffer-local-map (kbd "C-c C-l") 'helm-minibuffer-history) 50 | 51 | (define-key isearch-mode-map (kbd "C-o") 'helm-occur-from-isearch) 52 | 53 | ;; shell history. 54 | (define-key shell-mode-map (kbd "C-c C-l") 'helm-comint-input-ring) 55 | 56 | ;; use helm to list eshell history 57 | (add-hook 'eshell-mode-hook 58 | #'(lambda () 59 | (substitute-key-definition 'eshell-list-history 'helm-eshell-history eshell-mode-map))) 60 | 61 | (substitute-key-definition 'find-tag 'helm-etags-select global-map) 62 | 63 | (helm-descbinds-mode) 64 | (helm-mode 1) 65 | 66 | (when prelude-projectile 67 | ;; enable Helm version of Projectile with replacment commands 68 | (helm-projectile-on)) 69 | 70 | (provide 'prelude-helm-everywhere) 71 | ;; prelude-helm-everywhere.el ends here. 72 | -------------------------------------------------------------------------------- /modules/prelude-helm.el: -------------------------------------------------------------------------------- 1 | ;;; prelude-helm.el --- Helm setup 2 | ;; 3 | ;; Copyright © 2011-2025 Bozhidar Batsov 4 | ;; 5 | ;; Author: Bozhidar Batsov 6 | ;; URL: https://github.com/bbatsov/prelude 7 | 8 | ;; This file is not part of GNU Emacs. 9 | 10 | ;;; Commentary: 11 | 12 | ;; Some configuration for Helm following this guide: 13 | ;; http://tuhdo.github.io/helm-intro.html 14 | 15 | ;;; License: 16 | 17 | ;; This program is free software; you can redistribute it and/or 18 | ;; modify it under the terms of the GNU General Public License 19 | ;; as published by the Free Software Foundation; either version 3 20 | ;; of the License, or (at your option) any later version. 21 | ;; 22 | ;; This program is distributed in the hope that it will be useful, 23 | ;; but WITHOUT ANY WARRANTY; without even the implied warranty of 24 | ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 25 | ;; GNU General Public License for more details. 26 | ;; 27 | ;; You should have received a copy of the GNU General Public License 28 | ;; along with GNU Emacs; see the file COPYING. If not, write to the 29 | ;; Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, 30 | ;; Boston, MA 02110-1301, USA. 31 | 32 | ;;; Code: 33 | 34 | (prelude-require-package 'helm) 35 | 36 | (when prelude-projectile 37 | (prelude-require-package 'helm-projectile) 38 | (require 'helm-projectile)) 39 | 40 | (when (executable-find "curl") 41 | (setq helm-google-suggest-use-curl-p t)) 42 | 43 | ;; See https://github.com/bbatsov/prelude/pull/670 for a detailed 44 | ;; discussion of these options. 45 | (setq helm-split-window-in-side-p t 46 | helm-buffers-fuzzy-matching t 47 | helm-move-to-line-cycle-in-source t 48 | helm-ff-search-library-in-sexp t 49 | helm-ff-file-name-history-use-recentf t) 50 | 51 | ;; The default "C-x c" is quite close to "C-x C-c", which quits Emacs. 52 | ;; Changed to "C-c h". Note: We must set "C-c h" globally, because we 53 | ;; cannot change `helm-command-prefix-key' once `helm-config' is loaded. 54 | (global-set-key (kbd "C-c h") 'helm-command-prefix) 55 | (global-unset-key (kbd "C-x c")) 56 | 57 | (define-key helm-command-map (kbd "o") 'helm-occur) 58 | (define-key helm-command-map (kbd "g") 'helm-do-grep) 59 | (define-key helm-command-map (kbd "C-c w") 'helm-wikipedia-suggest) 60 | (define-key helm-command-map (kbd "SPC") 'helm-all-mark-rings) 61 | 62 | (push "Press to navigate a project in Helm." prelude-tips) 63 | 64 | (provide 'prelude-helm) 65 | 66 | ;;; prelude-helm.el ends here 67 | -------------------------------------------------------------------------------- /modules/prelude-ido.el: -------------------------------------------------------------------------------- 1 | ;;; prelude-ido.el --- Ido setup 2 | ;; 3 | ;; Copyright © 2011-2025 Bozhidar Batsov 4 | ;; 5 | ;; Author: Bozhidar Batsov 6 | ;; URL: https://github.com/bbatsov/prelude 7 | 8 | ;; This file is not part of GNU Emacs. 9 | 10 | ;;; Commentary: 11 | 12 | ;; Ido-related config. 13 | 14 | ;;; License: 15 | 16 | ;; This program is free software; you can redistribute it and/or 17 | ;; modify it under the terms of the GNU General Public License 18 | ;; as published by the Free Software Foundation; either version 3 19 | ;; of the License, or (at your option) any later version. 20 | ;; 21 | ;; This program is distributed in the hope that it will be useful, 22 | ;; but WITHOUT ANY WARRANTY; without even the implied warranty of 23 | ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 24 | ;; GNU General Public License for more details. 25 | ;; 26 | ;; You should have received a copy of the GNU General Public License 27 | ;; along with GNU Emacs; see the file COPYING. If not, write to the 28 | ;; Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, 29 | ;; Boston, MA 02110-1301, USA. 30 | 31 | ;;; Code: 32 | (prelude-require-packages '(flx-ido ido-completing-read+ smex)) 33 | 34 | (require 'ido) 35 | (require 'ido-completing-read+) 36 | (require 'flx-ido) 37 | 38 | (setq ido-enable-prefix nil 39 | ido-enable-flex-matching t 40 | ido-create-new-buffer 'always 41 | ido-use-filename-at-point 'guess 42 | ido-max-prospects 10 43 | ido-save-directory-list-file (expand-file-name "ido.hist" prelude-savefile-dir) 44 | ido-default-file-method 'selected-window 45 | ido-auto-merge-work-directories-length -1) 46 | (ido-mode +1) 47 | (ido-ubiquitous-mode +1) 48 | 49 | ;;; smarter fuzzy matching for ido 50 | (flx-ido-mode +1) 51 | ;; disable ido faces to see flx highlights 52 | (setq ido-use-faces nil) 53 | 54 | ;;; smex, remember recently and most frequently used commands 55 | (require 'smex) 56 | (setq smex-save-file (expand-file-name ".smex-items" prelude-savefile-dir)) 57 | (smex-initialize) 58 | (global-set-key (kbd "M-x") 'smex) 59 | (global-set-key (kbd "M-X") 'smex-major-mode-commands) 60 | 61 | (provide 'prelude-ido) 62 | ;;; prelude-ido.el ends here 63 | -------------------------------------------------------------------------------- /modules/prelude-ivy.el: -------------------------------------------------------------------------------- 1 | ;;; prelude-ivy.el --- Ivy setup 2 | ;; 3 | ;; Copyright © 2011-2025 Bozhidar Batsov 4 | ;; 5 | ;; Author: Bozhidar Batsov 6 | ;; URL: https://github.com/bbatsov/prelude 7 | 8 | ;; This file is not part of GNU Emacs. 9 | 10 | ;;; Commentary: 11 | 12 | ;; Ivy-related config. Ivy is a smart framework for minibuffer 13 | ;; completion/filtering/selection (think of ido). Swiper and counsel 14 | ;; are two packages built on top of ivy that provide ivy-powered 15 | ;; versions of popular Emacs commands. 16 | 17 | ;;; License: 18 | 19 | ;; This program is free software; you can redistribute it and/or 20 | ;; modify it under the terms of the GNU General Public License 21 | ;; as published by the Free Software Foundation; either version 3 22 | ;; of the License, or (at your option) any later version. 23 | ;; 24 | ;; This program is distributed in the hope that it will be useful, 25 | ;; but WITHOUT ANY WARRANTY; without even the implied warranty of 26 | ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 27 | ;; GNU General Public License for more details. 28 | ;; 29 | ;; You should have received a copy of the GNU General Public License 30 | ;; along with GNU Emacs; see the file COPYING. If not, write to the 31 | ;; Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, 32 | ;; Boston, MA 02110-1301, USA. 33 | 34 | ;;; Code: 35 | (prelude-require-packages '(ivy swiper counsel)) 36 | 37 | ;;; Ivy 38 | ;; 39 | ;; ivy is a powerful alternative to the popular ido-mode 40 | 41 | (require 'ivy) 42 | (require 'diminish) 43 | 44 | (ivy-mode 1) 45 | (setq ivy-use-virtual-buffers t) 46 | (setq enable-recursive-minibuffers t) 47 | (global-set-key (kbd "C-c C-r") 'ivy-resume) 48 | (global-set-key (kbd "") 'ivy-resume) 49 | 50 | (diminish 'ivy-mode) 51 | 52 | ;;; Swiper 53 | ;; 54 | ;; swiper provides enhanced buffer search 55 | 56 | (global-set-key "\C-s" 'swiper) 57 | 58 | ;;; Counsel 59 | ;; 60 | ;; counsel supercharges a lot of commands with some ivy magic 61 | 62 | (global-set-key (kbd "M-x") 'counsel-M-x) 63 | (global-set-key (kbd "C-x C-f") 'counsel-find-file) 64 | (global-set-key (kbd " f") 'counsel-describe-function) 65 | (global-set-key (kbd " v") 'counsel-describe-variable) 66 | (global-set-key (kbd " l") 'counsel-find-library) 67 | (global-set-key (kbd " i") 'counsel-info-lookup-symbol) 68 | (global-set-key (kbd " u") 'counsel-unicode-char) 69 | (global-set-key (kbd "C-c g") 'counsel-git) ; will override the keybinding for `magit-file-dispatch' 70 | (global-set-key (kbd "C-c j") 'counsel-git-grep) 71 | (global-set-key (kbd "C-c a") 'counsel-ag) 72 | (global-set-key (kbd "C-x l") 'counsel-locate) 73 | (global-set-key (kbd "M-y") 'counsel-yank-pop) 74 | (define-key minibuffer-local-map (kbd "C-r") 'counsel-minibuffer-history) 75 | 76 | (provide 'prelude-ivy) 77 | ;;; prelude-ivy.el ends here 78 | -------------------------------------------------------------------------------- /modules/prelude-js.el: -------------------------------------------------------------------------------- 1 | ;;; prelude-js.el --- Emacs Prelude: js-mode configuration. 2 | ;; 3 | ;; Copyright © 2011-2025 Bozhidar Batsov 4 | ;; 5 | ;; Author: Bozhidar Batsov 6 | ;; URL: https://github.com/bbatsov/prelude 7 | 8 | ;; This file is not part of GNU Emacs. 9 | 10 | ;;; Commentary: 11 | 12 | ;; Some basic configuration for js-mode. 13 | 14 | ;;; License: 15 | 16 | ;; This program is free software; you can redistribute it and/or 17 | ;; modify it under the terms of the GNU General Public License 18 | ;; as published by the Free Software Foundation; either version 3 19 | ;; of the License, or (at your option) any later version. 20 | ;; 21 | ;; This program is distributed in the hope that it will be useful, 22 | ;; but WITHOUT ANY WARRANTY; without even the implied warranty of 23 | ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 24 | ;; GNU General Public License for more details. 25 | ;; 26 | ;; You should have received a copy of the GNU General Public License 27 | ;; along with GNU Emacs; see the file COPYING. If not, write to the 28 | ;; Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, 29 | ;; Boston, MA 02110-1301, USA. 30 | 31 | ;;; Code: 32 | 33 | (require 'prelude-programming) 34 | (prelude-require-packages '(js2-mode json-mode)) 35 | 36 | (require 'js2-mode) 37 | 38 | (add-to-list 'auto-mode-alist '("\\.js\\'" . js2-mode)) 39 | (add-to-list 'auto-mode-alist '("\\.[cm]js\\'" . js2-mode)) 40 | (add-to-list 'auto-mode-alist '("\\.pac\\'" . js2-mode)) 41 | (add-to-list 'interpreter-mode-alist '("node" . js2-mode)) 42 | 43 | (with-eval-after-load 'js2-mode 44 | (defun prelude-js-mode-defaults () 45 | ;; electric-layout-mode doesn't play nice with smartparens 46 | (setq-local electric-layout-rules '((?\; . after))) 47 | (setq mode-name "JS2") 48 | (js2-imenu-extras-mode +1) 49 | (subword-mode +1)) 50 | 51 | (setq prelude-js-mode-hook 'prelude-js-mode-defaults) 52 | 53 | (add-hook 'js2-mode-hook (lambda () (run-hooks 'prelude-js-mode-hook)))) 54 | 55 | (provide 'prelude-js) 56 | 57 | ;;; prelude-js.el ends here 58 | -------------------------------------------------------------------------------- /modules/prelude-key-chord.el: -------------------------------------------------------------------------------- 1 | ;;; prelude-key-chord.el --- Key chord setup 2 | ;; 3 | ;; Copyright © 2011-2025 Bozhidar Batsov 4 | ;; 5 | ;; Author: Bozhidar Batsov 6 | ;; URL: https://github.com/bbatsov/prelude 7 | ;; Keywords: convenience 8 | 9 | ;; This file is not part of GNU Emacs. 10 | 11 | ;;; Commentary: 12 | 13 | ;; Configure key-chord key bindings. 14 | 15 | ;;; License: 16 | 17 | ;; This program is free software; you can redistribute it and/or 18 | ;; modify it under the terms of the GNU General Public License 19 | ;; as published by the Free Software Foundation; either version 3 20 | ;; of the License, or (at your option) any later version. 21 | ;; 22 | ;; This program is distributed in the hope that it will be useful, 23 | ;; but WITHOUT ANY WARRANTY; without even the implied warranty of 24 | ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 25 | ;; GNU General Public License for more details. 26 | ;; 27 | ;; You should have received a copy of the GNU General Public License 28 | ;; along with GNU Emacs; see the file COPYING. If not, write to the 29 | ;; Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, 30 | ;; Boston, MA 02110-1301, USA. 31 | 32 | ;;; Code: 33 | (prelude-require-package 'key-chord) 34 | 35 | (require 'key-chord) 36 | 37 | (key-chord-define-global "jj" 'avy-goto-word-1) 38 | (key-chord-define-global "jl" 'avy-goto-line) 39 | (key-chord-define-global "jk" 'avy-goto-char) 40 | (key-chord-define-global "JJ" 'crux-switch-to-previous-buffer) 41 | (key-chord-define-global "uu" 'undo-tree-visualize) 42 | (key-chord-define-global "xx" 'execute-extended-command) 43 | (key-chord-define-global "yy" 'browse-kill-ring) 44 | 45 | (defvar key-chord-tips '("Press quickly to jump to the beginning of a visible word." 46 | "Press quickly to jump to a visible line." 47 | "Press quickly to jump to a visible character." 48 | "Press quickly to switch to previous buffer." 49 | "Press quickly to visualize the undo tree." 50 | "Press quickly to execute extended command." 51 | "Press quickly to browse the kill ring.")) 52 | 53 | (setq prelude-tips (append prelude-tips key-chord-tips)) 54 | 55 | (key-chord-mode +1) 56 | 57 | (provide 'prelude-key-chord) 58 | 59 | ;;; prelude-key-chord.el ends here 60 | -------------------------------------------------------------------------------- /modules/prelude-latex.el: -------------------------------------------------------------------------------- 1 | ;;; prelude-latex.el --- Emacs Prelude: Sane setup for LaTeX writers. 2 | ;; 3 | ;; Copyright © 2011-2025 Bozhidar Batsov 4 | ;; 5 | ;; Author: Bozhidar Batsov 6 | ;; URL: https://github.com/bbatsov/prelude 7 | 8 | ;; This file is not part of GNU Emacs. 9 | 10 | ;;; Commentary: 11 | 12 | ;; Nice defaults for the premium LaTeX editing mode auctex. 13 | 14 | ;;; License: 15 | 16 | ;; This program is free software; you can redistribute it and/or 17 | ;; modify it under the terms of the GNU General Public License 18 | ;; as published by the Free Software Foundation; either version 3 19 | ;; of the License, or (at your option) any later version. 20 | ;; 21 | ;; This program is distributed in the hope that it will be useful, 22 | ;; but WITHOUT ANY WARRANTY; without even the implied warranty of 23 | ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 24 | ;; GNU General Public License for more details. 25 | ;; 26 | ;; You should have received a copy of the GNU General Public License 27 | ;; along with GNU Emacs; see the file COPYING. If not, write to the 28 | ;; Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, 29 | ;; Boston, MA 02110-1301, USA. 30 | 31 | ;;; Code: 32 | 33 | (prelude-require-packages '(auctex cdlatex)) 34 | (require 'smartparens-latex) 35 | ;; for case 36 | (require 'cl-lib) 37 | 38 | (with-eval-after-load "company" 39 | (prelude-require-packages '(company-auctex)) 40 | (company-auctex-init)) 41 | 42 | (defcustom prelude-latex-fast-math-entry 'LaTeX-math-mode 43 | "Method used for fast math symbol entry in LaTeX." 44 | :link '(function-link :tag "AUCTeX Math Mode" LaTeX-math-mode) 45 | :link '(emacs-commentary-link :tag "CDLaTeX" "cdlatex.el") 46 | :group 'prelude 47 | :type '(choice (const :tag "None" nil) 48 | (const :tag "AUCTeX Math Mode" LaTeX-math-mode) 49 | (const :tag "CDLaTeX" cdlatex))) 50 | 51 | ;; AUCTeX configuration 52 | (setq TeX-auto-save t) 53 | (setq TeX-parse-self t) 54 | (setq TeX-close-quote "") 55 | (setq TeX-open-quote "") 56 | 57 | (setq-default TeX-master nil) 58 | 59 | ;; use pdflatex 60 | (setq TeX-PDF-mode t) 61 | 62 | ;; sensible defaults for macOS, other OSes should be covered out-of-the-box 63 | (when (eq system-type 'darwin) 64 | (setq TeX-view-program-selection 65 | '((output-dvi "DVI Viewer") 66 | (output-pdf "PDF Viewer") 67 | (output-html "HTML Viewer"))) 68 | 69 | (setq TeX-view-program-list 70 | '(("DVI Viewer" "open %o") 71 | ("PDF Viewer" "open %o") 72 | ("HTML Viewer" "open %o")))) 73 | 74 | (defun prelude-latex-mode-defaults () 75 | "Default Prelude hook for `LaTeX-mode'." 76 | (turn-on-auto-fill) 77 | (abbrev-mode +1) 78 | (smartparens-mode +1) 79 | (cl-case prelude-latex-fast-math-entry 80 | (LaTeX-math-mode (LaTeX-math-mode 1)) 81 | (cdlatex (turn-on-cdlatex)))) 82 | 83 | (setq prelude-latex-mode-hook 'prelude-latex-mode-defaults) 84 | 85 | (add-hook 'LaTeX-mode-hook (lambda () 86 | (run-hooks 'prelude-latex-mode-hook))) 87 | 88 | (provide 'prelude-latex) 89 | 90 | ;;; prelude-latex.el ends here 91 | -------------------------------------------------------------------------------- /modules/prelude-lisp.el: -------------------------------------------------------------------------------- 1 | ;;; prelude-lisp.el --- Emacs Prelude: Configuration common to all lisp modes. 2 | ;; 3 | ;; Copyright © 2011-2025 Bozhidar Batsov 4 | ;; 5 | ;; Author: Bozhidar Batsov 6 | ;; URL: https://github.com/bbatsov/prelude 7 | 8 | ;; This file is not part of GNU Emacs. 9 | 10 | ;;; Commentary: 11 | 12 | ;; Configuration shared between all modes related to lisp-like languages. 13 | 14 | ;;; License: 15 | 16 | ;; This program is free software; you can redistribute it and/or 17 | ;; modify it under the terms of the GNU General Public License 18 | ;; as published by the Free Software Foundation; either version 3 19 | ;; of the License, or (at your option) any later version. 20 | ;; 21 | ;; This program is distributed in the hope that it will be useful, 22 | ;; but WITHOUT ANY WARRANTY; without even the implied warranty of 23 | ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 24 | ;; GNU General Public License for more details. 25 | ;; 26 | ;; You should have received a copy of the GNU General Public License 27 | ;; along with GNU Emacs; see the file COPYING. If not, write to the 28 | ;; Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, 29 | ;; Boston, MA 02110-1301, USA. 30 | 31 | ;;; Code: 32 | 33 | (require 'prelude-programming) 34 | (prelude-require-packages '(rainbow-delimiters)) 35 | 36 | ;; Lisp configuration 37 | (define-key read-expression-map (kbd "TAB") 'completion-at-point) 38 | 39 | ;; wrap keybindings 40 | (define-key lisp-mode-shared-map (kbd "M-(") (prelude-wrap-with "(")) 41 | ;; FIXME: Pick terminal-friendly binding. 42 | ;;(define-key lisp-mode-shared-map (kbd "M-[") (prelude-wrap-with "[")) 43 | (define-key lisp-mode-shared-map (kbd "M-\"") (prelude-wrap-with "\"")) 44 | 45 | ;; a great lisp coding hook 46 | (defun prelude-lisp-coding-defaults () 47 | (smartparens-strict-mode +1) 48 | (rainbow-delimiters-mode +1)) 49 | 50 | (setq prelude-lisp-coding-hook 'prelude-lisp-coding-defaults) 51 | 52 | ;; interactive modes don't need whitespace checks 53 | (defun prelude-interactive-lisp-coding-defaults () 54 | (smartparens-strict-mode +1) 55 | (rainbow-delimiters-mode +1) 56 | (whitespace-mode -1)) 57 | 58 | (setq prelude-interactive-lisp-coding-hook 'prelude-interactive-lisp-coding-defaults) 59 | 60 | (provide 'prelude-lisp) 61 | 62 | ;;; prelude-lisp.el ends here 63 | -------------------------------------------------------------------------------- /modules/prelude-literate-programming.el: -------------------------------------------------------------------------------- 1 | ;;; prelude-literate-programming.el --- Emacs Prelude: Literate Programming Support 2 | ;; 3 | ;; Author: Koustubh Sinkar 4 | ;; Version: 1.0.0 5 | ;; Keywords: literate programming 6 | 7 | ;; This file is not part of GNU Emacs. 8 | 9 | ;;; Commentary: 10 | 11 | ;; Prelude configuration for literate programming 12 | 13 | ;;; License: 14 | 15 | ;; This program is free software; you can redistribute it and/or 16 | ;; modify it under the terms of the GNU General Public License 17 | ;; as published by the Free Software Foundation; either version 3 18 | ;; of the License, or (at your option) any later version. 19 | ;; 20 | ;; This program is distributed in the hope that it will be useful, 21 | ;; but WITHOUT ANY WARRANTY; without even the implied warranty of 22 | ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 23 | ;; GNU General Public License for more details. 24 | ;; 25 | ;; You should have received a copy of the GNU General Public License 26 | ;; along with GNU Emacs; see the file COPYING. If not, write to the 27 | ;; Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, 28 | ;; Boston, MA 02110-1301, USA. 29 | 30 | ;;; Code: 31 | 32 | (defvar prelude-ipynb-packages 33 | '(code-cells ; file mode for code-cells 34 | ein ; Emacs Ipython Notebook (Jupyter Client) 35 | elpy ; emacs python development environment 36 | )) 37 | 38 | (defvar prelude-ob-packages 39 | '(ob-async ; asynchronous execution of code-blocks 40 | ob-ipython ; for python and ipython 41 | ob-tmux ; for shell 42 | ob-deno ; for javascript 43 | ob-typescript 44 | )) 45 | 46 | 47 | (prelude-require-packages 48 | (append prelude-ipynb-packages prelude-ob-packages)) 49 | 50 | (setq prelude-ob-loader-list 51 | '((python . t) 52 | (ipython . t) 53 | (shell . t) 54 | (js . t) 55 | (typescript . t) 56 | ;; Include other languages here... 57 | )) 58 | 59 | ;; Run/highlight code using babel in org-mode 60 | (org-babel-do-load-languages 61 | 'org-babel-load-languages prelude-ob-loader-list) 62 | 63 | ;; Syntax highlight in #+BEGIN_SRC blocks 64 | (setq org-src-fontify-natively t) 65 | 66 | ;; Don't prompt before running code in org 67 | (setq org-confirm-babel-evaluate nil) 68 | 69 | ;; Fix an incompatibility between the ob-async and ob-ipython packages 70 | (setq ob-async-no-async-languages-alist '("ipython")) 71 | 72 | (defvar org-babel-language-list 73 | '(ob-cfengine3 74 | ob-clojurescript 75 | ob-coffee 76 | ob-dao 77 | ob-diagrams 78 | ob-elixir 79 | ob-elm 80 | ob-go 81 | ob-graphql 82 | ob-http 83 | ob-ipython 84 | ob-julia-vterm 85 | ob-kotlin 86 | ob-mongo 87 | ob-prolog 88 | ob-restclient 89 | ob-rust 90 | ob-sml 91 | ob-sql-mode 92 | ob-translate 93 | ob-typescript 94 | ob-uart 95 | )) 96 | ;;; TODO Write a function to enable org-babel for each function 97 | 98 | (provide 'prelude-literate-programming) 99 | ;;; prelude-literate-programming.el ends here 100 | -------------------------------------------------------------------------------- /modules/prelude-lsp.el: -------------------------------------------------------------------------------- 1 | ;;; prelude-lsp.el --- lsp-mode setup 2 | ;; 3 | ;; Copyright © 2011-2025 Bozhidar Batsov 4 | ;; 5 | ;; Author: Bozhidar Batsov, Ben Alex 6 | ;; URL: https://github.com/bbatsov/prelude 7 | 8 | ;; This file is not part of GNU Emacs. 9 | 10 | ;;; Commentary: 11 | 12 | ;; lsp-mode config. 13 | 14 | ;;; License: 15 | 16 | ;; This program is free software; you can redistribute it and/or 17 | ;; modify it under the terms of the GNU General Public License 18 | ;; as published by the Free Software Foundation; either version 3 19 | ;; of the License, or (at your option) any later version. 20 | ;; 21 | ;; This program is distributed in the hope that it will be useful, 22 | ;; but WITHOUT ANY WARRANTY; without even the implied warranty of 23 | ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 24 | ;; GNU General Public License for more details. 25 | ;; 26 | ;; You should have received a copy of the GNU General Public License 27 | ;; along with GNU Emacs; see the file COPYING. If not, write to the 28 | ;; Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, 29 | ;; Boston, MA 02110-1301, USA. 30 | 31 | ;;; Code: 32 | 33 | (prelude-require-packages '(lsp-mode 34 | lsp-ui)) 35 | 36 | (require 'lsp-ui) 37 | (require 'lsp-ui-imenu) 38 | 39 | (define-key lsp-ui-mode-map [remap xref-find-definitions] #'lsp-ui-peek-find-definitions) 40 | (define-key lsp-ui-mode-map [remap xref-find-references] #'lsp-ui-peek-find-references) 41 | (define-key lsp-ui-mode-map (kbd "C-c C-l .") 'lsp-ui-peek-find-definitions) 42 | (define-key lsp-ui-mode-map (kbd "C-c C-l ?") 'lsp-ui-peek-find-references) 43 | (define-key lsp-ui-mode-map (kbd "C-c C-l r") 'lsp-rename) 44 | (define-key lsp-ui-mode-map (kbd "C-c C-l x") 'lsp-workspace-restart) 45 | (define-key lsp-ui-mode-map (kbd "C-c C-l w") 'lsp-ui-peek-find-workspace-symbol) 46 | (define-key lsp-ui-mode-map (kbd "C-c C-l i") 'lsp-ui-peek-find-implementation) 47 | (define-key lsp-ui-mode-map (kbd "C-c C-l d") 'lsp-describe-thing-at-point) 48 | (define-key lsp-ui-mode-map (kbd "C-c C-l e") 'lsp-execute-code-action) 49 | 50 | (setq lsp-ui-sideline-enable t) 51 | (setq lsp-ui-doc-enable t) 52 | (setq lsp-ui-peek-enable t) 53 | (setq lsp-ui-peek-always-show t) 54 | 55 | (provide 'prelude-lsp) 56 | ;;; prelude-lsp.el ends here 57 | -------------------------------------------------------------------------------- /modules/prelude-lua.el: -------------------------------------------------------------------------------- 1 | ;;; prelude-lua.el --- Emacs Prelude: Lua programming configuration. 2 | ;; 3 | ;; Copyright © 2011-2025 Bozhidar Batsov 4 | ;; 5 | ;; Author: Xiongfei Shi 6 | ;; URL: https://github.com/bbatsov/prelude 7 | 8 | ;; This file is not part of GNU Emacs. 9 | 10 | ;;; Commentary: 11 | 12 | ;; Basic configuration for Lua programming. 13 | 14 | ;;; License: 15 | 16 | ;; This program is free software; you can redistribute it and/or 17 | ;; modify it under the terms of the GNU General Public License 18 | ;; as published by the Free Software Foundation; either version 3 19 | ;; of the License, or (at your option) any later version. 20 | ;; 21 | ;; This program is distributed in the hope that it will be useful, 22 | ;; but WITHOUT ANY WARRANTY; without even the implied warranty of 23 | ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 24 | ;; GNU General Public License for more details. 25 | ;; 26 | ;; You should have received a copy of the GNU General Public License 27 | ;; along with GNU Emacs; see the file COPYING. If not, write to the 28 | ;; Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, 29 | ;; Boston, MA 02110-1301, USA. 30 | 31 | ;;; Code: 32 | 33 | 34 | (require 'prelude-programming) 35 | (prelude-require-packages '(lua-mode)) 36 | 37 | (with-eval-after-load 'lua-mode 38 | (setq lua-indent-level 2) 39 | (setq lua-indent-nested-block-content-align nil) 40 | (setq lua-indent-close-paren-align nil) 41 | (setq lua-indent-string-contents t) 42 | 43 | (define-key lua-mode-map (kbd "C-c C-b") 'lua-send-buffer) 44 | (define-key lua-mode-map (kbd "C-c C-l") 'lua-send-current-line) 45 | (define-key lua-mode-map (kbd "C-c C-f") 'lua-send-defun) 46 | (define-key lua-mode-map (kbd "C-c C-r") 'lua-send-region) 47 | (define-key lua-mode-map (kbd "C-c C-z") 'lua-show-process-buffer)) 48 | 49 | (autoload 'lua-mode "lua-mode" "Lua editing mode." t) 50 | (add-to-list 'auto-mode-alist '("\\.lua\\'" . lua-mode)) 51 | (add-to-list 'interpreter-mode-alist '("lua" . lua-mode)) 52 | 53 | (provide 'prelude-lua) 54 | 55 | ;;; prelude-lua ends here 56 | -------------------------------------------------------------------------------- /modules/prelude-ocaml.el: -------------------------------------------------------------------------------- 1 | ;;; prelude-ocaml.el --- Emacs Prelude: decent Perl coding settings. 2 | ;; 3 | ;; Copyright © 2014-2025 Geoff Shannon 4 | ;; 5 | ;; Author: Geoff Shannon 6 | ;; URL: https://github.com/bbatsov/prelude 7 | 8 | ;; This file is not part of GNU Emacs. 9 | 10 | ;;; Commentary: 11 | 12 | ;; tuareg is the preferred ocaml mode for Emacs 13 | 14 | ;; These setups for ocaml assume that you are using the OPAM package 15 | ;; manager (http://opam.ocaml.org/). 16 | 17 | ;; Because of the apparent complexity of getting Emacs environment 18 | ;; variables setup to use opam correctly, it is instead easier to use 19 | ;; opam itself to execute any necessary commands. 20 | 21 | ;; Also, the standard OCaml toplevel usage has been replaced in favor 22 | ;; of UTOP, the universal toplevel, and we assume that you are using 23 | ;; the Jane Street Core libraries rather than the regular OCaml 24 | ;; standard libraries 25 | 26 | ;; The minimum required setup for using Prelude's OCaml setup would be 27 | ;; to install OPAM, and then, minimally `opam install core utop'. A 28 | ;; good getting started guide is available at 29 | ;; https://dev.realworldocaml.org/install.html 30 | 31 | ;;; License: 32 | 33 | ;; This program is free software; you can redistribute it and/or 34 | ;; modify it under the terms of the GNU General Public License 35 | ;; as published by the Free Software Foundation; either version 3 36 | ;; of the License, or (at your option) any later version. 37 | ;; 38 | ;; This program is distributed in the hope that it will be useful, 39 | ;; but WITHOUT ANY WARRANTY; without even the implied warranty of 40 | ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 41 | ;; GNU General Public License for more details. 42 | ;; 43 | ;; You should have received a copy of the GNU General Public License 44 | ;; along with GNU Emacs; see the file COPYING. If not, write to the 45 | ;; Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, 46 | ;; Boston, MA 02110-1301, USA. 47 | 48 | ;;; Code: 49 | 50 | (prelude-require-packages '(tuareg utop merlin flycheck-ocaml)) 51 | 52 | (require 'tuareg) 53 | (require 'utop) 54 | (require 'merlin) 55 | 56 | (setq auto-mode-alist 57 | (append '(("\\.ml[ily]?\\'" . tuareg-mode) 58 | ("\\.topml\\'" . tuareg-mode)) 59 | auto-mode-alist)) 60 | 61 | (with-eval-after-load 'merlin 62 | ;; Disable Merlin's own error checking 63 | (setq merlin-error-after-save nil) 64 | 65 | ;; Enable Flycheck checker 66 | (flycheck-ocaml-setup)) 67 | 68 | (add-hook 'tuareg-mode-hook #'utop-minor-mode) 69 | (add-hook 'tuareg-mode-hook #'merlin-mode) 70 | 71 | (add-hook 'tuareg-mode-hook (lambda () 72 | (progn 73 | (define-key tuareg-mode-map (kbd "C-c C-s") 74 | 'utop) 75 | (setq compile-command 76 | "opam config exec corebuild ")))) 77 | 78 | ;; Setup merlin completions company is used by default in prelude 79 | (add-to-list 'company-backends 'merlin-company-backend) 80 | 81 | ;; Merlin also offers support for autocomplete, uncomment this next line 82 | ;; to activate it. 83 | ;; (setq merlin-use-auto-complete-mode t) 84 | 85 | (setq utop-command "opam config exec utop -- -emacs" 86 | merlin-error-after-save nil) 87 | 88 | (provide 'prelude-ocaml) 89 | 90 | ;;; prelude-ocaml.el ends here 91 | -------------------------------------------------------------------------------- /modules/prelude-org.el: -------------------------------------------------------------------------------- 1 | ;;; prelude-org.el --- Emacs Prelude: org-mode configuration. 2 | ;; 3 | ;; Copyright © 2011-2025 Bozhidar Batsov 4 | ;; 5 | ;; Author: Bozhidar Batsov 6 | ;; URL: https://github.com/bbatsov/prelude 7 | 8 | ;; This file is not part of GNU Emacs. 9 | 10 | ;;; Commentary: 11 | 12 | ;; Some basic configuration for org-mode. 13 | 14 | ;;; License: 15 | 16 | ;; This program is free software; you can redistribute it and/or 17 | ;; modify it under the terms of the GNU General Public License 18 | ;; as published by the Free Software Foundation; either version 3 19 | ;; of the License, or (at your option) any later version. 20 | ;; 21 | ;; This program is distributed in the hope that it will be useful, 22 | ;; but WITHOUT ANY WARRANTY; without even the implied warranty of 23 | ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 24 | ;; GNU General Public License for more details. 25 | ;; 26 | ;; You should have received a copy of the GNU General Public License 27 | ;; along with GNU Emacs; see the file COPYING. If not, write to the 28 | ;; Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, 29 | ;; Boston, MA 02110-1301, USA. 30 | 31 | ;;; Code: 32 | 33 | (require 'org) 34 | (require 'org-habit) 35 | 36 | (add-to-list 'auto-mode-alist '("\\.org\\'" . org-mode)) 37 | 38 | ;; a few useful global keybindings for org-mode 39 | (global-set-key "\C-cl" 'org-store-link) 40 | (global-set-key "\C-ca" 'org-agenda) 41 | (global-set-key "\C-cb" 'org-switchb) 42 | 43 | (setq org-log-done t) 44 | (setq org-log-into-drawer t) 45 | 46 | (defun prelude-org-mode-defaults () 47 | (let ((oldmap (cdr (assoc 'prelude-mode minor-mode-map-alist))) 48 | (newmap (make-sparse-keymap))) 49 | (set-keymap-parent newmap oldmap) 50 | (define-key newmap (kbd "C-c +") nil) 51 | (define-key newmap (kbd "C-c -") nil) 52 | (define-key newmap (kbd "C-a") 'org-beginning-of-line) 53 | (make-local-variable 'minor-mode-overriding-map-alist) 54 | (push `(prelude-mode . ,newmap) minor-mode-overriding-map-alist)) 55 | ) 56 | 57 | (setq prelude-org-mode-hook 'prelude-org-mode-defaults) 58 | 59 | (add-hook 'org-mode-hook (lambda () (run-hooks 'prelude-org-mode-hook))) 60 | 61 | (provide 'prelude-org) 62 | 63 | ;;; prelude-org.el ends here 64 | -------------------------------------------------------------------------------- /modules/prelude-perl.el: -------------------------------------------------------------------------------- 1 | ;;; prelude-perl.el --- Emacs Prelude: decent Perl coding settings. 2 | ;; 3 | ;; Copyright © 2011-2025 Bozhidar Batsov 4 | ;; 5 | ;; Author: Bozhidar Batsov 6 | ;; URL: https://github.com/bbatsov/prelude 7 | 8 | ;; This file is not part of GNU Emacs. 9 | 10 | ;;; Commentary: 11 | 12 | ;; cperl-mode is the best Perl mode for Emacs out there. 13 | 14 | ;;; License: 15 | 16 | ;; This program is free software; you can redistribute it and/or 17 | ;; modify it under the terms of the GNU General Public License 18 | ;; as published by the Free Software Foundation; either version 3 19 | ;; of the License, or (at your option) any later version. 20 | ;; 21 | ;; This program is distributed in the hope that it will be useful, 22 | ;; but WITHOUT ANY WARRANTY; without even the implied warranty of 23 | ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 24 | ;; GNU General Public License for more details. 25 | ;; 26 | ;; You should have received a copy of the GNU General Public License 27 | ;; along with GNU Emacs; see the file COPYING. If not, write to the 28 | ;; Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, 29 | ;; Boston, MA 02110-1301, USA. 30 | 31 | ;;; Code: 32 | 33 | (require 'prelude-programming) 34 | 35 | ;; use cperl-mode instead of perl-mode 36 | (defalias 'perl-mode 'cperl-mode) 37 | 38 | (define-key 'help-command "P" 'cperl-perldoc) 39 | 40 | (defun prelude-cperl-mode-defaults () 41 | (setq cperl-indent-level 4) 42 | (setq cperl-continued-statement-offset 8) 43 | ;; cperl-hairy affects all those variables, but I prefer 44 | ;; a more fine-grained approach as far as they are concerned 45 | (setq cperl-font-lock t) 46 | (setq cperl-electric-lbrace-space t) 47 | (setq cperl-electric-parens nil) 48 | (setq cperl-electric-linefeed nil) 49 | (setq cperl-electric-keywords nil) 50 | (setq cperl-info-on-command-no-prompt t) 51 | (setq cperl-clobber-lisp-bindings t) 52 | (setq cperl-lazy-help-time 3) 53 | 54 | ;; if you want all the bells and whistles 55 | ;; (setq cperl-hairy) 56 | 57 | (set-face-background 'cperl-array-face nil) 58 | (set-face-background 'cperl-hash-face nil) 59 | (setq cperl-invalid-face nil)) 60 | 61 | (setq prelude-cperl-mode-hook 'prelude-cperl-mode-defaults) 62 | 63 | (add-hook 'cperl-mode-hook (lambda () 64 | (run-hooks 'prelude-cperl-mode-hook)) t) 65 | 66 | (provide 'prelude-perl) 67 | 68 | ;;; prelude-perl.el ends here 69 | -------------------------------------------------------------------------------- /modules/prelude-programming.el: -------------------------------------------------------------------------------- 1 | ;;; prelude-programming.el --- Emacs Prelude: prog-mode configuration 2 | ;; 3 | ;; Copyright © 2011-2025 Bozhidar Batsov 4 | ;; 5 | ;; Author: Bozhidar Batsov 6 | ;; URL: https://github.com/bbatsov/prelude 7 | 8 | ;; This file is not part of GNU Emacs. 9 | 10 | ;;; Commentary: 11 | 12 | ;; Some basic prog-mode configuration and programming related utilities. 13 | 14 | ;;; License: 15 | 16 | ;; This program is free software; you can redistribute it and/or 17 | ;; modify it under the terms of the GNU General Public License 18 | ;; as published by the Free Software Foundation; either version 3 19 | ;; of the License, or (at your option) any later version. 20 | ;; 21 | ;; This program is distributed in the hope that it will be useful, 22 | ;; but WITHOUT ANY WARRANTY; without even the implied warranty of 23 | ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 24 | ;; GNU General Public License for more details. 25 | ;; 26 | ;; You should have received a copy of the GNU General Public License 27 | ;; along with GNU Emacs; see the file COPYING. If not, write to the 28 | ;; Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, 29 | ;; Boston, MA 02110-1301, USA. 30 | 31 | ;;; Code: 32 | 33 | (defun prelude-local-comment-auto-fill () 34 | (set (make-local-variable 'comment-auto-fill-only-comments) t)) 35 | 36 | ;; show the name of the current function definition in the modeline 37 | (require 'which-func) 38 | (which-function-mode 1) 39 | 40 | ;; font-lock annotations like TODO in source code 41 | (require 'hl-todo) 42 | (global-hl-todo-mode 1) 43 | 44 | ;; in Emacs 24 programming major modes generally derive from a common 45 | ;; mode named prog-mode; for others, we'll arrange for our mode 46 | ;; defaults function to run prelude-prog-mode-hook directly. To 47 | ;; augment and/or counteract these defaults your own function 48 | ;; to prelude-prog-mode-hook, using: 49 | ;; 50 | ;; (add-hook 'prelude-prog-mode-hook 'my-prog-mode-defaults t) 51 | ;; 52 | ;; (the final optional t sets the *append* argument) 53 | 54 | ;; smart curly braces 55 | (sp-pair "{" nil :post-handlers 56 | '(((lambda (&rest _ignored) 57 | (crux-smart-open-line-above)) "RET"))) 58 | 59 | ;; enlist a more liberal guru 60 | (setq guru-warn-only t) 61 | 62 | (defun prelude-prog-mode-defaults () 63 | "Default coding hook, useful with any programming language." 64 | (when (and (executable-find ispell-program-name) 65 | prelude-flyspell) 66 | (flyspell-prog-mode)) 67 | (when prelude-guru 68 | (guru-mode +1) 69 | (diminish 'guru-mode)) 70 | (smartparens-mode +1) 71 | (prelude-enable-whitespace) 72 | (prelude-local-comment-auto-fill)) 73 | 74 | (setq prelude-prog-mode-hook 'prelude-prog-mode-defaults) 75 | 76 | (add-hook 'prog-mode-hook (lambda () 77 | (run-hooks 'prelude-prog-mode-hook))) 78 | 79 | ;; enable on-the-fly syntax checking 80 | (if (fboundp 'global-flycheck-mode) 81 | (global-flycheck-mode +1) 82 | (add-hook 'prog-mode-hook 'flycheck-mode)) 83 | 84 | (provide 'prelude-programming) 85 | ;;; prelude-programming.el ends here 86 | -------------------------------------------------------------------------------- /modules/prelude-python.el: -------------------------------------------------------------------------------- 1 | ;;; prelude-python.el --- Emacs Prelude: python.el configuration. 2 | ;; 3 | ;; Copyright © 2011-2025 Bozhidar Batsov 4 | ;; 5 | ;; Author: Bozhidar Batsov 6 | ;; URL: https://github.com/bbatsov/prelude 7 | 8 | ;; This file is not part of GNU Emacs. 9 | 10 | ;;; Commentary: 11 | 12 | ;; Enhanced configuration for python.el (the latest and greatest 13 | ;; Python mode Emacs has to offer). Most notably Prelude leverages 14 | ;; anaconda mode to provide code navigation, documentation lookup and 15 | ;; completion for Python. 16 | 17 | ;;; License: 18 | 19 | ;; This program is free software; you can redistribute it and/or 20 | ;; modify it under the terms of the GNU General Public License 21 | ;; as published by the Free Software Foundation; either version 3 22 | ;; of the License, or (at your option) any later version. 23 | ;; 24 | ;; This program is distributed in the hope that it will be useful, 25 | ;; but WITHOUT ANY WARRANTY; without even the implied warranty of 26 | ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 27 | ;; GNU General Public License for more details. 28 | ;; 29 | ;; You should have received a copy of the GNU General Public License 30 | ;; along with GNU Emacs; see the file COPYING. If not, write to the 31 | ;; Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, 32 | ;; Boston, MA 02110-1301, USA. 33 | 34 | ;;; Code: 35 | 36 | (require 'electric) 37 | (require 'prelude-programming) 38 | 39 | ;; Code navigation, documentation lookup and completion for Python 40 | (prelude-require-package 'anaconda-mode) 41 | 42 | (when (boundp 'company-backends) 43 | (prelude-require-package 'company-anaconda) 44 | (add-to-list 'company-backends 'company-anaconda)) 45 | 46 | (defcustom prelude-python-mode-set-encoding-automatically nil 47 | "Non-nil values enable auto insertion of '# coding: utf-8' on python buffers." 48 | :type 'boolean 49 | :group 'prelude) 50 | 51 | ;;; Encoding detection/insertion logic 52 | ;; 53 | ;; Adapted from ruby-mode.el 54 | ;; 55 | ;; This logic was useful in Python 2, but it's not really needed in Python 3. 56 | (defun prelude-python--encoding-comment-required-p () 57 | (re-search-forward "[^\0-\177]" nil t)) 58 | 59 | (defun prelude-python--detect-encoding () 60 | (let ((coding-system 61 | (or save-buffer-coding-system 62 | buffer-file-coding-system))) 63 | (if coding-system 64 | (symbol-name 65 | (or (coding-system-get coding-system 'mime-charset) 66 | (coding-system-change-eol-conversion coding-system nil))) 67 | "ascii-8bit"))) 68 | 69 | (defun prelude-python--insert-coding-comment (encoding) 70 | (let ((newlines (if (looking-at "^\\s *$") "\n" "\n\n"))) 71 | (insert (format "# coding: %s" encoding) newlines))) 72 | 73 | (defun prelude-python-mode-set-encoding () 74 | "Insert a magic comment header with the proper encoding if necessary." 75 | (save-excursion 76 | (widen) 77 | (goto-char (point-min)) 78 | (when (prelude-python--encoding-comment-required-p) 79 | (goto-char (point-min)) 80 | (let ((coding-system (prelude-python--detect-encoding))) 81 | (when coding-system 82 | (if (looking-at "^#!") (beginning-of-line 2)) 83 | (cond ((looking-at "\\s *#\\s *.*\\(en\\)?coding\\s *:\\s *\\([-a-z0-9_]*\\)") 84 | ;; update existing encoding comment if necessary 85 | (unless (string= (match-string 2) coding-system) 86 | (goto-char (match-beginning 2)) 87 | (delete-region (point) (match-end 2)) 88 | (insert coding-system))) 89 | ((looking-at "\\s *#.*coding\\s *[:=]")) 90 | (t (prelude-python--insert-coding-comment coding-system))) 91 | (when (buffer-modified-p) 92 | (basic-save-buffer-1))))))) 93 | 94 | ;;; python-mode setup 95 | 96 | (when (fboundp 'exec-path-from-shell-copy-env) 97 | (exec-path-from-shell-copy-env "PYTHONPATH")) 98 | 99 | (defun prelude-python-mode-defaults () 100 | "Defaults for Python programming." 101 | (subword-mode +1) 102 | (anaconda-mode +1) 103 | (eldoc-mode +1) 104 | (setq-local electric-layout-rules 105 | '((?: . (lambda () 106 | (and (zerop (first (syntax-ppss))) 107 | (python-info-statement-starts-block-p) 108 | 'after))))) 109 | (when (fboundp #'python-imenu-create-flat-index) 110 | (setq-local imenu-create-index-function 111 | #'python-imenu-create-flat-index)) 112 | (add-hook 'post-self-insert-hook 113 | #'electric-layout-post-self-insert-function nil 'local) 114 | (when prelude-python-mode-set-encoding-automatically 115 | (add-hook 'after-save-hook 'prelude-python-mode-set-encoding nil 'local))) 116 | 117 | (setq prelude-python-mode-hook 'prelude-python-mode-defaults) 118 | 119 | (add-hook 'python-mode-hook (lambda () 120 | (run-hooks 'prelude-python-mode-hook))) 121 | 122 | (provide 'prelude-python) 123 | 124 | ;;; prelude-python.el ends here 125 | -------------------------------------------------------------------------------- /modules/prelude-racket.el: -------------------------------------------------------------------------------- 1 | ;;; prelude-racket.el --- Emacs Prelude: Racket programming support. 2 | ;; 3 | ;; Copyright © 2011-2025 Bozhidar Batsov 4 | ;; 5 | ;; Author: Xiongfei Shi 6 | ;; URL: https://github.com/bbatsov/prelude 7 | 8 | ;; This file is not part of GNU Emacs. 9 | 10 | ;;; Commentary: 11 | 12 | ;; Basic configuration for Racket programming. 13 | 14 | ;;; License: 15 | 16 | ;; This program is free software; you can redistribute it and/or 17 | ;; modify it under the terms of the GNU General Public License 18 | ;; as published by the Free Software Foundation; either version 3 19 | ;; of the License, or (at your option) any later version. 20 | ;; 21 | ;; This program is distributed in the hope that it will be useful, 22 | ;; but WITHOUT ANY WARRANTY; without even the implied warranty of 23 | ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 24 | ;; GNU General Public License for more details. 25 | ;; 26 | ;; You should have received a copy of the GNU General Public License 27 | ;; along with GNU Emacs; see the file COPYING. If not, write to the 28 | ;; Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, 29 | ;; Boston, MA 02110-1301, USA. 30 | 31 | ;;; Code: 32 | 33 | (prelude-require-packages '(racket-mode)) 34 | 35 | (require 'prelude-lisp) 36 | 37 | (with-eval-after-load 'racket-mode 38 | (define-key racket-mode-map (kbd "M-RET") 'racket-run) 39 | (define-key racket-mode-map (kbd "M-.") 'racket-repl-visit-definition) 40 | 41 | ;; Enable the common Lisp coding hook 42 | (add-hook 'racket-mode-hook (lambda () (run-hooks 'prelude-lisp-coding-hook))) 43 | 44 | (add-hook 'racket-mode-hook #'racket-unicode-input-method-enable) 45 | (add-hook 'racket-repl-mode-hook #'racket-unicode-input-method-enable)) 46 | 47 | (add-to-list 'auto-mode-alist '("\\.rkt?\\'" . racket-mode)) 48 | (add-to-list 'auto-mode-alist '("\\.rkt\\'" . racket-mode)) 49 | 50 | (provide 'prelude-racket) 51 | 52 | ;;; prelude-racket.el ends here 53 | -------------------------------------------------------------------------------- /modules/prelude-ruby.el: -------------------------------------------------------------------------------- 1 | ;;; prelude-ruby.el --- Emacs Prelude: A nice setup for Ruby (and Rails) devs. 2 | ;; 3 | ;; Copyright © 2011-2025 Bozhidar Batsov 4 | ;; 5 | ;; Author: Bozhidar Batsov 6 | ;; URL: https://github.com/bbatsov/prelude 7 | 8 | ;; This file is not part of GNU Emacs. 9 | 10 | ;;; Commentary: 11 | 12 | ;; Some basic configuration for Ruby and Rails development. 13 | 14 | ;;; License: 15 | 16 | ;; This program is free software; you can redistribute it and/or 17 | ;; modify it under the terms of the GNU General Public License 18 | ;; as published by the Free Software Foundation; either version 3 19 | ;; of the License, or (at your option) any later version. 20 | ;; 21 | ;; This program is distributed in the hope that it will be useful, 22 | ;; but WITHOUT ANY WARRANTY; without even the implied warranty of 23 | ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 24 | ;; GNU General Public License for more details. 25 | ;; 26 | ;; You should have received a copy of the GNU General Public License 27 | ;; along with GNU Emacs; see the file COPYING. If not, write to the 28 | ;; Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, 29 | ;; Boston, MA 02110-1301, USA. 30 | 31 | ;;; Code: 32 | 33 | (require 'prelude-programming) 34 | 35 | (prelude-require-packages '(inf-ruby yari)) 36 | 37 | ;; We never want to edit Rubinius bytecode 38 | (add-to-list 'completion-ignored-extensions ".rbc") 39 | 40 | ;; Map yari to C-h R 41 | (define-key 'help-command (kbd "R") 'yari) 42 | 43 | (with-eval-after-load 'ruby-mode 44 | (defun prelude-ruby-mode-defaults () 45 | ;; Don't auto-insert encoding comments 46 | ;; Those are almost never needed in Ruby 2+ 47 | (setq ruby-insert-encoding-magic-comment nil) 48 | (inf-ruby-minor-mode +1) 49 | ;; CamelCase aware editing operations 50 | (subword-mode +1)) 51 | 52 | (setq prelude-ruby-mode-hook 'prelude-ruby-mode-defaults) 53 | 54 | (add-hook 'ruby-mode-hook (lambda () 55 | (run-hooks 'prelude-ruby-mode-hook)))) 56 | 57 | (provide 'prelude-ruby) 58 | ;;; prelude-ruby.el ends here 59 | -------------------------------------------------------------------------------- /modules/prelude-rust.el: -------------------------------------------------------------------------------- 1 | ;;; prelude-rust.el --- Emacs Prelude: Rust programming support. 2 | ;; 3 | ;; Authors: Doug MacEachern, Manoel Vilela, Ben Alex, Daniel Gerlach 4 | 5 | ;; This file is not part of GNU Emacs. 6 | 7 | ;;; Commentary: 8 | 9 | ;; Prelude configuration for Rust 10 | 11 | ;;; License: 12 | 13 | ;; This program is free software; you can redistribute it and/or 14 | ;; modify it under the terms of the GNU General Public License 15 | ;; as published by the Free Software Foundation; either version 3 16 | ;; of the License, or (at your option) any later version. 17 | ;; 18 | ;; This program is distributed in the hope that it will be useful, 19 | ;; but WITHOUT ANY WARRANTY; without even the implied warranty of 20 | ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 21 | ;; GNU General Public License for more details. 22 | ;; 23 | ;; You should have received a copy of the GNU General Public License 24 | ;; along with GNU Emacs; see the file COPYING. If not, write to the 25 | ;; Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, 26 | ;; Boston, MA 02110-1301, USA. 27 | 28 | ;;; Code: 29 | 30 | (require 'prelude-programming) 31 | 32 | ;; You may need to install the following packages on your system: 33 | ;; * rustc (Rust Compiler) 34 | ;; * cargo (Rust Package Manager) 35 | ;; * rustfmt (Rust Tool for formatting code) 36 | ;; * rust-analyzer as lsp server needs to be in global path, see: 37 | ;; https://rust-analyzer.github.io/manual.html#rust-analyzer-language-server-binary 38 | 39 | 40 | (prelude-require-packages '(rust-mode 41 | cargo 42 | flycheck-rust 43 | tree-sitter 44 | tree-sitter-langs 45 | yasnippet 46 | ron-mode)) 47 | 48 | (require 'tree-sitter) 49 | (require 'tree-sitter-langs) 50 | 51 | (add-to-list 'super-save-predicates 52 | (lambda () (not (eq major-mode 'rust-mode)))) 53 | 54 | (with-eval-after-load 'rust-mode 55 | (add-hook 'rust-mode-hook 'cargo-minor-mode) 56 | (add-hook 'flycheck-mode-hook 'flycheck-rust-setup) 57 | 58 | ;; enable lsp for rust, by default it uses rust-analyzer as lsp server 59 | (add-hook 'rust-mode-hook 'lsp) 60 | 61 | ;; enable tree-sitter for nicer syntax highlighting 62 | (add-hook 'rust-mode-hook #'tree-sitter-mode) 63 | (add-hook 'rust-mode-hook #'tree-sitter-hl-mode) 64 | 65 | (defun prelude-rust-mode-defaults () 66 | ;; format on save 67 | (setq rust-format-on-save t) 68 | 69 | ;; lsp settings 70 | (setq 71 | ;; enable macro expansion 72 | lsp-rust-analyzer-proc-macro-enable t 73 | lsp-rust-analyzer-experimental-proc-attr-macros t) 74 | 75 | ;; Prevent #! from chmodding rust files to be executable 76 | (remove-hook 'after-save-hook 'executable-make-buffer-file-executable-if-script-p) 77 | 78 | ;; snippets are required for correct lsp autocompletions 79 | (yas-minor-mode) 80 | 81 | ;; CamelCase aware editing operations 82 | (subword-mode +1)) 83 | 84 | (setq prelude-rust-mode-hook 'prelude-rust-mode-defaults) 85 | 86 | (add-hook 'rust-mode-hook (lambda () 87 | (run-hooks 'prelude-rust-mode-hook)))) 88 | 89 | (provide 'prelude-rust) 90 | ;;; prelude-rust.el ends here 91 | -------------------------------------------------------------------------------- /modules/prelude-scala.el: -------------------------------------------------------------------------------- 1 | ;;; prelude-scala.el --- Emacs Prelude: scala-mode configuration. 2 | ;; 3 | ;; Copyright © 2011-2025 Bozhidar Batsov 4 | ;; 5 | ;; Author: Bozhidar Batsov 6 | ;; URL: https://github.com/bbatsov/prelude 7 | 8 | ;; This file is not part of GNU Emacs. 9 | 10 | ;;; Commentary: 11 | 12 | ;; Some basic support for the Scala programming language 13 | 14 | ;;; License: 15 | 16 | ;; This program is free software; you can redistribute it and/or 17 | ;; modify it under the terms of the GNU General Public License 18 | ;; as published by the Free Software Foundation; either version 3 19 | ;; of the License, or (at your option) any later version. 20 | ;; 21 | ;; This program is distributed in the hope that it will be useful, 22 | ;; but WITHOUT ANY WARRANTY; without even the implied warranty of 23 | ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 24 | ;; GNU General Public License for more details. 25 | ;; 26 | ;; You should have received a copy of the GNU General Public License 27 | ;; along with GNU Emacs; see the file COPYING. If not, write to the 28 | ;; Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, 29 | ;; Boston, MA 02110-1301, USA. 30 | 31 | ;;; Code: 32 | 33 | (require 'prelude-programming) 34 | (prelude-require-packages '(scala-mode lsp-mode)) 35 | 36 | (defun prelude-scala-mode-defaults () 37 | (subword-mode +1) 38 | (lsp)) 39 | 40 | (setq prelude-scala-mode-hook 'prelude-scala-mode-defaults) 41 | 42 | (add-hook 'scala-mode-hook (lambda () 43 | (run-hooks 'prelude-scala-mode-hook))) 44 | (provide 'prelude-scala) 45 | 46 | ;;; prelude-scala.el ends here 47 | -------------------------------------------------------------------------------- /modules/prelude-scheme.el: -------------------------------------------------------------------------------- 1 | ;;; prelude-scheme.el --- Emacs Prelude: Some defaults for Scheme. 2 | ;; 3 | ;; Copyright © 2011-2025 Bozhidar Batsov 4 | ;; 5 | ;; Author: Bozhidar Batsov 6 | ;; URL: https://github.com/bbatsov/prelude 7 | 8 | ;; This file is not part of GNU Emacs. 9 | 10 | ;;; Commentary: 11 | 12 | ;; Some basic configuration for Scheme programming. 13 | 14 | ;;; License: 15 | 16 | ;; This program is free software; you can redistribute it and/or 17 | ;; modify it under the terms of the GNU General Public License 18 | ;; as published by the Free Software Foundation; either version 3 19 | ;; of the License, or (at your option) any later version. 20 | ;; 21 | ;; This program is distributed in the hope that it will be useful, 22 | ;; but WITHOUT ANY WARRANTY; without even the implied warranty of 23 | ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 24 | ;; GNU General Public License for more details. 25 | ;; 26 | ;; You should have received a copy of the GNU General Public License 27 | ;; along with GNU Emacs; see the file COPYING. If not, write to the 28 | ;; Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, 29 | ;; Boston, MA 02110-1301, USA. 30 | 31 | ;;; Code: 32 | (prelude-require-package 'geiser) 33 | 34 | (require 'prelude-lisp) 35 | (require 'geiser) 36 | 37 | ;; geiser replies on a REPL to provide autodoc and completion 38 | (setq geiser-mode-start-repl-p t) 39 | 40 | ;; keep the home clean 41 | (setq geiser-repl-history-filename 42 | (expand-file-name "geiser-history" prelude-savefile-dir)) 43 | 44 | (add-hook 'scheme-mode-hook (lambda () (run-hooks 'prelude-lisp-coding-hook))) 45 | 46 | (provide 'prelude-scheme) 47 | 48 | ;;; prelude-scheme.el ends here 49 | -------------------------------------------------------------------------------- /modules/prelude-scss.el: -------------------------------------------------------------------------------- 1 | ;;; prelude-scss.el --- Emacs Prelude: scss support 2 | ;; 3 | ;; Copyright © 2011-2025 Bozhidar Batsov 4 | ;; 5 | ;; Author: Bozhidar Batsov 6 | ;; URL: http://www.batsov.com/emacs-prelude 7 | 8 | ;; This file is not part of GNU Emacs. 9 | 10 | ;;; Commentary: 11 | 12 | ;; Some basic configuration for scss-mode. 13 | 14 | ;;; License: 15 | 16 | ;; This program is free software; you can redistribute it and/or 17 | ;; modify it under the terms of the GNU General Public License 18 | ;; as published by the Free Software Foundation; either version 3 19 | ;; of the License, or (at your option) any later version. 20 | ;; 21 | ;; This program is distributed in the hope that it will be useful, 22 | ;; but WITHOUT ANY WARRANTY; without even the implied warranty of 23 | ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 24 | ;; GNU General Public License for more details. 25 | ;; 26 | ;; You should have received a copy of the GNU General Public License 27 | ;; along with GNU Emacs; see the file COPYING. If not, write to the 28 | ;; Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, 29 | ;; Boston, MA 02110-1301, USA. 30 | 31 | ;;; Code: 32 | 33 | (require 'prelude-css) 34 | (prelude-require-packages '(scss-mode)) 35 | 36 | ;; turn off annoying auto-compile on save 37 | (setq scss-compile-at-save nil) 38 | 39 | (defun prelude-scss-mode-defaults () 40 | (prelude-css-mode-defaults)) 41 | 42 | (setq prelude-scss-mode-hook 'prelude-scss-mode-defaults) 43 | 44 | (add-hook 'scss-mode-hook (lambda () (run-hooks 'prelude-scss-mode-hook))) 45 | 46 | (provide 'prelude-scss) 47 | ;;; prelude-scss.el ends here 48 | -------------------------------------------------------------------------------- /modules/prelude-selectrum.el: -------------------------------------------------------------------------------- 1 | ;;; prelude-selectrum.el --- Selectrum setup 2 | ;; 3 | ;; Copyright © 2011-2025 Bozhidar Batsov 4 | ;; 5 | ;; Author: Bozhidar Batsov 6 | ;; URL: https://github.com/bbatsov/prelude 7 | 8 | ;; This file is not part of GNU Emacs. 9 | 10 | ;;; Commentary: 11 | 12 | ;; Selectrum-related config. Selectrum is a smart framework for minibuffer 13 | ;; completion/filtering/selection (think of ivy/ido). 14 | 15 | ;;; License: 16 | 17 | ;; This program is free software; you can redistribute it and/or 18 | ;; modify it under the terms of the GNU General Public License 19 | ;; as published by the Free Software Foundation; either version 3 20 | ;; of the License, or (at your option) any later version. 21 | ;; 22 | ;; This program is distributed in the hope that it will be useful, 23 | ;; but WITHOUT ANY WARRANTY; without even the implied warranty of 24 | ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 25 | ;; GNU General Public License for more details. 26 | ;; 27 | ;; You should have received a copy of the GNU General Public License 28 | ;; along with GNU Emacs; see the file COPYING. If not, write to the 29 | ;; Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, 30 | ;; Boston, MA 02110-1301, USA. 31 | 32 | ;;; Code: 33 | (prelude-require-packages '(selectrum selectrum-prescient)) 34 | 35 | ;;; Selectrum 36 | ;; 37 | ;; selectrum is a powerful alternative to the popular ido-mode and ivy-mode. 38 | 39 | (require 'selectrum) 40 | (require 'selectrum-prescient) 41 | (require 'diminish) 42 | 43 | (selectrum-mode 1) 44 | (diminish 'selectrum-mode) 45 | 46 | ;; to make sorting and filtering more intelligent 47 | (selectrum-prescient-mode +1) 48 | 49 | ;; to save your command history on disk, so the sorting gets more 50 | ;; intelligent over time 51 | (prescient-persist-mode +1) 52 | 53 | (provide 'prelude-selectrum) 54 | ;;; prelude-selectrum.el ends here 55 | -------------------------------------------------------------------------------- /modules/prelude-shell.el: -------------------------------------------------------------------------------- 1 | ;;; prelude-shell.el --- Emacs Prelude: sh-mode configuration. 2 | ;; 3 | ;; Copyright © 2011-2025 Bozhidar Batsov 4 | ;; 5 | ;; Author: Bozhidar Batsov 6 | ;; URL: https://github.com/bbatsov/prelude 7 | 8 | ;; This file is not part of GNU Emacs. 9 | 10 | ;;; Commentary: 11 | 12 | ;; Some basic configuration for cc-mode and the modes derived from it. 13 | 14 | ;;; License: 15 | 16 | ;; This program is free software; you can redistribute it and/or 17 | ;; modify it under the terms of the GNU General Public License 18 | ;; as published by the Free Software Foundation; either version 3 19 | ;; of the License, or (at your option) any later version. 20 | ;; 21 | ;; This program is distributed in the hope that it will be useful, 22 | ;; but WITHOUT ANY WARRANTY; without even the implied warranty of 23 | ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 24 | ;; GNU General Public License for more details. 25 | ;; 26 | ;; You should have received a copy of the GNU General Public License 27 | ;; along with GNU Emacs; see the file COPYING. If not, write to the 28 | ;; Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, 29 | ;; Boston, MA 02110-1301, USA. 30 | 31 | ;;; Code: 32 | 33 | (require 'sh-script) 34 | 35 | ;; recognize prezto files as zsh scripts 36 | (defvar prelude-prezto-files '("zlogin" "zlogin" "zlogout" "zpreztorc" "zprofile" "zshenv" "zshrc")) 37 | 38 | (mapc (lambda (file) 39 | (add-to-list 'auto-mode-alist `(,(format "\\%s\\'" file) . sh-mode))) 40 | prelude-prezto-files) 41 | 42 | (add-hook 'sh-mode-hook 43 | (lambda () 44 | (if (and buffer-file-name 45 | (member (file-name-nondirectory buffer-file-name) prelude-prezto-files)) 46 | (sh-set-shell "zsh")))) 47 | 48 | (provide 'prelude-shell) 49 | ;;; prelude-shell.el ends here 50 | -------------------------------------------------------------------------------- /modules/prelude-ts.el: -------------------------------------------------------------------------------- 1 | ;;; prelude-ts.el --- Emacs Prelude: Typescript programming support. 2 | ;; 3 | ;; Copyright © 2023-2025 LEE Dongjun 4 | ;; 5 | ;; Author: LEE Dongjun 6 | 7 | ;; This file is not part of GNU Emacs. 8 | 9 | ;;; Commentary: 10 | 11 | ;; Some basic configuration for Typescript development. 12 | 13 | ;;; License: 14 | 15 | ;; This program is free software; you can redistribute it and/or 16 | ;; modify it under the terms of the GNU General Public License 17 | ;; as published by the Free Software Foundation; either version 3 18 | ;; of the License, or (at your option) any later version. 19 | ;; 20 | ;; This program is distributed in the hope that it will be useful, 21 | ;; but WITHOUT ANY WARRANTY; without even the implied warranty of 22 | ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 23 | ;; GNU General Public License for more details. 24 | ;; 25 | ;; You should have received a copy of the GNU General Public License 26 | ;; along with GNU Emacs; see the file COPYING. If not, write to the 27 | ;; Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, 28 | ;; Boston, MA 02110-1301, USA. 29 | 30 | ;;; Code: 31 | 32 | (require 'prelude-programming) 33 | (prelude-require-packages '(tide typescript-mode)) 34 | 35 | (add-to-list 'auto-mode-alist '("\\.ts\\'" . typescript-mode)) 36 | 37 | (defcustom prelude-ts-format-action #'tide-format-before-save 38 | "The format function to invoke on save. 39 | 40 | Triggered only when `prelude-format-on-save' is enabled." 41 | :package-version '(prelude . "1.2")) 42 | 43 | (with-eval-after-load 'typescript-mode 44 | (defun prelude-ts-mode-defaults () 45 | (interactive) 46 | (tide-setup) 47 | (flycheck-mode +1) 48 | (setq flycheck-check-syntax-automatically '(save mode-enabled)) 49 | (eldoc-mode +1) 50 | (tide-hl-identifier-mode +1)) 51 | 52 | ;; formats the buffer before saving 53 | (add-hook 'before-save-hook 54 | (lambda () 55 | (when (and prelude-format-on-save prelude-ts-format-action) 56 | (funcall prelude-ts-format-action)))) 57 | 58 | (setq prelude-ts-mode-hook 'prelude-ts-mode-defaults) 59 | 60 | (add-hook 'typescript-mode-hook (lambda () (run-hooks 'prelude-ts-mode-hook)))) 61 | 62 | (provide 'prelude-ts) 63 | 64 | ;;; prelude-ts.el ends here 65 | -------------------------------------------------------------------------------- /modules/prelude-vertico.el: -------------------------------------------------------------------------------- 1 | ;;; prelude-vertico.el --- Vertico setup 2 | ;; 3 | ;; Copyright © 2011-2025 Bozhidar Batsov 4 | ;; 5 | ;; Author: Bozhidar Batsov 6 | ;; URL: https://github.com/bbatsov/prelude 7 | 8 | ;; This file is not part of GNU Emacs. 9 | 10 | ;;; Commentary: 11 | 12 | ;; Vertico-related config. Vertico is a smart framework for minibuffer 13 | ;; completion/filtering/selection (think of ivy/ido). 14 | 15 | ;;; License: 16 | 17 | ;; This program is free software; you can redistribute it and/or 18 | ;; modify it under the terms of the GNU General Public License 19 | ;; as published by the Free Software Foundation; either version 3 20 | ;; of the License, or (at your option) any later version. 21 | ;; 22 | ;; This program is distributed in the hope that it will be useful, 23 | ;; but WITHOUT ANY WARRANTY; without even the implied warranty of 24 | ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 25 | ;; GNU General Public License for more details. 26 | ;; 27 | ;; You should have received a copy of the GNU General Public License 28 | ;; along with GNU Emacs; see the file COPYING. If not, write to the 29 | ;; Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, 30 | ;; Boston, MA 02110-1301, USA. 31 | 32 | ;;; Code: 33 | (require 'use-package) 34 | 35 | ;; Enable vertico 36 | (use-package vertico 37 | :ensure t 38 | :init 39 | (vertico-mode) 40 | 41 | ;; Different scroll margin 42 | ;; (setq vertico-scroll-margin 0) 43 | 44 | ;; Show more candidates 45 | ;; (setq vertico-count 20) 46 | 47 | ;; Grow and shrink the Vertico minibuffer 48 | ;; (setq vertico-resize t) 49 | 50 | ;; Optionally enable cycling for `vertico-next' and `vertico-previous'. 51 | ;; (setq vertico-cycle t) 52 | ) 53 | 54 | ;; A few more useful configurations for Vertico 55 | (use-package emacs 56 | :init 57 | ;; Add prompt indicator to `completing-read-multiple'. 58 | ;; We display [CRM], e.g., [CRM,] if the separator is a comma. 59 | (defun prelude-crm-indicator (args) 60 | (cons (format "[CRM%s] %s" 61 | (replace-regexp-in-string 62 | "\\`\\[.*?]\\*\\|\\[.*?]\\*\\'" "" 63 | crm-separator) 64 | (car args)) 65 | (cdr args))) 66 | (advice-add #'completing-read-multiple :filter-args #'prelude-crm-indicator) 67 | 68 | ;; Do not allow the cursor in the minibuffer prompt 69 | (setq minibuffer-prompt-properties 70 | '(read-only t cursor-intangible t face minibuffer-prompt)) 71 | (add-hook 'minibuffer-setup-hook #'cursor-intangible-mode) 72 | 73 | ;; Emacs 28: Hide commands in M-x which do not work in the current mode. 74 | ;; Vertico commands are hidden in normal buffers. 75 | ;; (setq read-extended-command-predicate 76 | ;; #'command-completion-default-include-p) 77 | 78 | ;; Enable recursive minibuffers 79 | (setq enable-recursive-minibuffers t)) 80 | 81 | ;; use the `orderless' completion style. 82 | (use-package orderless 83 | :ensure t 84 | :init 85 | ;; Configure a custom style dispatcher (see the Consult wiki) 86 | ;; (setq orderless-style-dispatchers '(+orderless-dispatch) 87 | ;; orderless-component-separator #'orderless-escapable-split-on-space) 88 | (setq completion-styles '(orderless basic) 89 | completion-category-defaults nil 90 | completion-category-overrides '((file (styles partial-completion))))) 91 | 92 | (use-package consult 93 | :ensure t 94 | :bind ( 95 | ;; C-x bindings (ctl-x-map) 96 | ("C-x M-:" . consult-complex-command) ;; orig. repeat-complex-command 97 | ("C-x b" . consult-buffer) ;; orig. switch-to-buffer 98 | ("C-x 4 b" . consult-buffer-other-window) ;; orig. switch-to-buffer-other-window 99 | ("C-x 5 b" . consult-buffer-other-frame) ;; orig. switch-to-buffer-other-frame 100 | ;; Custom M-# bindings for fast register access 101 | ("M-#" . consult-register-load) 102 | ("M-'" . consult-register-store) ;; orig. abbrev-prefix-mark (unrelated) 103 | ("C-M-#" . consult-register) 104 | ;; Other custom bindings 105 | ("M-y" . consult-yank-pop) ;; orig. yank-pop 106 | ;; M-g bindings (goto-map) 107 | ("M-g e" . consult-compile-error) 108 | ("M-g f" . consult-flycheck) 109 | ("M-g g" . consult-goto-line) ;; orig. goto-line 110 | ("M-g M-g" . consult-goto-line) ;; orig. goto-line 111 | ("M-g o" . consult-outline) ;; Alternative: consult-org-heading 112 | ("M-g m" . consult-mark) 113 | ("M-g k" . consult-global-mark) 114 | ("M-g i" . consult-imenu) 115 | ("M-g I" . consult-imenu-multi) 116 | ;; M-s bindings (search-map) 117 | ("M-s f" . consult-find) 118 | ("M-s F" . consult-locate) 119 | ("M-s g" . consult-grep) 120 | ("M-s G" . consult-git-grep) 121 | ("M-s r" . consult-ripgrep) 122 | ("M-s l" . consult-line) 123 | ("M-s L" . consult-line-multi) 124 | ("M-s m" . consult-multi-occur) 125 | ("M-s k" . consult-keep-lines) 126 | ("M-s u" . consult-focus-lines))) 127 | 128 | (provide 'prelude-vertico) 129 | ;;; prelude-vertico.el ends here 130 | -------------------------------------------------------------------------------- /modules/prelude-web.el: -------------------------------------------------------------------------------- 1 | ;;; prelude-web.el --- Emacs Prelude: web template support 2 | ;; 3 | ;; Copyright © 2011-2025 Bozhidar Batsov 4 | ;; 5 | ;; Author: Bozhidar Batsov 6 | ;; URL: https://github.com/bbatsov/prelude 7 | 8 | ;; This file is not part of GNU Emacs. 9 | 10 | ;;; Commentary: 11 | 12 | ;; Some basic configuration for web-mode. 13 | 14 | ;;; License: 15 | 16 | ;; This program is free software; you can redistribute it and/or 17 | ;; modify it under the terms of the GNU General Public License 18 | ;; as published by the Free Software Foundation; either version 3 19 | ;; of the License, or (at your option) any later version. 20 | ;; 21 | ;; This program is distributed in the hope that it will be useful, 22 | ;; but WITHOUT ANY WARRANTY; without even the implied warranty of 23 | ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 24 | ;; GNU General Public License for more details. 25 | ;; 26 | ;; You should have received a copy of the GNU General Public License 27 | ;; along with GNU Emacs; see the file COPYING. If not, write to the 28 | ;; Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, 29 | ;; Boston, MA 02110-1301, USA. 30 | 31 | ;;; Code: 32 | 33 | (prelude-require-packages '(web-mode)) 34 | 35 | (require 'web-mode) 36 | 37 | (add-to-list 'auto-mode-alist '("\\.phtml\\'" . web-mode)) 38 | (add-to-list 'auto-mode-alist '("\\.tpl\\.php\\'" . web-mode)) 39 | (add-to-list 'auto-mode-alist '("\\.tpl\\'" . web-mode)) 40 | (add-to-list 'auto-mode-alist '("\\.hbs\\'" . web-mode)) 41 | (add-to-list 'auto-mode-alist '("\\.blade\\.php\\'" . web-mode)) 42 | (add-to-list 'auto-mode-alist '("\\.jsp\\'" . web-mode)) 43 | (add-to-list 'auto-mode-alist '("\\.as[cp]x\\'" . web-mode)) 44 | (add-to-list 'auto-mode-alist '("\\.erb\\'" . web-mode)) 45 | (add-to-list 'auto-mode-alist '("\\.html?\\'" . web-mode)) 46 | (add-to-list 'auto-mode-alist 47 | '("/\\(views\\|html\\|theme\\|templates\\)/.*\\.php\\'" . web-mode)) 48 | 49 | ;; make web-mode play nice with smartparens 50 | (setq web-mode-enable-auto-pairing nil) 51 | 52 | (sp-with-modes '(web-mode) 53 | (sp-local-pair "%" "%" 54 | :unless '(sp-in-string-p) 55 | :post-handlers '(((lambda (&rest _ignored) 56 | (just-one-space) 57 | (save-excursion (insert " "))) 58 | "SPC" "=" "#"))) 59 | (sp-local-tag "%" "<% " " %>") 60 | (sp-local-tag "=" "<%= " " %>") 61 | (sp-local-tag "#" "<%# " " %>")) 62 | 63 | (with-eval-after-load 'web-mode 64 | (defun prelude-web-mode-defaults ()) 65 | (setq prelude-web-mode-hook 'prelude-web-mode-defaults) 66 | 67 | (add-hook 'web-mode-hook (lambda () 68 | (run-hooks 'prelude-web-mode-hook)))) 69 | 70 | (provide 'prelude-web) 71 | ;;; prelude-web.el ends here 72 | -------------------------------------------------------------------------------- /modules/prelude-xml.el: -------------------------------------------------------------------------------- 1 | ;;; prelude-xml.el --- Emacs Prelude: XML editing configuration. 2 | ;; 3 | ;; Copyright © 2011-2025 Bozhidar Batsov 4 | ;; 5 | ;; Author: Bozhidar Batsov 6 | ;; URL: https://github.com/bbatsov/prelude 7 | 8 | ;; This file is not part of GNU Emacs. 9 | 10 | ;;; Commentary: 11 | 12 | ;; Some basic nxml-mode configuration. 13 | 14 | ;;; License: 15 | 16 | ;; This program is free software; you can redistribute it and/or 17 | ;; modify it under the terms of the GNU General Public License 18 | ;; as published by the Free Software Foundation; either version 3 19 | ;; of the License, or (at your option) any later version. 20 | ;; 21 | ;; This program is distributed in the hope that it will be useful, 22 | ;; but WITHOUT ANY WARRANTY; without even the implied warranty of 23 | ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 24 | ;; GNU General Public License for more details. 25 | ;; 26 | ;; You should have received a copy of the GNU General Public License 27 | ;; along with GNU Emacs; see the file COPYING. If not, write to the 28 | ;; Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, 29 | ;; Boston, MA 02110-1301, USA. 30 | 31 | ;;; Code: 32 | 33 | (require 'nxml-mode) 34 | 35 | (push '("<\\?xml" . nxml-mode) magic-mode-alist) 36 | 37 | ;; pom files should be treated as xml files 38 | (add-to-list 'auto-mode-alist '("\\.pom\\'" . nxml-mode)) 39 | 40 | (setq nxml-child-indent 4) 41 | (setq nxml-attribute-indent 4) 42 | (setq nxml-auto-insert-xml-declaration-flag nil) 43 | (setq nxml-bind-meta-tab-to-complete-flag t) 44 | (setq nxml-slash-auto-complete-flag t) 45 | 46 | (provide 'prelude-xml) 47 | 48 | ;;; prelude-xml.el ends here 49 | -------------------------------------------------------------------------------- /modules/prelude-yaml.el: -------------------------------------------------------------------------------- 1 | ;;; prelude-yaml.el --- Emacs Prelude: YAML programming support. 2 | ;; 3 | ;; Copyright © 2011-2025 Bozhidar Batsov 4 | ;; 5 | ;; Author: ToBeReplaced 6 | ;; URL: https://github.com/bbatsov/prelude 7 | 8 | ;; This file is not part of GNU Emacs. 9 | 10 | ;;; Commentary: 11 | 12 | ;; Prelude configuration for YAML. 13 | 14 | ;;; License: 15 | 16 | ;; This program is free software; you can redistribute it and/or 17 | ;; modify it under the terms of the GNU General Public License 18 | ;; as published by the Free Software Foundation; either version 3 19 | ;; of the License, or (at your option) any later version. 20 | ;; 21 | ;; This program is distributed in the hope that it will be useful, 22 | ;; but WITHOUT ANY WARRANTY; without even the implied warranty of 23 | ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 24 | ;; GNU General Public License for more details. 25 | ;; 26 | ;; You should have received a copy of the GNU General Public License 27 | ;; along with GNU Emacs; see the file COPYING. If not, write to the 28 | ;; Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, 29 | ;; Boston, MA 02110-1301, USA. 30 | 31 | ;;; Code: 32 | (prelude-require-packages '(yaml-mode)) 33 | 34 | ;; yaml-mode doesn't derive from prog-mode, but we can at least enable 35 | ;; whitespace-mode and apply cleanup. 36 | (add-hook 'yaml-mode-hook 'whitespace-mode) 37 | (add-hook 'yaml-mode-hook 'subword-mode) 38 | (add-hook 'yaml-mode-hook 39 | (lambda () (add-hook 'before-save-hook 'prelude-cleanup-maybe nil t))) 40 | 41 | (provide 'prelude-yaml) 42 | ;;; prelude-yaml.el ends here 43 | -------------------------------------------------------------------------------- /personal/.dir-locals.el: -------------------------------------------------------------------------------- 1 | ;; This will make sure that nothing in your personal directory will be 2 | ;; forced through the emacs-lisp-checkdoc flychecker. That's a great 3 | ;; checker for real modules, but these are just config files, and you 4 | ;; deserve not to get warnings all the time 5 | ((emacs-lisp-mode . ((flycheck-disabled-checkers . (emacs-lisp-checkdoc))))) 6 | -------------------------------------------------------------------------------- /personal/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bbatsov/prelude/3cf24d83eaadc426196b0bc49148c94260f78dff/personal/.gitkeep -------------------------------------------------------------------------------- /personal/preload/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bbatsov/prelude/3cf24d83eaadc426196b0bc49148c94260f78dff/personal/preload/.gitkeep -------------------------------------------------------------------------------- /prelude-cheatsheet.pdf: -------------------------------------------------------------------------------- 1 | docs/prelude-cheatsheet.pdf -------------------------------------------------------------------------------- /readthedocs.yml: -------------------------------------------------------------------------------- 1 | # Read the Docs configuration file for MkDocs projects 2 | # See https://docs.readthedocs.io/en/stable/config-file/v2.html for details 3 | 4 | # Required 5 | version: 2 6 | 7 | # Set the version of Python and other tools you might need 8 | build: 9 | os: ubuntu-22.04 10 | tools: 11 | python: "3.12" 12 | 13 | mkdocs: 14 | configuration: mkdocs.yml 15 | -------------------------------------------------------------------------------- /sample/prelude-modules.el: -------------------------------------------------------------------------------- 1 | ;;; prelude-modules.el --- A listing of modules to load on startup 2 | ;; 3 | ;; Copyright © 2011-2025 Bozhidar Batsov 4 | ;; 5 | ;; Author: Bozhidar Batsov 6 | ;; URL: https://github.com/bbatsov/prelude 7 | 8 | ;; This file is not part of GNU Emacs. 9 | 10 | ;;; Commentary: 11 | 12 | ;; This file is just a list of Prelude modules to load on startup. 13 | ;; For convenience the modules are grouped in several categories. 14 | ;; The prelude-modules.el in the samples folder should be copied 15 | ;; to your personal folder and edited there. 16 | 17 | ;; Note that some modules can't be used together - e.g. you shouldn't 18 | ;; enable both prelude-ido and prelude-ivy, as they serve the same 19 | ;; purpose. 20 | 21 | ;;; License: 22 | 23 | ;; This program is free software; you can redistribute it and/or 24 | ;; modify it under the terms of the GNU General Public License 25 | ;; as published by the Free Software Foundation; either version 3 26 | ;; of the License, or (at your option) any later version. 27 | ;; 28 | ;; This program is distributed in the hope that it will be useful, 29 | ;; but WITHOUT ANY WARRANTY; without even the implied warranty of 30 | ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 31 | ;; GNU General Public License for more details. 32 | ;; 33 | ;; You should have received a copy of the GNU General Public License 34 | ;; along with GNU Emacs; see the file COPYING. If not, write to the 35 | ;; Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, 36 | ;; Boston, MA 02110-1301, USA. 37 | 38 | ;;; Code: 39 | 40 | ;;; Uncomment the modules you'd like to use and restart Prelude afterwards 41 | 42 | ;;; General productivity tools 43 | 44 | ;; (require 'prelude-ido) ;; Supercharges Emacs completion for C-x C-f and more 45 | ;; (require 'prelude-ivy) ;; A mighty modern alternative to ido 46 | (require 'prelude-vertico) ;; A powerful, yet simple, alternative to ivy 47 | ;; (require 'prelude-helm) ;; Interface for narrowing and search 48 | ;; (require 'prelude-helm-everywhere) ;; Enable Helm everywhere 49 | (require 'prelude-company) 50 | ;; (require 'prelude-key-chord) ;; Binds useful features to key combinations 51 | 52 | ;;; Vim emulation 53 | ;; 54 | ;; Enable this module if you're fond of vim's keybindings. 55 | ;; (require 'prelude-evil) 56 | 57 | ;;; Org-mode (a legendary productivity tool that deserves its own category) 58 | ;; 59 | ;; Org-mode helps you keep TODO lists, notes and more. 60 | (require 'prelude-org) 61 | 62 | ;;; Programming languages support 63 | ;; 64 | ;; Modules for a few very common programming languages 65 | ;; are enabled by default. 66 | 67 | (require 'prelude-c) 68 | ;; (require 'prelude-clojure) 69 | ;; (require 'prelude-coffee) 70 | ;; (require 'prelude-common-lisp) 71 | (require 'prelude-css) 72 | ;; (require 'prelude-dart) 73 | (require 'prelude-emacs-lisp) 74 | ;; (require 'prelude-erlang) 75 | ;; (require 'prelude-elixir) 76 | ;; (require 'prelude-fsharp) 77 | ;; (require 'prelude-go) 78 | ;; (require 'prelude-haskell) 79 | (require 'prelude-js) 80 | ;; (require 'prelude-latex) 81 | (require 'prelude-lisp) ;; Common setup for Lisp-like languages 82 | ;; (require 'prelude-literate-programming) ;; Setup for Literate Programming 83 | (require 'prelude-lsp) ;; Base setup for the Language Server Protocol 84 | ;; (require 'prelude-lua) 85 | ;; (require 'prelude-ocaml) 86 | (require 'prelude-perl) 87 | ;; (require 'prelude-python) 88 | ;; (require 'prelude-racket) 89 | ;; (require 'prelude-ruby) 90 | ;; (require 'prelude-rust) 91 | ;; (require 'prelude-scala) 92 | ;; (require 'prelude-scheme) 93 | (require 'prelude-shell) 94 | ;; (require 'prelude-scss) 95 | ;; (require 'prelude-ts) 96 | (require 'prelude-web) ;; Emacs mode for web templates 97 | (require 'prelude-xml) 98 | (require 'prelude-yaml) 99 | 100 | ;;; Misc 101 | (require 'prelude-erc) ;; A popular Emacs IRC client (useful if you're still into Freenode) 102 | 103 | (provide 'prelude-modules) 104 | ;;; prelude-modules.el ends here 105 | -------------------------------------------------------------------------------- /sample/prelude-pinned-packages.el: -------------------------------------------------------------------------------- 1 | (add-to-list 'package-archives 2 | '("melpa-stable" . "https://stable.melpa.org/packages/") t) 3 | 4 | (setq package-pinned-packages 5 | '( 6 | (ace-window . "melpa-stable") 7 | (alchemist . "melpa-stable") 8 | (anaconda-mode . "melpa-stable") 9 | (anzu . "melpa-stable") 10 | (async . "melpa-stable") 11 | (avy . "melpa-stable") 12 | (browse-kill-ring . "melpa-stable") 13 | (caml . "melpa-stable") 14 | (cask-mode . "melpa-stable") 15 | (cdlatex . "melpa-stable") 16 | (cider . "melpa-stable") 17 | (clojure-mode . "melpa-stable") 18 | (cmake-mode . "melpa-stable") 19 | (coffee-mode . "melpa-stable") 20 | (company . "melpa-stable") 21 | (company-anaconda . "melpa-stable") 22 | (company-auctex . "melpa-stable") 23 | (company-go . "melpa-stable") 24 | (crux . "melpa-stable") 25 | (cython-mode . "melpa-stable") 26 | (d-mode . "melpa-stable") 27 | (dart-mode . "melpa-stable") 28 | (diff-hl . "melpa-stable") 29 | (diminish . "melpa-stable") 30 | (discover-my-major . "melpa-stable") 31 | (dockerfile-mode . "melpa-stable") 32 | (easy-kill . "melpa-stable") 33 | (elisp-slime-nav . "melpa-stable") 34 | (elixir-mode . "melpa-stable") 35 | (elm-mode . "melpa-stable") 36 | (epl . "melpa-stable") 37 | (erlang . "melpa-stable") 38 | (evil . "melpa-stable") 39 | (evil-numbers . "melpa-stable") 40 | (evil-surround . "melpa-stable") 41 | (evil-visualstar . "melpa-stable") 42 | (exec-path-from-shell . "melpa-stable") 43 | (expand-region . "melpa-stable") 44 | (f . "melpa-stable") 45 | (feature-mode . "melpa-stable") 46 | (flx . "melpa-stable") 47 | (flx-ido . "melpa-stable") 48 | (flycheck . "melpa-stable") 49 | (flycheck-ocaml . "melpa-stable") 50 | (geiser . "melpa-stable") 51 | (gh . "melpa-stable") 52 | (gist . "melpa-stable") 53 | (git-commit . "melpa-stable") 54 | (git-timemachine . "melpa-stable") 55 | (git-modes . "melpa-stable") 56 | (go-eldoc . "melpa-stable") 57 | (go-guru . "melpa-stable") 58 | (go-mode . "melpa-stable") 59 | (go-projectile . "melpa-stable") 60 | (go-rename . "melpa-stable") 61 | (gotest . "melpa-stable") 62 | (goto-chg . "melpa-stable") 63 | (grizzl . "melpa-stable") 64 | (groovy-mode . "melpa-stable") 65 | (guru-mode . "melpa-stable") 66 | (haml-mode . "melpa-stable") 67 | (haskell-mode . "melpa-stable") 68 | (helm . "melpa-stable") 69 | (helm-ag . "melpa-stable") 70 | (helm-core . "melpa-stable") 71 | (helm-descbinds . "melpa-stable") 72 | (helm-projectile . "melpa-stable") 73 | (imenu-anywhere . "melpa-stable") 74 | (inf-ruby . "melpa-stable") 75 | (js2-mode . "melpa-stable") 76 | (json-mode . "melpa-stable") 77 | (json-reformat . "melpa-stable") 78 | (json-snatcher . "melpa-stable") 79 | (kivy-mode . "melpa-stable") 80 | (less-css-mode . "melpa-stable") 81 | (logito . "melpa-stable") 82 | (lua-mode . "melpa-stable") 83 | (macrostep . "melpa-stable") 84 | (magit . "melpa-stable") 85 | (magit-popup . "melpa-stable") 86 | (magit-section . "melpa-stable") 87 | (makey . "melpa-stable") 88 | (markdown-mode . "melpa-stable") 89 | (marshal . "melpa-stable") 90 | (merlin . "melpa-stable") 91 | (operate-on-number . "melpa-stable") 92 | (pcache . "melpa-stable") 93 | (php-mode . "melpa-stable") 94 | (pkg-info . "melpa-stable") 95 | (pkgbuild-mode . "melpa-stable") 96 | (popup . "melpa-stable") 97 | (projectile . "melpa-stable") 98 | (protobuf-mode . "melpa-stable") 99 | (puppet-mode . "melpa-stable") 100 | (pythonic . "melpa-stable") 101 | (queue . "gnu") 102 | (rich-minority . "melpa-stable") 103 | (ruby-tools . "melpa-stable") 104 | (s . "melpa-stable") 105 | (sass-mode . "melpa-stable") 106 | (sbt-mode . "melpa-stable") 107 | (scala-mode . "melpa-stable") 108 | (scss-mode . "melpa-stable") 109 | (slim-mode . "melpa-stable") 110 | (slime . "melpa-stable") 111 | (smart-mode-line . "melpa-stable") 112 | (smartparens . "melpa-stable") 113 | (smartrep . "melpa-stable") 114 | (smex . "melpa-stable") 115 | (spinner . "gnu") 116 | (stylus-mode . "melpa-stable") 117 | (swift-mode . "melpa-stable") 118 | (thrift . "melpa-stable") 119 | (tuareg . "melpa-stable") 120 | (utop . "melpa-stable") 121 | (volatile-highlights . "melpa-stable") 122 | (web-mode . "melpa-stable") 123 | (which-key . "melpa-stable") 124 | (with-editor . "melpa-stable") 125 | (yaml-mode . "melpa-stable") 126 | (yasnippet . "melpa-stable") 127 | (zenburn-theme . "melpa-stable") 128 | (zop-to-char . "melpa-stable") 129 | )) 130 | -------------------------------------------------------------------------------- /vendor/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bbatsov/prelude/3cf24d83eaadc426196b0bc49148c94260f78dff/vendor/.gitkeep -------------------------------------------------------------------------------- /vendor/README.md: -------------------------------------------------------------------------------- 1 | # Vendored Packages Directory 2 | 3 | The main purpose of this folder is to drop here Emacs packages 4 | that for some reason are not available via `package.el` repositories 5 | (e.g. you might want some package available only on EmacsWiki). 6 | 7 | Any code that you place here will be available via `require`. 8 | Within Prelude's code you can refer to this folder via 9 | `prelude-vendor-dir`. 10 | --------------------------------------------------------------------------------