Merge branch 'develop' into lsp-tex
This commit is contained in:
commit
96276a688d
263 changed files with 4049 additions and 2644 deletions
2
.github/workflows/test.yml
vendored
2
.github/workflows/test.yml
vendored
|
@ -27,7 +27,7 @@ jobs:
|
||||||
with:
|
with:
|
||||||
version: ${{ matrix.emacs_version }}
|
version: ${{ matrix.emacs_version }}
|
||||||
|
|
||||||
- uses: actions/checkout@v1
|
- uses: actions/checkout@v2
|
||||||
- name: Doom version
|
- name: Doom version
|
||||||
run: "bin/doom version"
|
run: "bin/doom version"
|
||||||
- name: Run tests
|
- name: Run tests
|
||||||
|
|
380
README.md
380
README.md
|
@ -1,180 +1,250 @@
|
||||||
<a href="http://doomemacs.org">
|
<div align="center">
|
||||||
<img src="https://img.shields.io/github/tag/hlissner/doom-emacs.svg?label=release&color=orange" alt="Made with Doom Emacs">
|
|
||||||
</a>
|
# Doom Emacs
|
||||||
<a href="https://emacs.org">
|
|
||||||
<img src="https://img.shields.io/badge/Made_for-Emacs_26.1+-blueviolet.svg" alt="Made for Emacs 26.1+">
|
[Website] • [Install](#install) • [Documentation] • [FAQ] • [Screenshots] • [Contribute](#contribute)
|
||||||
</a>
|
|
||||||
<a href="https://github.com/hlissner/doom-emacs/actions">
|

|
||||||
<img src="https://github.com/hlissner/doom-emacs/workflows/CI/badge.svg" alt="Build status: develop">
|

|
||||||
</a>
|

|
||||||
<a href="https://discord.gg/qvGgnVx">
|

|
||||||
<img src="https://img.shields.io/badge/Discord-blue.svg?logo=discord&label=join" alt="Join our discord server" align="right">
|
[][Discord]
|
||||||
</a>
|
|
||||||
<br><br>
|
|
||||||
|
|
||||||

|

|
||||||
|
|
||||||
<p align="center">
|
</div>
|
||||||
<b><a href="/../../tree/screenshots">Screenshots</a></b>
|
|
||||||
|
|
|
||||||
<b><a href="docs/getting_started.org">Get started</a></b>
|
|
||||||
|
|
|
||||||
<b><a href="docs/contributing.org">Contribute</a></b>
|
|
||||||
|
|
|
||||||
<b><a href="docs/index.org">Documentation</a></b>
|
|
||||||
|
|
|
||||||
<b><a href="docs/faq.org">FAQ</a></b>
|
|
||||||
</p>
|
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
**Quick start**
|
### Table of Contents
|
||||||
|
- [Introduction](#introduction)
|
||||||
|
- [Features](#features)
|
||||||
|
- [Prerequisites](#prerequisites)
|
||||||
|
- [Install](#install)
|
||||||
|
- [Roadmap](#roadmap)
|
||||||
|
- [Getting help](#getting-help)
|
||||||
|
- [Contributing](#contributing)
|
||||||
|
|
||||||
```bash
|
|
||||||
git clone https://github.com/hlissner/doom-emacs ~/.emacs.d
|
# Introduction
|
||||||
|
<a href="http://ultravioletbat.deviantart.com/art/Yay-Evil-111710573">
|
||||||
|
<img src="https://raw.githubusercontent.com/hlissner/doom-emacs/screenshots/cacochan.png" align="right" />
|
||||||
|
</a>
|
||||||
|
|
||||||
|
> It is a story as old as time. A stubborn, shell-dwelling, and melodramatic
|
||||||
|
> vimmer -- envious of the features of modern text editors -- spirals into
|
||||||
|
> despair before he succumbs to the [dark side][evil-mode]. This is his config.
|
||||||
|
|
||||||
|
Doom is a configuration framework for [GNU Emacs] tailored for Emacs bankruptcy
|
||||||
|
veterans who want less framework in their frameworks, a modicum of stability
|
||||||
|
(and reproducibility) from their package manager, and the performance of a hand
|
||||||
|
rolled config (or better). It can be a foundation for your own config or a
|
||||||
|
resource for Emacs enthusiasts to learn more about our favorite operating
|
||||||
|
system.
|
||||||
|
|
||||||
|
Its design is guided by these mantras:
|
||||||
|
|
||||||
|
+ **Gotta go fast.** Startup and run-time performance are priorities. Doom goes
|
||||||
|
beyond by modifying packages to be snappier and load lazier.
|
||||||
|
+ **Close to metal.** There's less between you and vanilla Emacs by design.
|
||||||
|
That's less to grok and less to work around when you tinker. Internals ought
|
||||||
|
to be written as if reading them were part of Doom's UX, and it is!
|
||||||
|
+ **Opinionated, but not stubborn.** Doom is about reasonable defaults and
|
||||||
|
curated opinions, but use as little or as much of it as you like.
|
||||||
|
+ **Your system, your rules.** You know better. At least, Doom hopes so! It
|
||||||
|
won't *automatically* install system dependencies (and will force plugins not
|
||||||
|
to either). Rely on `doom doctor` to tell you what's missing.
|
||||||
|
+ **Nix/Guix was a great idea!** The Emacs ecosystem is temperamental. Things
|
||||||
|
break and they break often. Disaster recovery should be a priority! Doom's
|
||||||
|
package management should be declarative and your private config reproducible,
|
||||||
|
and comes with a means to roll back releases and updates (still a WIP).
|
||||||
|
|
||||||
|
Check out [the FAQ][FAQ] for answers to common questions about the project.
|
||||||
|
|
||||||
|
|
||||||
|
# Features
|
||||||
|
- Minimalistic good looks inspired by modern editors.
|
||||||
|
- Curated and sane defaults for many packages, (major) OSes, and Emacs itself.
|
||||||
|
- A modular organizational structure for separating concerns in your config.
|
||||||
|
- A standard library designed to simplify your elisp bike shedding.
|
||||||
|
- A declarative [package management system][package-management] (powered by
|
||||||
|
[straight.el]) with a command line interface. Install packages from anywhere,
|
||||||
|
not just (M)ELPA, and pin them to any commit.
|
||||||
|
- Optional vim emulation powered by [evil-mode], including ports of popular vim
|
||||||
|
plugins like [vim-sneak], [vim-easymotion], [vim-unimpaired] and
|
||||||
|
[more][ported-vim-plugins]!
|
||||||
|
- Opt-in LSP integration for many languages, using [lsp-mode].
|
||||||
|
- Support for *many* programming languages. Includes syntax highlighting,
|
||||||
|
linters/checker integration, inline code evaluation, code completion (where
|
||||||
|
possible), REPLs, documentation lookups, snippets, and more!
|
||||||
|
- Support for *many* tools, like docker, pass, ansible, terraform, and more.
|
||||||
|
- A Spacemacs-esque [keybinding scheme][bindings], centered around leader
|
||||||
|
and localleader prefix keys (<kbd>SPC</kbd> and <kbd>SPC</kbd><kbd>m</kbd> for
|
||||||
|
evil users, <kbd>C-c</kbd> and <kbd>C-c l</kbd> for vanilla users).
|
||||||
|
- A rule-based [popup manager][popup-system] to control how temporary buffers
|
||||||
|
are displayed (and disposed of).
|
||||||
|
- Per-file indentation style detection and [editorconfig] integration. Let
|
||||||
|
someone else can argue about tabs vs **_spaces_**.
|
||||||
|
- Project-management tools and framework-specific minor modes with their own
|
||||||
|
snippets libraries.
|
||||||
|
- Project search (and replace) utilities, powered by [ripgrep] and [ivy] or
|
||||||
|
[helm].
|
||||||
|
- Isolated and persistent workspaces (also substitutes for vim tabs).
|
||||||
|
- Support for Chinese and Japanese input systems.
|
||||||
|
- Save a snapshot of your shell environment to a file for Emacs to load at
|
||||||
|
startup. No more struggling to get Emacs to inherit your `PATH`, among other
|
||||||
|
things.
|
||||||
|
|
||||||
|
|
||||||
|
# Prerequisites
|
||||||
|
+ Git 2.23+
|
||||||
|
+ Emacs 26.1+ *(27 is recommended)* with GNUTLS support
|
||||||
|
+ [ripgrep] 11.0+
|
||||||
|
+ GNU `find`
|
||||||
|
+ *OPTIONAL:* [fd] 7.3.0+ (improves file indexing performance for some commands)
|
||||||
|
|
||||||
|
Doom is comprised of [~150 optional modules][Modules], some of which may have
|
||||||
|
additional dependencies. [Visit their documentation][Modules] or run `bin/doom
|
||||||
|
doctor` to check for any that you may have missed.
|
||||||
|
|
||||||
|
|
||||||
|
# Install
|
||||||
|
``` sh
|
||||||
|
git clone --depth 1 https://github.com/hlissner/doom-emacs ~/.emacs.d
|
||||||
~/.emacs.d/bin/doom install
|
~/.emacs.d/bin/doom install
|
||||||
```
|
```
|
||||||
|
|
||||||
More details, including dependencies and how to install Emacs, can be found [in
|
Then [read our Getting Started guide][documentation] to be walked through
|
||||||
the documentation](docs/getting_started.org#install).
|
setting up, configuring and maintaining Doom Emacs.
|
||||||
|
|
||||||
**Table of Contents**
|
It's a good idea to add `~/.emacs.d/bin` to your `PATH`! Other `bin/doom`
|
||||||
|
commands you should know about:
|
||||||
|
|
||||||
- [What is Doom Emacs](#what-is-doom-emacs)
|
+ `doom sync` to synchronize your private config with Doom. Installs new
|
||||||
- [Doom's mantras](#dooms-mantras)
|
packages, removes orphaned packages and regenerates caches. Run this whenever
|
||||||
- [Features](#features)
|
you modify your private `init.el` or `packages.el`, or install/remove an Emacs
|
||||||
- [Getting Help](#getting-help)
|
package through your OS package manager (e.g. mu4e or agda).
|
||||||
- [Community](#community)
|
+ `doom upgrade` to update Doom to the latest release & all installed packages.
|
||||||
- [Troubleshooting](#troubleshooting)
|
+ `doom doctor` to diagnose common issues with your system and config.
|
||||||
- [Contributing](#contributing)
|
+ `doom env` to dump a snapshot of your shell environment to a file that Doom
|
||||||
|
will load at startup. This allows Emacs to inherit your `PATH`, among other
|
||||||
|
things.
|
||||||
|
+ `doom build` to recompile all installed packages (use this if you up/downgrade
|
||||||
|
Emacs).
|
||||||
|
|
||||||
# What is Doom Emacs
|
|
||||||
|
|
||||||
<a href="http://ultravioletbat.deviantart.com/art/Yay-Evil-111710573">
|
# Roadmap
|
||||||
<img src="https://github.com/hlissner/doom-emacs/raw/screenshots/cacochan.png" align="right" />
|
Doom is an active and ongoing project. To make that development more
|
||||||
</a>
|
transparent, its roadmap (and other concerns) are published across three github
|
||||||
|
project boards and a newsletter:
|
||||||
|
|
||||||
It is a story as old as time. A stubborn, shell-dwelling, and melodramatic as
|
+ [Development Roadmap](/projects/3): roughly outlines our goals between release
|
||||||
vimmer -- envious of the features of modern text editors -- spirals into despair
|
milestones and their progress.
|
||||||
before succumbing to the [dark side][url:evil-mode]. This is his config.
|
+ [Plugins under review](/projects/2): lists plugins we are watching and
|
||||||
|
considering for inclusion, and what their status for inclusion is. Please
|
||||||
|
consult this list before requesting new packages/features.
|
||||||
|
+ [Upstream bugs](/projects/5): lists issues that originate from elsewhere, and
|
||||||
|
whether or not we have local workarounds or temporary fixes for them.
|
||||||
|
+ ~~Doom's newsletter~~ (not finished) will contain changelogs in between
|
||||||
|
releases.
|
||||||
|
|
||||||
|
|
||||||
Doom is a configuration framework for [GNU
|
# Getting help
|
||||||
Emacs](https://www.gnu.org/software/emacs/) tailored for Emacs bankruptcy
|
Emacs is no journey of a mere thousand miles. You _will_ run into problems and
|
||||||
veterans who want less framework in their frameworks and the performance of a
|
mysterious errors. When you do, here are some places you can look for help:
|
||||||
hand rolled config (or better). It can be a foundation for your own config or a
|
|
||||||
resource for Emacs enthusiasts to learn more about our favorite OS.
|
|
||||||
|
|
||||||
## Doom's mantras
|
+ [Our documentation][documentation] covers many use cases.
|
||||||
|
+ [The Configuration section][configuration] covers how to configure Doom and
|
||||||
|
its packages.
|
||||||
|
+ [The Package Management section][package-management] covers how to install
|
||||||
|
and disable packages.
|
||||||
|
+ [This section][bin/doom] explains the `bin/doom` script's most important
|
||||||
|
commands.
|
||||||
|
+ [This section][common-mistakes] lists some common configuration mistakes new
|
||||||
|
users make, when migrating a config from another distro or their own.
|
||||||
|
+ [This answer][change-theme] shows you how to add your own themes to your
|
||||||
|
private config.
|
||||||
|
+ [This answer][change-font] shows you how to change the default font.
|
||||||
|
+ Your issue may be documented in the [FAQ].
|
||||||
|
+ With Emacs built-in help system documentation is a keystroke away:
|
||||||
|
+ For functions: `SPC h f` or `C-h f`
|
||||||
|
+ For variables: `SPC h v` or `C-h v`
|
||||||
|
+ For a keybind: `SPC h k` or `C-h k`
|
||||||
|
+ To search available keybinds: `SPC h b b` or `C-h b b`
|
||||||
|
+ Run `bin/doom doctor` to detect common issues with your development
|
||||||
|
environment and private config.
|
||||||
|
+ Check out the [FAQ], in case your question has already been answered.
|
||||||
|
+ Search [Doom's issue tracker](/issues) in case your issue was already
|
||||||
|
reported.
|
||||||
|
+ Hop on [our Discord server][discord]; it's active and friendly! Keep an eye on
|
||||||
|
the #announcements channel, where I announce breaking updates and releases.
|
||||||
|
|
||||||
- **Gotta go fast.** Startup and run-time performance are priorities. Doom goes
|
|
||||||
beyond lazy loading packages by modifying them to be snappier and load lazier!
|
|
||||||
- **Close to metal.** There's less between you and vanilla Emacs by design.
|
|
||||||
There's less to grok, on top of Emacs.
|
|
||||||
- **Readability counts.** Internals ought to be written as if reading them were
|
|
||||||
part of the user experience, and it is! Modules should be syntactically sweet.
|
|
||||||
Backend logic should be functional (as much as elisp permits), abstraction
|
|
||||||
light and (hopefully) documented.
|
|
||||||
- **Opinionated, but not stubborn.** Doom is a bundle of reasonable defaults and
|
|
||||||
curated opinions, but all of it should be optional. Use as little or as much
|
|
||||||
of it as you like.
|
|
||||||
- **Your system, your rules.** There are more ways to set up your development
|
|
||||||
environment than there are dislikes on Youtube Rewind '18, so Doom leaves it
|
|
||||||
to you. Doom will not *automatically* install system dependencies (and will
|
|
||||||
coerce its plugins not to do so either). Use `doom doctor` to figure out
|
|
||||||
what's missing.
|
|
||||||
|
|
||||||
## Features
|
# Contribute
|
||||||
|
[](http://makeapullrequest.com)
|
||||||
|
[](https://github.com/bbatsov/emacs-lisp-style-guide)
|
||||||
|
[][liberapay]
|
||||||
|
[][paypal]
|
||||||
|
|
||||||
- Minimalistic good looks inspired by modern editors.
|
Doom is a labor of love and incurable madness, but I'm only one guy. Doom
|
||||||
- A modular architecture for a more organized Emacs configuration.
|
wouldn't be where it is today without your help. I welcome contributions of any
|
||||||
- A custom elisp library to help simplify your config.
|
kind!
|
||||||
- (Optional) Vim-emulation powered by [evil-mode][url:evil-mode], including
|
|
||||||
ports of popular vim plugins and functionality.
|
|
||||||
- A declarative [package management system][doom:packages] (powered by
|
|
||||||
[straight.el][url:straight]) with a command line interface. Install packages
|
|
||||||
from anywhere, not just (M)ELPA.
|
|
||||||
- A curated set of sane defaults for all packages, all (major) OSes, and Emacs
|
|
||||||
itself.
|
|
||||||
- Support for *many* programming languages. Too many to list. Includes syntax
|
|
||||||
highlighting, linters/checker integration, inline code evaluation, code
|
|
||||||
completion (where possible), REPLs, documentation lookups, snippets, and more!
|
|
||||||
- Support for *many* tools, like docker, pass, ansible, terraform, and more.
|
|
||||||
- A Spacemacs-esque [keybinding scheme][doom:bindings], centered around leader
|
|
||||||
and localleader prefix keys (<kbd>SPC</kbd> and <kbd>SPC</kbd><kbd>m</kbd>, by
|
|
||||||
default).
|
|
||||||
- A rule-based [popup management system][doom:popups] that dictates how
|
|
||||||
temporary or disposable buffers are displayed (and disposed of).
|
|
||||||
- Automatic indentation detection and [editorconfig][url:editorconfig]
|
|
||||||
integration. Let someone else argue about tabs vs **\_\***spaces**\*\_**.
|
|
||||||
- Project-management tools and framework-specific minor modes with their own
|
|
||||||
snippets libraries.
|
|
||||||
- Project search (and replace) utilities, powered by [ripgrep][url:ripgrep].
|
|
||||||
- Isolated and persistent workspaces (also substitutes for vim tabs).
|
|
||||||
- An envvar file generator that captures a snapshot of your shell environment
|
|
||||||
for Doom to load at startup. No more struggling to get Emacs to inherit your
|
|
||||||
`PATH`, among other things.
|
|
||||||
|
|
||||||
# Getting Help
|
+ I :heart: pull requests and bug reports (see the [Contributing
|
||||||
|
Guidelines][contribute])!
|
||||||
|
+ Don't hesitate to [tell me my Elisp-fu sucks](/issues/new), but please tell me
|
||||||
|
why.
|
||||||
|
+ Hop on [our Discord server][Discord] and say hi! Help others, hang out or talk
|
||||||
|
to me about Emacs, gamedev, programming, physics, pixel art, anime, gaming --
|
||||||
|
anything you like. Nourish this lonely soul.
|
||||||
|
+ If you'd like to support my work financially, buy me a drink through
|
||||||
|
[liberapay] or [paypal]. My work contends with studies, adventures in indie
|
||||||
|
gamedev and freelance work. Donations help me allocate more time to my Emacs
|
||||||
|
and OSS capers.
|
||||||
|
|
||||||
|
[](https://sourcerer.io/fame/hlissner/hlissner/doom-emacs/links/0)
|
||||||
|
[](https://sourcerer.io/fame/hlissner/hlissner/doom-emacs/links/1)
|
||||||
|
[](https://sourcerer.io/fame/hlissner/hlissner/doom-emacs/links/2)
|
||||||
|
[](https://sourcerer.io/fame/hlissner/hlissner/doom-emacs/links/3)
|
||||||
|
[](https://sourcerer.io/fame/hlissner/hlissner/doom-emacs/links/4)
|
||||||
|
[](https://sourcerer.io/fame/hlissner/hlissner/doom-emacs/links/5)
|
||||||
|
[](https://sourcerer.io/fame/hlissner/hlissner/doom-emacs/links/6)
|
||||||
|
[](https://sourcerer.io/fame/hlissner/hlissner/doom-emacs/links/7)
|
||||||
|
|
||||||
## Community
|
|
||||||
|
|
||||||
We have [a Discord server][url:discord]! Hop on and say hi!
|
[contribute]: docs/contributing.org
|
||||||
|
[discord]: https://discord.gg/qvGgnVx
|
||||||
|
[documentation]: docs/index.org
|
||||||
|
[faq]: docs/faq.org
|
||||||
|
[install]: docs/getting_started.org#install
|
||||||
|
[backtrace]: docs/getting_started.org#how-to-extract-a-backtrace-from-an-error
|
||||||
|
[configuration]: docs/getting_started.org#configuring-doom
|
||||||
|
[package-management]: docs/getting_started.org#package-management
|
||||||
|
[bin/doom]: docs/getting_started.org#the-bindoom-utility
|
||||||
|
[common-mistakes]: docs/getting_started.org#common-mistakes-when-configuring-doom-emacs
|
||||||
|
[change-theme]: docs/faq.org#how-do-i-change-the-theme
|
||||||
|
[change-font]: docs/faq.org#how-do-i-change-the-fonts
|
||||||
|
[modules]: docs/modules.org
|
||||||
|
[popup-system]: modules/ui/popup/README.org
|
||||||
|
[screenshots]: #screenshots
|
||||||
|
[website]: https://doomemacs.org
|
||||||
|
|
||||||
## Troubleshooting
|
[bindings]: modules/config/default/+evil-bindings.el
|
||||||
|
[editorconfig]: http://editorconfig.org/
|
||||||
|
[evil-mode]: https://github.com/emacs-evil/evil
|
||||||
|
[fd]: https://github.com/sharkdp/fd
|
||||||
|
[gnu emacs]: https://www.gnu.org/software/emacs/
|
||||||
|
[helm]: https://github.com/emacs-helm/helm
|
||||||
|
[ivy]: https://github.com/abo-abo/swiper
|
||||||
|
[lsp-mode]: https://github.com/emacs-lsp/lsp-mode
|
||||||
|
[nix]: https://nixos.org
|
||||||
|
[ported-vim-plugins]: modules/editor/evil/README.org#ported-vim-plugins
|
||||||
|
[ripgrep]: https://github.com/BurntSushi/ripgrep
|
||||||
|
[straight.el]: https://github.com/raxod502/straight.el
|
||||||
|
[vim-easymotion]: https://github.com/easymotion/vim-easymotion
|
||||||
|
[vim-lion]: https://github.com/tommcdo/vim-lion
|
||||||
|
[vim-sneak]: https://github.com/justinmk/vim-sneak
|
||||||
|
[vim-unimpaired]: https://github.com/tpope/vim-unimpaired
|
||||||
|
|
||||||
Encountered strange behavior or an error? Here are some things to try before you
|
[liberapay]: https://liberapay.com/hlissner/donate
|
||||||
shoot off that bug report:
|
[paypal]: https://paypal.me/henriklissner/10
|
||||||
|
|
||||||
- Run `bin/doom sync`. This ensures Doom is properly set up and its autoloads
|
|
||||||
files are up-to-date.
|
|
||||||
- If you have byte-compiled your config (with `bin/doom compile`), see if
|
|
||||||
`bin/doom clean` makes the issue go away. Never debug issues with a
|
|
||||||
byte-compiled config, it will make your job harder.
|
|
||||||
- Run `bin/doom doctor` to detect common issues in your development environment.
|
|
||||||
- Search Doom's issue tracker for mention of any error messages you've received.
|
|
||||||
- [Visit our FAQ][docs:faq] to see if your issue is listed.
|
|
||||||
|
|
||||||
If all else fails, [file that bug report][github:new-issue]! Please include the
|
|
||||||
behavior you've observed, the behavior you expected, and any error messages or
|
|
||||||
warnings logged to the \*Messages\* buffer (can be opened with <kbd>SPC h
|
|
||||||
e</kbd> or `M-x view-echo-area-messages`).
|
|
||||||
|
|
||||||
It's a great help if you included a backtrace with errors, i.e. `M-x
|
|
||||||
toggle-debug-on-error` then recreating the error(s).
|
|
||||||
|
|
||||||
## Contributing
|
|
||||||
|
|
||||||
Doom (and my Emacs work in general) is a labor of love and incurable madness,
|
|
||||||
done on my spare time. If you'd like to support my work, there are many things
|
|
||||||
you can do to help; I welcome any contribution!
|
|
||||||
|
|
||||||
- I love pull requests and bug reports. Check out the [Contributing
|
|
||||||
Guidelines][docs:contributing] to find out how you can help out.
|
|
||||||
- I welcome Elisp pointers! Don't hesitate to [tell me my Elisp-fu
|
|
||||||
sucks][github:new-issue] (but please tell me why).
|
|
||||||
- Hop on [our Discord server][url:discord] and say hi! Help others out, hang out
|
|
||||||
or talk to me about Emacs, or gamedev, or programming, machine learning,
|
|
||||||
physics, pixel art, anime, gaming -- anything you like. Nourish this lonely
|
|
||||||
soul!
|
|
||||||
- If you'd like to support my work financially, consider buying me a drink
|
|
||||||
through [liberapay][url:liberapay] or [paypal][url:paypal]. Donations are a
|
|
||||||
great help. My work here contends with studies, ventures in indie gamedev, and
|
|
||||||
my freelance work.
|
|
||||||
|
|
||||||
[docs:wiki]: docs/index.org
|
|
||||||
[docs:wiki-quickstart]: docs/getting_started.org
|
|
||||||
[docs:wiki-modules]: docs/index.org#Module%20List
|
|
||||||
[docs:wiki-customization]: docs/getting_started.org#Customize
|
|
||||||
[docs:contributing]: docs/contributing.org
|
|
||||||
[docs:faq]: docs/faq.org
|
|
||||||
[github:new-issue]: https://github.com/hlissner/doom-emacs/issues/new
|
|
||||||
[doom:bindings]: modules/config/default/+evil-bindings.el
|
|
||||||
[doom:packages]: core/autoload/packages.el
|
|
||||||
[doom:popups]: modules/ui/popup/README.org
|
|
||||||
[url:discord]: https://discord.gg/qvGgnVx
|
|
||||||
[url:liberapay]: https://liberapay.com/hlissner/donate
|
|
||||||
[url:paypal]: https://paypal.me/henriklissner/10
|
|
||||||
[url:editorconfig]: http://editorconfig.org/
|
|
||||||
[url:evil-mode]: https://github.com/emacs-evil/evil
|
|
||||||
[url:ripgrep]: https://github.com/BurntSushi/ripgrep
|
|
||||||
[url:straight]: https://github.com/raxod502/straight.el
|
|
||||||
|
|
|
@ -53,8 +53,8 @@ And jumps to your `doom!' block."
|
||||||
;;
|
;;
|
||||||
;;; Managements
|
;;; Managements
|
||||||
|
|
||||||
(cl-defmacro doom--compile (command &key on-success on-failure)
|
(defmacro doom--if-compile (command on-success &optional on-failure)
|
||||||
(declare (indent defun))
|
(declare (indent 2))
|
||||||
`(with-current-buffer (compile ,command)
|
`(with-current-buffer (compile ,command)
|
||||||
(add-hook
|
(add-hook
|
||||||
'compilation-finish-functions
|
'compilation-finish-functions
|
||||||
|
@ -76,19 +76,20 @@ Runs `doom-reload-hook' afterwards."
|
||||||
(interactive)
|
(interactive)
|
||||||
(require 'core-cli)
|
(require 'core-cli)
|
||||||
(when (and IS-WINDOWS (file-exists-p doom-env-file))
|
(when (and IS-WINDOWS (file-exists-p doom-env-file))
|
||||||
(warn "Can't regenerate envvar file from within Emacs. Run 'doom env' from the console"))
|
(message "Can't regenerate envvar file from within Emacs. Run 'doom env' from the console"))
|
||||||
(doom--compile (format "%s sync -e" doom-bin)
|
;; In case doom/reload is run before incrementally loaded packages are loaded,
|
||||||
:on-success
|
;; which could cause odd load order issues.
|
||||||
(let ((doom-reloading-p t))
|
(mapc #'require (cdr doom-incremental-packages))
|
||||||
(doom-initialize 'force)
|
(doom--if-compile (format "%s sync -e" doom-bin)
|
||||||
(with-demoted-errors "PRIVATE CONFIG ERROR: %s"
|
(let ((doom-reloading-p t))
|
||||||
(general-auto-unbind-keys)
|
(doom-initialize 'force)
|
||||||
(unwind-protect
|
(with-demoted-errors "PRIVATE CONFIG ERROR: %s"
|
||||||
(doom-initialize-modules 'force)
|
(general-auto-unbind-keys)
|
||||||
(general-auto-unbind-keys t)))
|
(unwind-protect
|
||||||
(run-hook-wrapped 'doom-reload-hook #'doom-try-run-hook)
|
(doom-initialize-modules 'force)
|
||||||
(print! (success "Config successfully reloaded!")))
|
(general-auto-unbind-keys t)))
|
||||||
:on-failure
|
(run-hook-wrapped 'doom-reload-hook #'doom-try-run-hook)
|
||||||
|
(print! (success "Config successfully reloaded!")))
|
||||||
(user-error "Failed to reload your config")))
|
(user-error "Failed to reload your config")))
|
||||||
|
|
||||||
;;;###autoload
|
;;;###autoload
|
||||||
|
@ -119,25 +120,22 @@ imported into Emacs."
|
||||||
(interactive "P")
|
(interactive "P")
|
||||||
(when IS-WINDOWS
|
(when IS-WINDOWS
|
||||||
(user-error "Cannot reload envvar file from within Emacs on Windows, run it from cmd.exe"))
|
(user-error "Cannot reload envvar file from within Emacs on Windows, run it from cmd.exe"))
|
||||||
(doom--compile
|
(doom--if-compile
|
||||||
(format "%s -ic '%s env%s'"
|
(format "%s -ic '%s env%s'"
|
||||||
(string-trim
|
(string-trim
|
||||||
(shell-command-to-string
|
(shell-command-to-string
|
||||||
(format "getent passwd %S | cut -d: -f7"
|
(format "getent passwd %S | cut -d: -f7"
|
||||||
(user-login-name))))
|
(user-login-name))))
|
||||||
doom-bin (if arg " -c" ""))
|
doom-bin (if arg " -c" ""))
|
||||||
:on-success
|
(let ((doom-reloading-p t))
|
||||||
(let ((doom-reloading-p t))
|
(unless arg
|
||||||
(unless arg
|
(doom-load-envvars-file doom-env-file)))
|
||||||
(doom-load-envvars-file doom-env-file)))
|
|
||||||
:on-failure
|
|
||||||
(error "Failed to generate env file")))
|
(error "Failed to generate env file")))
|
||||||
|
|
||||||
;;;###autoload
|
;;;###autoload
|
||||||
(defun doom/upgrade ()
|
(defun doom/upgrade ()
|
||||||
"Run 'doom upgrade' then prompt to restart Emacs."
|
"Run 'doom upgrade' then prompt to restart Emacs."
|
||||||
(interactive)
|
(interactive)
|
||||||
(doom--compile (format "%s upgrade" doom-bin)
|
(doom--if-compile (format "%s -y upgrade" doom-bin)
|
||||||
:on-success
|
(when (y-or-n-p "You must restart Emacs for the upgrade to take effect.\n\nRestart Emacs?")
|
||||||
(when (y-or-n-p "You must restart Emacs for the upgrade to take effect.\n\nRestart Emacs?")
|
(doom/restart-and-restore))))
|
||||||
(doom/restart-and-restore))))
|
|
||||||
|
|
|
@ -184,15 +184,45 @@ markdown and copies it to your clipboard, ready to be pasted into bug reports!"
|
||||||
|
|
||||||
;;;###autoload
|
;;;###autoload
|
||||||
(defun doom/am-i-secure ()
|
(defun doom/am-i-secure ()
|
||||||
"Test to see if your root certificates are securely configured in emacs."
|
"Test to see if your root certificates are securely configured in emacs.
|
||||||
|
Some items are not supported by the `nsm.el' module."
|
||||||
(declare (interactive-only t))
|
(declare (interactive-only t))
|
||||||
(interactive)
|
(interactive)
|
||||||
(unless (string-match-p "\\_<GNUTLS\\_>" system-configuration-features)
|
(unless (string-match-p "\\_<GNUTLS\\_>" system-configuration-features)
|
||||||
(warn "gnutls support isn't built into Emacs, there may be problems"))
|
(warn "gnutls support isn't built into Emacs, there may be problems"))
|
||||||
(if-let* ((bad-hosts
|
(if-let* ((bad-hosts
|
||||||
(cl-loop for bad
|
(cl-loop for bad
|
||||||
in '("https://wrong.host.badssl.com/"
|
in '("https://expired.badssl.com/"
|
||||||
"https://self-signed.badssl.com/")
|
"https://wrong.host.badssl.com/"
|
||||||
|
"https://self-signed.badssl.com/"
|
||||||
|
"https://untrusted-root.badssl.com/"
|
||||||
|
;; "https://revoked.badssl.com/"
|
||||||
|
;; "https://pinning-test.badssl.com/"
|
||||||
|
"https://sha1-intermediate.badssl.com/"
|
||||||
|
"https://rc4-md5.badssl.com/"
|
||||||
|
"https://rc4.badssl.com/"
|
||||||
|
"https://3des.badssl.com/"
|
||||||
|
"https://null.badssl.com/"
|
||||||
|
"https://sha1-intermediate.badssl.com/"
|
||||||
|
;; "https://client-cert-missing.badssl.com/"
|
||||||
|
"https://dh480.badssl.com/"
|
||||||
|
"https://dh512.badssl.com/"
|
||||||
|
"https://dh-small-subgroup.badssl.com/"
|
||||||
|
"https://dh-composite.badssl.com/"
|
||||||
|
"https://invalid-expected-sct.badssl.com/"
|
||||||
|
;; "https://no-sct.badssl.com/"
|
||||||
|
;; "https://mixed-script.badssl.com/"
|
||||||
|
;; "https://very.badssl.com/"
|
||||||
|
"https://subdomain.preloaded-hsts.badssl.com/"
|
||||||
|
"https://superfish.badssl.com/"
|
||||||
|
"https://edellroot.badssl.com/"
|
||||||
|
"https://dsdtestprovider.badssl.com/"
|
||||||
|
"https://preact-cli.badssl.com/"
|
||||||
|
"https://webpack-dev-server.badssl.com/"
|
||||||
|
"https://captive-portal.badssl.com/"
|
||||||
|
"https://mitm-software.badssl.com/"
|
||||||
|
"https://sha1-2016.badssl.com/"
|
||||||
|
"https://sha1-2017.badssl.com/")
|
||||||
if (condition-case _e
|
if (condition-case _e
|
||||||
(url-retrieve-synchronously bad)
|
(url-retrieve-synchronously bad)
|
||||||
(error nil))
|
(error nil))
|
||||||
|
|
|
@ -324,7 +324,7 @@ file if it exists, without confirmation."
|
||||||
(`aborted (message "Aborted"))
|
(`aborted (message "Aborted"))
|
||||||
(_ t)))
|
(_ t)))
|
||||||
|
|
||||||
(defun doom--sudo-file (file)
|
(defun doom--sudo-file-path (file)
|
||||||
(let ((host (or (file-remote-p file 'host) "localhost")))
|
(let ((host (or (file-remote-p file 'host) "localhost")))
|
||||||
(concat "/" (when (file-remote-p file)
|
(concat "/" (when (file-remote-p file)
|
||||||
(concat (file-remote-p file 'method) ":"
|
(concat (file-remote-p file 'method) ":"
|
||||||
|
@ -340,27 +340,32 @@ file if it exists, without confirmation."
|
||||||
(defun doom/sudo-find-file (file)
|
(defun doom/sudo-find-file (file)
|
||||||
"Open FILE as root."
|
"Open FILE as root."
|
||||||
(interactive "FOpen file as root: ")
|
(interactive "FOpen file as root: ")
|
||||||
(find-file (doom--sudo-file file)))
|
(find-file (doom--sudo-file-path file)))
|
||||||
|
|
||||||
;;;###autoload
|
;;;###autoload
|
||||||
(defun doom/sudo-this-file ()
|
(defun doom/sudo-this-file ()
|
||||||
"Open the current file as root."
|
"Open the current file as root."
|
||||||
(interactive)
|
(interactive)
|
||||||
(find-alternate-file (doom--sudo-file (or buffer-file-name
|
(find-file
|
||||||
(when (or (derived-mode-p 'dired-mode)
|
(doom--sudo-file-path
|
||||||
(derived-mode-p 'wdired-mode))
|
(or buffer-file-name
|
||||||
default-directory)))))
|
(when (or (derived-mode-p 'dired-mode)
|
||||||
|
(derived-mode-p 'wdired-mode))
|
||||||
|
default-directory)))))
|
||||||
|
|
||||||
;;;###autoload
|
;;;###autoload
|
||||||
(defun doom/sudo-save-buffer ()
|
(defun doom/sudo-save-buffer ()
|
||||||
"Save this file as root."
|
"Save this file as root."
|
||||||
(interactive)
|
(interactive)
|
||||||
(let ((file (doom--sudo-file buffer-file-name)))
|
(let ((file (doom--sudo-file-path buffer-file-name)))
|
||||||
(if-let (buffer (find-file-noselect file))
|
(if-let (buffer (find-file-noselect file))
|
||||||
(let ((origin (current-buffer)))
|
(let ((origin (current-buffer)))
|
||||||
|
(copy-to-buffer buffer (point-min) (point-max))
|
||||||
(unwind-protect
|
(unwind-protect
|
||||||
(with-current-buffer buffer
|
(with-current-buffer buffer
|
||||||
(save-buffer))
|
(save-buffer))
|
||||||
(unless (eq origin buffer)
|
(unless (eq origin buffer)
|
||||||
(kill-buffer buffer))))
|
(kill-buffer buffer))
|
||||||
|
(with-current-buffer origin
|
||||||
|
(revert-buffer t t))))
|
||||||
(user-error "Unable to open %S" file))))
|
(user-error "Unable to open %S" file))))
|
||||||
|
|
|
@ -12,7 +12,7 @@ scaled up by `doom-big-font-increment'. See `doom-font' for details on
|
||||||
acceptable values for this variable.")
|
acceptable values for this variable.")
|
||||||
|
|
||||||
;;;###autoload
|
;;;###autoload
|
||||||
(defvar doom-big-font-increment 8
|
(defvar doom-big-font-increment 4
|
||||||
"How many steps to increase the font size (with `doom-font' as the base) when
|
"How many steps to increase the font size (with `doom-font' as the base) when
|
||||||
`doom-big-font-mode' is enabled and `doom-big-font' is nil.")
|
`doom-big-font-mode' is enabled and `doom-big-font' is nil.")
|
||||||
|
|
||||||
|
|
|
@ -3,9 +3,6 @@
|
||||||
(defvar doom--help-major-mode-module-alist
|
(defvar doom--help-major-mode-module-alist
|
||||||
'((dockerfile-mode :tools docker)
|
'((dockerfile-mode :tools docker)
|
||||||
(agda2-mode :lang agda)
|
(agda2-mode :lang agda)
|
||||||
(haxor-mode :lang assembly)
|
|
||||||
(mips-mode :lang assembly)
|
|
||||||
(nasm-mode :lang assembly)
|
|
||||||
(c-mode :lang cc)
|
(c-mode :lang cc)
|
||||||
(c++-mode :lang cc)
|
(c++-mode :lang cc)
|
||||||
(objc++-mode :lang cc)
|
(objc++-mode :lang cc)
|
||||||
|
|
|
@ -128,7 +128,8 @@ installed."
|
||||||
'builtin)
|
'builtin)
|
||||||
((assq package package-alist)
|
((assq package package-alist)
|
||||||
'elpa)
|
'elpa)
|
||||||
('other)))
|
((locate-library (symbol-name package))
|
||||||
|
'other)))
|
||||||
|
|
||||||
;;;###autoload
|
;;;###autoload
|
||||||
(defun doom-package-different-recipe-p (name)
|
(defun doom-package-different-recipe-p (name)
|
||||||
|
|
|
@ -117,7 +117,7 @@ in some cases."
|
||||||
;;; Commands
|
;;; Commands
|
||||||
|
|
||||||
(defun doom--bol-bot-eot-eol (&optional pos)
|
(defun doom--bol-bot-eot-eol (&optional pos)
|
||||||
(save-excursion
|
(save-mark-and-excursion
|
||||||
(when pos
|
(when pos
|
||||||
(goto-char pos))
|
(goto-char pos))
|
||||||
(let* ((bol (if visual-line-mode
|
(let* ((bol (if visual-line-mode
|
||||||
|
@ -155,7 +155,7 @@ in some cases."
|
||||||
"Jump between the indentation column (first non-whitespace character) and the
|
"Jump between the indentation column (first non-whitespace character) and the
|
||||||
beginning of the line. The opposite of
|
beginning of the line. The opposite of
|
||||||
`doom/forward-to-last-non-comment-or-eol'."
|
`doom/forward-to-last-non-comment-or-eol'."
|
||||||
(interactive "d")
|
(interactive "^d")
|
||||||
(let ((pt (or point (point))))
|
(let ((pt (or point (point))))
|
||||||
(cl-destructuring-bind (bol bot _eot _eol)
|
(cl-destructuring-bind (bol bot _eot _eol)
|
||||||
(doom--bol-bot-eot-eol pt)
|
(doom--bol-bot-eot-eol pt)
|
||||||
|
@ -177,7 +177,7 @@ beginning of the line. The opposite of
|
||||||
(defun doom/forward-to-last-non-comment-or-eol (&optional point)
|
(defun doom/forward-to-last-non-comment-or-eol (&optional point)
|
||||||
"Jumps between the last non-blank, non-comment character in the line and the
|
"Jumps between the last non-blank, non-comment character in the line and the
|
||||||
true end of the line. The opposite of `doom/backward-to-bol-or-indent'."
|
true end of the line. The opposite of `doom/backward-to-bol-or-indent'."
|
||||||
(interactive "d")
|
(interactive "^d")
|
||||||
(let ((pt (or point (point))))
|
(let ((pt (or point (point))))
|
||||||
(cl-destructuring-bind (_bol _bot eot eol)
|
(cl-destructuring-bind (_bol _bot eot eol)
|
||||||
(doom--bol-bot-eot-eol pt)
|
(doom--bol-bot-eot-eol pt)
|
||||||
|
@ -260,15 +260,9 @@ opposite indentation style."
|
||||||
|
|
||||||
Respects `require-final-newline'."
|
Respects `require-final-newline'."
|
||||||
(interactive)
|
(interactive)
|
||||||
(goto-char (point-max))
|
(save-excursion
|
||||||
(skip-chars-backward " \t\n\v")
|
(goto-char (point-max))
|
||||||
(when (looking-at "\n\\(\n\\|\\'\\)")
|
(delete-blank-lines)))
|
||||||
(forward-char 1))
|
|
||||||
(when require-final-newline
|
|
||||||
(unless (bolp)
|
|
||||||
(insert "\n")))
|
|
||||||
(when (looking-at "\n+")
|
|
||||||
(replace-match "")))
|
|
||||||
|
|
||||||
;;;###autoload
|
;;;###autoload
|
||||||
(defun doom/dos2unix ()
|
(defun doom/dos2unix ()
|
||||||
|
|
|
@ -34,8 +34,9 @@ all themes. It will apply to all themes once they are loaded."
|
||||||
(defmacro custom-set-faces! (&rest specs)
|
(defmacro custom-set-faces! (&rest specs)
|
||||||
"Apply a list of face SPECS as user customizations.
|
"Apply a list of face SPECS as user customizations.
|
||||||
|
|
||||||
This is a drop-in replacement for `custom-set-face' that allows for a simplified
|
This is a convenience macro alternative to `custom-set-face' which allows for a
|
||||||
face format."
|
simplified face format, and takes care of load order issues, so you can use
|
||||||
|
doom-themes' API without worry."
|
||||||
(declare (indent defun))
|
(declare (indent defun))
|
||||||
`(custom-theme-set-faces! 'user ,@specs))
|
`(custom-theme-set-faces! 'user ,@specs))
|
||||||
|
|
||||||
|
|
|
@ -105,7 +105,7 @@ See `display-line-numbers' for what these values mean."
|
||||||
(_ (symbol-name next))))))
|
(_ (symbol-name next))))))
|
||||||
|
|
||||||
;;;###autoload
|
;;;###autoload
|
||||||
(defun doom/delete-frame ()
|
(defun doom/delete-frame-with-prompt ()
|
||||||
"Delete the current frame, but ask for confirmation if it isn't empty."
|
"Delete the current frame, but ask for confirmation if it isn't empty."
|
||||||
(interactive)
|
(interactive)
|
||||||
(if (cdr (frame-list))
|
(if (cdr (frame-list))
|
||||||
|
|
|
@ -90,7 +90,6 @@ one wants that.")
|
||||||
(defun doom-cli--byte-compile-file (file)
|
(defun doom-cli--byte-compile-file (file)
|
||||||
(condition-case-unless-debug e
|
(condition-case-unless-debug e
|
||||||
(let ((byte-compile-warnings (if doom-debug-mode byte-compile-warnings))
|
(let ((byte-compile-warnings (if doom-debug-mode byte-compile-warnings))
|
||||||
(byte-compile-dynamic t)
|
|
||||||
(byte-compile-dynamic-docstrings t))
|
(byte-compile-dynamic-docstrings t))
|
||||||
(when (byte-compile-file file)
|
(when (byte-compile-file file)
|
||||||
(unless doom-interactive-mode
|
(unless doom-interactive-mode
|
||||||
|
|
|
@ -123,11 +123,8 @@ in."
|
||||||
"both is rarely intentional; you should one or the other."))
|
"both is rarely intentional; you should one or the other."))
|
||||||
|
|
||||||
;; Check for fonts
|
;; Check for fonts
|
||||||
(if (not (fboundp 'find-font))
|
(if (not (executable-find "fc-list"))
|
||||||
(progn
|
(warn! "Warning: unable to detect fonts because fontconfig isn't installed")
|
||||||
(warn! "Warning: unable to detect font")
|
|
||||||
(explain! "The `find-font' function is missing. This could indicate the incorrect "
|
|
||||||
"version of Emacs is being used!"))
|
|
||||||
;; all-the-icons fonts
|
;; all-the-icons fonts
|
||||||
(when (and (pcase system-type
|
(when (and (pcase system-type
|
||||||
(`gnu/linux (concat (or (getenv "XDG_DATA_HOME")
|
(`gnu/linux (concat (or (getenv "XDG_DATA_HOME")
|
||||||
|
|
|
@ -9,10 +9,10 @@ them manually from your private config with the `doom-load-envvars-file'
|
||||||
function."))
|
function."))
|
||||||
"Creates or regenerates your envvars file.
|
"Creates or regenerates your envvars file.
|
||||||
|
|
||||||
The envvars file is created by scraping your (interactive) shell environment
|
The envvars file is created by scraping the current shell environment into
|
||||||
into newline-delimited KEY=VALUE pairs. Typically by running '$SHELL -ic env'
|
newline-delimited KEY=VALUE pairs. Typically by running '$SHELL -ic env' (or
|
||||||
(or '$SHELL -c set' on windows). Doom loads this file at startup (if it exists)
|
'$SHELL -c set' on windows). Doom loads this file at startup (if it exists) to
|
||||||
to ensure Emacs mirrors your shell environment (particularly to ensure PATH and
|
ensure Emacs mirrors your shell environment (particularly to ensure PATH and
|
||||||
SHELL are correctly set).
|
SHELL are correctly set).
|
||||||
|
|
||||||
This is useful in cases where you cannot guarantee that Emacs (or the daemon)
|
This is useful in cases where you cannot guarantee that Emacs (or the daemon)
|
||||||
|
@ -59,7 +59,7 @@ Why this over exec-path-from-shell?
|
||||||
(defvar doom-env-ignored-vars
|
(defvar doom-env-ignored-vars
|
||||||
'("^DBUS_SESSION_BUS_ADDRESS$"
|
'("^DBUS_SESSION_BUS_ADDRESS$"
|
||||||
"^GPG_AGENT_INFO$"
|
"^GPG_AGENT_INFO$"
|
||||||
"^GPG_TTY$"
|
"^\\(SSH\\|GPG\\)_TTY$"
|
||||||
"^HOME$"
|
"^HOME$"
|
||||||
"^PS1$"
|
"^PS1$"
|
||||||
"^PWD$"
|
"^PWD$"
|
||||||
|
@ -103,7 +103,6 @@ default, on Linux, this is '$SHELL -ic /usr/bin/env'. Variables in
|
||||||
(insert
|
(insert
|
||||||
(concat
|
(concat
|
||||||
"# -*- mode: sh -*-\n"
|
"# -*- mode: sh -*-\n"
|
||||||
(format "# Generated from a %s shell environent\n" shell-file-name)
|
|
||||||
"# ---------------------------------------------------------------------------\n"
|
"# ---------------------------------------------------------------------------\n"
|
||||||
"# This file was auto-generated by `doom env'. It contains a list of environment\n"
|
"# This file was auto-generated by `doom env'. It contains a list of environment\n"
|
||||||
"# variables scraped from your default shell (excluding variables blacklisted\n"
|
"# variables scraped from your default shell (excluding variables blacklisted\n"
|
||||||
|
|
|
@ -85,8 +85,13 @@ possible."
|
||||||
create-lockfiles nil
|
create-lockfiles nil
|
||||||
make-backup-files nil
|
make-backup-files nil
|
||||||
;; But have a place to store them in case we do use them...
|
;; But have a place to store them in case we do use them...
|
||||||
auto-save-list-file-name (concat doom-cache-dir "autosave")
|
;; auto-save-list-file-name (concat doom-cache-dir "autosave")
|
||||||
backup-directory-alist `(("." . ,(concat doom-cache-dir "backup/"))))
|
auto-save-list-file-prefix (concat doom-cache-dir "autosave/")
|
||||||
|
auto-save-file-name-transforms `((".*" ,auto-save-list-file-prefix t))
|
||||||
|
backup-directory-alist `((".*" . ,(concat doom-cache-dir "backup/"))))
|
||||||
|
|
||||||
|
(after! tramp
|
||||||
|
(add-to-list 'backup-directory-alist (cons tramp-file-name-regexp nil)))
|
||||||
|
|
||||||
(add-hook! 'after-save-hook
|
(add-hook! 'after-save-hook
|
||||||
(defun doom-guess-mode-h ()
|
(defun doom-guess-mode-h ()
|
||||||
|
@ -101,45 +106,67 @@ possible."
|
||||||
;;
|
;;
|
||||||
;;; Formatting
|
;;; Formatting
|
||||||
|
|
||||||
;; Indentation
|
;; Favor spaces over tabs. Pls dun h8, but I think spaces (and 4 of them) is a
|
||||||
(setq-default tab-width 4
|
;; more consistent default than 8-space tabs. It can be changed on a per-mode
|
||||||
tab-always-indent t
|
;; basis anyway (and is, where tabs are the canonical style, like go-mode).
|
||||||
indent-tabs-mode nil
|
(setq-default indent-tabs-mode nil
|
||||||
fill-column 80)
|
tab-width 4)
|
||||||
|
|
||||||
;; Word wrapping
|
;; Make `tabify' and `untabify' only affect indentation. Not tabs/spaces in the
|
||||||
(setq-default word-wrap t
|
;; middle of a line.
|
||||||
truncate-lines t
|
(setq tabify-regexp "^\t* [ \t]+")
|
||||||
truncate-partial-width-windows nil)
|
|
||||||
|
|
||||||
(setq sentence-end-double-space nil
|
;; An archaic default in the age of widescreen 4k displays? I disagree. We still
|
||||||
delete-trailing-lines nil
|
;; frequently split our terminals and editor frames, or have them side-by-side,
|
||||||
require-final-newline t
|
;; using up more of that newly available horizontal real-estate.
|
||||||
tabify-regexp "^\t* [ \t]+") ; for :retab
|
(setq-default fill-column 80)
|
||||||
|
|
||||||
;; Favor hard-wrapping in text modes
|
;; Continue wrapped words at whitespace, rather than in the middle of a word.
|
||||||
(add-hook 'text-mode-hook #'auto-fill-mode)
|
(setq-default word-wrap t)
|
||||||
|
;; ...but don't do any wrapping by default. It's expensive. Enable
|
||||||
|
;; `visual-line-mode' if you want soft line-wrapping. `auto-fill-mode' for hard
|
||||||
|
;; line-wrapping.
|
||||||
|
(setq-default truncate-lines t)
|
||||||
|
;; If enabled (and `truncate-lines' was disabled), soft wrapping no longer
|
||||||
|
;; occurs when that window is less than `truncate-partial-width-windows'
|
||||||
|
;; characters wide. We don't need this, and it's extra work for Emacs otherwise,
|
||||||
|
;; so off it goes.
|
||||||
|
(setq truncate-partial-width-windows nil)
|
||||||
|
|
||||||
|
;; This was a widespread practice in the days of typewriters. I actually prefer
|
||||||
|
;; it when writing prose with monospace fonts, but it is obsolete otherwise.
|
||||||
|
(setq sentence-end-double-space nil)
|
||||||
|
|
||||||
|
;; The POSIX standard defines a line is "a sequence of zero or more non-newline
|
||||||
|
;; characters followed by a terminating newline", so files should end in a
|
||||||
|
;; newline. Windows doesn't respect this (because it's Windows), but we should,
|
||||||
|
;; since programmers' tools tend to be POSIX compliant.
|
||||||
|
(setq require-final-newline t)
|
||||||
|
|
||||||
|
;; Default to soft line-wrapping in text modes. It is more sensibile for text
|
||||||
|
;; modes, even if hard wrapping is more performant.
|
||||||
|
(add-hook 'text-mode-hook #'visual-line-mode)
|
||||||
|
|
||||||
|
|
||||||
;;
|
;;
|
||||||
;;; Clipboard / kill-ring
|
;;; Clipboard / kill-ring
|
||||||
|
|
||||||
;; Eliminate duplicates in the kill ring. That is, if you kill the same thing
|
;; Cull duplicates in the kill ring to reduce bloat and make the kill ring
|
||||||
;; twice, you won't have to use M-y twice to get past it to older entries in the
|
;; easier to peruse (with `counsel-yank-pop' or `helm-show-kill-ring'.
|
||||||
;; kill ring.
|
|
||||||
(setq kill-do-not-save-duplicates t)
|
(setq kill-do-not-save-duplicates t)
|
||||||
|
|
||||||
;;
|
;; Allow UTF or composed text from the clipboard, even in the terminal or on
|
||||||
|
;; non-X systems (like Windows or macOS), where only `STRING' is used.
|
||||||
(setq x-select-request-type '(UTF8_STRING COMPOUND_TEXT TEXT STRING))
|
(setq x-select-request-type '(UTF8_STRING COMPOUND_TEXT TEXT STRING))
|
||||||
|
|
||||||
;; Fixes the clipboard in tty Emacs by piping clipboard I/O through xclip, xsel,
|
;; Fixes the clipboard in tty Emacs by piping clipboard I/O through xclip, xsel,
|
||||||
;; pb{copy,paste}, wl-copy, termux-clipboard-get, or getclip (cygwin).
|
;; pb{copy,paste}, wl-copy, termux-clipboard-get, or getclip (cygwin); depending
|
||||||
|
;; on what is available.
|
||||||
(unless IS-WINDOWS
|
(unless IS-WINDOWS
|
||||||
(add-hook! 'tty-setup-hook
|
(add-hook! 'tty-setup-hook
|
||||||
(defun doom-init-clipboard-in-tty-emacs-h ()
|
(defun doom-init-clipboard-in-tty-emacs-h ()
|
||||||
(and (not (getenv "SSH_CONNECTION"))
|
(and (require 'clipetty nil t)
|
||||||
(require 'xclip nil t)
|
(global-clipetty-mode +1)))))
|
||||||
(xclip-mode +1)))))
|
|
||||||
|
|
||||||
|
|
||||||
;;
|
;;
|
||||||
|
@ -147,7 +174,8 @@ possible."
|
||||||
|
|
||||||
(push '("/LICENSE\\'" . text-mode) auto-mode-alist)
|
(push '("/LICENSE\\'" . text-mode) auto-mode-alist)
|
||||||
(push '("\\.log\\'" . text-mode) auto-mode-alist)
|
(push '("\\.log\\'" . text-mode) auto-mode-alist)
|
||||||
(push '("\\.env\\'" . sh-mode) auto-mode-alist)
|
(push '("rc\\'" . conf-mode) auto-mode-alist)
|
||||||
|
(push '("\\.\\(?:hex\\|nes\\)\\'" . hexl-mode) auto-mode-alist)
|
||||||
|
|
||||||
|
|
||||||
;;
|
;;
|
||||||
|
@ -166,13 +194,13 @@ possible."
|
||||||
;; Only prompts for confirmation when buffer is unsaved.
|
;; Only prompts for confirmation when buffer is unsaved.
|
||||||
revert-without-query (list "."))
|
revert-without-query (list "."))
|
||||||
|
|
||||||
;; Instead of using `auto-revert-mode' or `global-auto-revert-mode', we employ
|
;; Instead of `auto-revert-mode' or `global-auto-revert-mode', we lazily auto
|
||||||
;; lazy auto reverting on `focus-in-hook' and `doom-switch-buffer-hook'.
|
;; revert; when we save a file or switch buffers/windows (or focus on Emacs).
|
||||||
;;
|
;;
|
||||||
;; This is because autorevert abuses the heck out of inotify handles which can
|
;; Autorevert normally abuses the heck out of inotify handles which can grind
|
||||||
;; grind Emacs to a halt if you do expensive IO (outside of Emacs) on the
|
;; Emacs to a halt if you do expensive IO (outside of Emacs) on the files you
|
||||||
;; files you have open (like compression). We only really need to revert
|
;; have open (like compression). The only alternative is aggressive polling,
|
||||||
;; changes when we switch to a buffer or when we focus the Emacs frame.
|
;; which is unreliable and expensive with a lot of buffers open.
|
||||||
(defun doom-auto-revert-buffer-h ()
|
(defun doom-auto-revert-buffer-h ()
|
||||||
"Auto revert current buffer, if necessary."
|
"Auto revert current buffer, if necessary."
|
||||||
(unless (or auto-revert-mode (active-minibuffer-window))
|
(unless (or auto-revert-mode (active-minibuffer-window))
|
||||||
|
@ -197,9 +225,9 @@ possible."
|
||||||
(file-truename file)
|
(file-truename file)
|
||||||
file))
|
file))
|
||||||
(setq recentf-filename-handlers
|
(setq recentf-filename-handlers
|
||||||
'(substring-no-properties
|
'(substring-no-properties ; strip out lingering text properties
|
||||||
doom--recent-file-truename
|
doom--recent-file-truename ; resolve symlinks of local files
|
||||||
abbreviate-file-name)
|
abbreviate-file-name) ; replace $HOME with ~
|
||||||
recentf-save-file (concat doom-cache-dir "recentf")
|
recentf-save-file (concat doom-cache-dir "recentf")
|
||||||
recentf-auto-cleanup 'never
|
recentf-auto-cleanup 'never
|
||||||
recentf-max-menu-items 0
|
recentf-max-menu-items 0
|
||||||
|
@ -265,8 +293,7 @@ possible."
|
||||||
`pp' can be expensive for longer lists, and there's no reason to prettify cache
|
`pp' can be expensive for longer lists, and there's no reason to prettify cache
|
||||||
files, so we replace calls to `pp' with the much faster `prin1'."
|
files, so we replace calls to `pp' with the much faster `prin1'."
|
||||||
:around #'save-place-alist-to-file
|
:around #'save-place-alist-to-file
|
||||||
(cl-letf (((symbol-function #'pp)
|
(cl-letf (((symbol-function #'pp) #'prin1))
|
||||||
(symbol-function #'prin1)))
|
|
||||||
(funcall orig-fn)))
|
(funcall orig-fn)))
|
||||||
|
|
||||||
(save-place-mode +1))
|
(save-place-mode +1))
|
||||||
|
@ -340,19 +367,18 @@ files, so we replace calls to `pp' with the much faster `prin1'."
|
||||||
(use-package! dtrt-indent
|
(use-package! dtrt-indent
|
||||||
;; Automatic detection of indent settings
|
;; Automatic detection of indent settings
|
||||||
:when doom-interactive-mode
|
:when doom-interactive-mode
|
||||||
:defer t
|
:hook ((change-major-mode-after-body read-only-mode) . doom-detect-indentation-h)
|
||||||
:init
|
|
||||||
(add-hook! '(change-major-mode-after-body-hook read-only-mode-hook)
|
|
||||||
(defun doom-detect-indentation-h ()
|
|
||||||
(unless (or (not after-init-time)
|
|
||||||
doom-inhibit-indent-detection
|
|
||||||
doom-large-file-p
|
|
||||||
(memq major-mode doom-detect-indentation-excluded-modes)
|
|
||||||
(member (substring (buffer-name) 0 1) '(" " "*")))
|
|
||||||
;; Don't display messages in the echo area, but still log them
|
|
||||||
(let ((inhibit-message (not doom-debug-mode)))
|
|
||||||
(dtrt-indent-mode +1)))))
|
|
||||||
:config
|
:config
|
||||||
|
(defun doom-detect-indentation-h ()
|
||||||
|
(unless (or (not after-init-time)
|
||||||
|
doom-inhibit-indent-detection
|
||||||
|
doom-large-file-p
|
||||||
|
(memq major-mode doom-detect-indentation-excluded-modes)
|
||||||
|
(member (substring (buffer-name) 0 1) '(" " "*")))
|
||||||
|
;; Don't display messages in the echo area, but still log them
|
||||||
|
(let ((inhibit-message (not doom-debug-mode)))
|
||||||
|
(dtrt-indent-mode +1))))
|
||||||
|
|
||||||
;; Enable dtrt-indent even in smie modes so that it can update `tab-width',
|
;; Enable dtrt-indent even in smie modes so that it can update `tab-width',
|
||||||
;; `standard-indent' and `evil-shift-width' there as well.
|
;; `standard-indent' and `evil-shift-width' there as well.
|
||||||
(setq dtrt-indent-run-after-smie t)
|
(setq dtrt-indent-run-after-smie t)
|
||||||
|
@ -536,51 +562,6 @@ files, so we replace calls to `pp' with the much faster `prin1'."
|
||||||
(setq so-long-predicate #'doom-buffer-has-long-lines-p))
|
(setq so-long-predicate #'doom-buffer-has-long-lines-p))
|
||||||
|
|
||||||
|
|
||||||
(use-package! undo-tree
|
|
||||||
;; Branching & persistent undo
|
|
||||||
:after-call doom-switch-buffer-hook after-find-file
|
|
||||||
:config
|
|
||||||
(setq undo-tree-visualizer-diff t
|
|
||||||
undo-tree-auto-save-history t
|
|
||||||
undo-tree-enable-undo-in-region t
|
|
||||||
;; Increase undo-limits by a factor of ten to avoid emacs prematurely
|
|
||||||
;; truncating the undo history and corrupting the tree. See
|
|
||||||
;; https://github.com/syl20bnr/spacemacs/issues/12110
|
|
||||||
undo-limit 800000
|
|
||||||
undo-strong-limit 12000000
|
|
||||||
undo-outer-limit 120000000
|
|
||||||
undo-tree-history-directory-alist
|
|
||||||
`(("." . ,(concat doom-cache-dir "undo-tree-hist/"))))
|
|
||||||
|
|
||||||
;; Compress undo-tree history files with zstd, if available. File size isn't
|
|
||||||
;; the (only) concern here: the file IO barrier is slow for Emacs to cross;
|
|
||||||
;; reading a tiny file and piping it in-memory through zstd is *slightly*
|
|
||||||
;; faster than Emacs reading the entire undo-tree file from the get go (on
|
|
||||||
;; SSDs). Whether or not that's true in practice, we still enjoy zstd's ~80%
|
|
||||||
;; file savings (these files add up over time and zstd is so incredibly fast).
|
|
||||||
(when (executable-find "zstd")
|
|
||||||
(defadvice! doom--undo-tree-make-history-save-file-name-a (file)
|
|
||||||
:filter-return #'undo-tree-make-history-save-file-name
|
|
||||||
(concat file ".zst")))
|
|
||||||
|
|
||||||
;; Strip text properties from undo-tree data to stave off bloat. File size
|
|
||||||
;; isn't the concern here; undo cache files bloat easily, which can cause
|
|
||||||
;; freezing, crashes, GC-induced stuttering or delays when opening files.
|
|
||||||
(defadvice! doom--undo-tree-strip-text-properties-a (&rest _)
|
|
||||||
:before #'undo-list-transfer-to-tree
|
|
||||||
(dolist (item buffer-undo-list)
|
|
||||||
(and (consp item)
|
|
||||||
(stringp (car item))
|
|
||||||
(setcar item (substring-no-properties (car item))))))
|
|
||||||
|
|
||||||
;; Undo-tree is too chatty about saving its history files. This doesn't
|
|
||||||
;; totally suppress it logging to *Messages*, it only stops it from appearing
|
|
||||||
;; in the echo-area.
|
|
||||||
(advice-add #'undo-tree-save-history :around #'doom-shut-up-a)
|
|
||||||
|
|
||||||
(global-undo-tree-mode +1))
|
|
||||||
|
|
||||||
|
|
||||||
(use-package! ws-butler
|
(use-package! ws-butler
|
||||||
;; a less intrusive `delete-trailing-whitespaces' on save
|
;; a less intrusive `delete-trailing-whitespaces' on save
|
||||||
:after-call after-find-file
|
:after-call after-find-file
|
||||||
|
|
|
@ -77,7 +77,8 @@ all hooks after it are ignored.")
|
||||||
:init
|
:init
|
||||||
;; Convenience aliases
|
;; Convenience aliases
|
||||||
(defalias 'define-key! #'general-def)
|
(defalias 'define-key! #'general-def)
|
||||||
(defalias 'unmap! #'general-unbind))
|
(defalias 'undefine-key! #'general-unbind))
|
||||||
|
|
||||||
|
|
||||||
;; HACK `map!' uses this instead of `define-leader-key!' because it consumes
|
;; HACK `map!' uses this instead of `define-leader-key!' because it consumes
|
||||||
;; 20-30% more startup time, so we reimplement it ourselves.
|
;; 20-30% more startup time, so we reimplement it ourselves.
|
||||||
|
@ -108,8 +109,8 @@ all hooks after it are ignored.")
|
||||||
(general--concat t doom-leader-key ,key)
|
(general--concat t doom-leader-key ,key)
|
||||||
,desc))))))))
|
,desc))))))))
|
||||||
(macroexp-progn
|
(macroexp-progn
|
||||||
(cons `(after! which-key ,@(nreverse wkforms))
|
(append (and wkforms `((after! which-key ,@(nreverse wkforms))))
|
||||||
(nreverse forms)))))
|
(nreverse forms)))))
|
||||||
|
|
||||||
(defmacro define-leader-key! (&rest args)
|
(defmacro define-leader-key! (&rest args)
|
||||||
"Define <leader> keys.
|
"Define <leader> keys.
|
||||||
|
|
|
@ -93,7 +93,7 @@ Accepts the same arguments as `message'."
|
||||||
ARGS is a list of the last N arguments to pass to FUN. The result is a new
|
ARGS is a list of the last N arguments to pass to FUN. The result is a new
|
||||||
function which does the same as FUN, except that the last N arguments are fixed
|
function which does the same as FUN, except that the last N arguments are fixed
|
||||||
at the values with which this function was called."
|
at the values with which this function was called."
|
||||||
(declare (pure t) (side-effect-free t))
|
(declare (side-effect-free t))
|
||||||
(lambda (&rest pre-args)
|
(lambda (&rest pre-args)
|
||||||
(apply fn (append pre-args args))))
|
(apply fn (append pre-args args))))
|
||||||
|
|
||||||
|
|
|
@ -142,10 +142,8 @@ following properties:
|
||||||
:path [STRING] path to category root directory
|
:path [STRING] path to category root directory
|
||||||
|
|
||||||
Example:
|
Example:
|
||||||
(doom-module-set :lang 'haskell :flags '(+intero))"
|
(doom-module-set :lang 'haskell :flags '(+dante))"
|
||||||
(puthash (cons category module)
|
(puthash (cons category module) plist doom-modules))
|
||||||
plist
|
|
||||||
doom-modules))
|
|
||||||
|
|
||||||
(defun doom-module-path (category module &optional file)
|
(defun doom-module-path (category module &optional file)
|
||||||
"Like `expand-file-name', but expands FILE relative to CATEGORY (keywordp) and
|
"Like `expand-file-name', but expands FILE relative to CATEGORY (keywordp) and
|
||||||
|
@ -483,39 +481,6 @@ WARNINGS:
|
||||||
(lambda () ,@body)
|
(lambda () ,@body)
|
||||||
'append)))
|
'append)))
|
||||||
|
|
||||||
(defmacro require! (category module &rest flags)
|
|
||||||
"Loads the CATEGORY MODULE module with FLAGS.
|
|
||||||
|
|
||||||
CATEGORY is a keyword, MODULE is a symbol and FLAGS are symbols.
|
|
||||||
|
|
||||||
(require! :lang php +lsp)
|
|
||||||
|
|
||||||
This is for testing and internal use. This is not the correct way to enable a
|
|
||||||
module."
|
|
||||||
`(let ((doom-modules (or ,doom-modules (doom-modules)))
|
|
||||||
(module-path (doom-module-locate-path ,category ',module)))
|
|
||||||
(doom-module-set
|
|
||||||
,category ',module
|
|
||||||
(let ((plist (doom-module-get ,category ',module)))
|
|
||||||
,(when flags
|
|
||||||
`(plist-put plist :flags `,flags))
|
|
||||||
(unless (plist-member plist :path)
|
|
||||||
(plist-put plist :path ,(doom-module-locate-path category module)))
|
|
||||||
plist))
|
|
||||||
(if (directory-name-p module-path)
|
|
||||||
(condition-case-unless-debug ex
|
|
||||||
(let ((doom--current-module ',(cons category module))
|
|
||||||
(doom--current-flags ',flags))
|
|
||||||
(load! "init" module-path :noerror)
|
|
||||||
(load! "config" module-path :noerror))
|
|
||||||
('error
|
|
||||||
(lwarn 'doom-modules :error
|
|
||||||
"%s in '%s %s' -> %s"
|
|
||||||
(car ex) ,category ',module
|
|
||||||
(error-message-string ex))))
|
|
||||||
(warn 'doom-modules :warning "Couldn't find module '%s %s'"
|
|
||||||
,category ',module))))
|
|
||||||
|
|
||||||
(defmacro featurep! (category &optional module flag)
|
(defmacro featurep! (category &optional module flag)
|
||||||
"Returns t if CATEGORY MODULE is enabled.
|
"Returns t if CATEGORY MODULE is enabled.
|
||||||
|
|
||||||
|
@ -540,16 +505,5 @@ CATEGORY and MODULE can be omitted When this macro is used from inside a module
|
||||||
(memq category (doom-module-get (car module) (cdr module) :flags)))))
|
(memq category (doom-module-get (car module) (cdr module) :flags)))))
|
||||||
t))
|
t))
|
||||||
|
|
||||||
;; DEPRECATED
|
|
||||||
(defmacro def-package! (&rest args)
|
|
||||||
(message "`def-package!' was renamed to `use-package!'; use that instead.")
|
|
||||||
`(use-package! ,@args))
|
|
||||||
(make-obsolete 'def-package! 'use-package! "2.0.9")
|
|
||||||
|
|
||||||
(defmacro def-package-hook! (&rest args)
|
|
||||||
(message "`def-package-hook!' was renamed to `use-package-hook!'; use that instead.")
|
|
||||||
`(use-package-hook! ,@args))
|
|
||||||
(make-obsolete 'def-package-hook! 'use-package-hook! "2.0.9")
|
|
||||||
|
|
||||||
(provide 'core-modules)
|
(provide 'core-modules)
|
||||||
;;; core-modules.el ends here
|
;;; core-modules.el ends here
|
||||||
|
|
|
@ -1,23 +1,21 @@
|
||||||
;;; core/core-packages.el -*- lexical-binding: t; -*-
|
;;; core/core-packages.el -*- lexical-binding: t; -*-
|
||||||
|
|
||||||
;; Emacs package management is opinionated, and so is Doom. Doom uses `straight'
|
;; Emacs package management is opinionated, and so is Doom. Doom uses `straight'
|
||||||
;; to create a declarative, lazy-loaded and optionally rolling-release package
|
;; to create a declarative, lazy-loaded and (nominally) reproducible package
|
||||||
;; management system. We use `straight' over `package' because the latter is
|
;; management system. We use `straight' over `package' because the latter is
|
||||||
;; tempermental. ELPA sources suffer downtime occasionally, and often fail at
|
;; tempermental. ELPA sources suffer downtime occasionally and often fail to
|
||||||
;; building some packages when GNU Tar is unavailable (e.g. MacOS users start
|
;; build packages when GNU Tar is unavailable (e.g. MacOS users start with BSD
|
||||||
;; with BSD tar). There are also known gnutls errors in the current stable
|
;; tar). Known gnutls errors plague the current stable release of Emacs (26.x)
|
||||||
;; release of Emacs (26.x) which bork TLS handshakes with ELPA repos (mainly
|
;; which bork TLS handshakes with ELPA repos (mainly gnu.elpa.org). See
|
||||||
;; gnu.elpa.org). See https://debbugs.gnu.org/cgi/bugreport.cgi?bug=3434.
|
;; https://debbugs.gnu.org/cgi/bugreport.cgi?bug=3434.
|
||||||
;;
|
;;
|
||||||
;; What's worse, you can only get the latest version of packages through ELPA.
|
;; What's worse, you can only get the latest version of packages through ELPA.
|
||||||
;; In an ecosystem that is constantly changing, this is more frustrating than
|
;; In an ecosystem that is constantly changing, this is more frustrating than
|
||||||
;; convenient. Straight (and Doom) can do rolling release, but it is optional
|
;; convenient. Straight (and Doom) can do rolling release, but it is opt-in.
|
||||||
;; (and will eventually be opt-in).
|
|
||||||
;;
|
;;
|
||||||
;; ANyhow, interacting with this package management system is done through the
|
;; Interacting with this package management system is done through Doom's
|
||||||
;; bin/doom script included with Doom Emacs. You'll find more about it by
|
;; bin/doom script. Find out more about it by running 'doom help' (I highly
|
||||||
;; running 'doom help' (I highly recommend you add it to your PATH), but here
|
;; recommend you add the script to your PATH). Here are some highlights:
|
||||||
;; are the highlights:
|
|
||||||
;;
|
;;
|
||||||
;; + `bin/doom install`: a wizard that guides you through setting up Doom and
|
;; + `bin/doom install`: a wizard that guides you through setting up Doom and
|
||||||
;; your private config for the first time.
|
;; your private config for the first time.
|
||||||
|
@ -83,35 +81,36 @@ missing) and shouldn't be deleted.")
|
||||||
("melpa" . ,(concat proto "://melpa.org/packages/"))
|
("melpa" . ,(concat proto "://melpa.org/packages/"))
|
||||||
("org" . ,(concat proto "://orgmode.org/elpa/")))))
|
("org" . ,(concat proto "://orgmode.org/elpa/")))))
|
||||||
|
|
||||||
|
;; package.el has no business modifying the user's init.el
|
||||||
(advice-add #'package--ensure-init-file :override #'ignore)
|
(advice-add #'package--ensure-init-file :override #'ignore)
|
||||||
|
|
||||||
;; Don't save `package-selected-packages' to `custom-file'
|
;; Refresh package.el the first time you call `package-install', so it can still
|
||||||
(defadvice! doom--package-inhibit-custom-file-a (&optional value)
|
;; be used (e.g. to temporarily test packages). Remember to run 'doom sync' to
|
||||||
:override #'package--save-selected-packages
|
;; purge them; they can conflict with packages installed via straight!
|
||||||
(if value (setq package-selected-packages value)))
|
|
||||||
|
|
||||||
;; Refresh package.el the first time you call `package-install'
|
|
||||||
(add-transient-hook! 'package-install (package-refresh-contents))
|
(add-transient-hook! 'package-install (package-refresh-contents))
|
||||||
|
|
||||||
;;; straight
|
|
||||||
|
;;
|
||||||
|
;;; Straight
|
||||||
|
|
||||||
(setq straight-base-dir doom-local-dir
|
(setq straight-base-dir doom-local-dir
|
||||||
straight-repository-branch "develop"
|
straight-repository-branch "master"
|
||||||
straight-cache-autoloads nil ; we already do this, and better.
|
straight-cache-autoloads nil ; we already do this, and better.
|
||||||
;; Doom doesn't encourage you to modify packages in place. Disabling this
|
;; Doom doesn't encourage you to modify packages in place. Disabling this
|
||||||
;; makes 'doom refresh' instant (once everything set up), which is much
|
;; makes 'doom sync' instant (once everything set up), which is much nicer
|
||||||
;; nicer UX than the several seconds modification checks.
|
;; UX than the several seconds modification checks.
|
||||||
straight-check-for-modifications nil
|
straight-check-for-modifications nil
|
||||||
;; We handle package.el ourselves (and a little more comprehensively)
|
;; We handle package.el ourselves (and a little more comprehensively)
|
||||||
straight-enable-package-integration nil
|
straight-enable-package-integration nil
|
||||||
;; Before switching to straight, `doom-local-dir' would average out at
|
;; Before switching to straight, `doom-local-dir' would average out at
|
||||||
;; around 100mb with half Doom's modules at ~230 packages. Afterwards, at
|
;; around 100mb with half Doom's modules at ~230 packages. Afterwards, at
|
||||||
;; around 1gb. With shallow cloning, that is reduced to ~400mb. This
|
;; around 1gb. With shallow cloning, that is reduced to ~400mb. This has
|
||||||
;; imposes an issue with packages that require their git history for
|
;; no affect on packages that are pinned, however (run 'doom purge' to
|
||||||
;; certain things to work (like magit and org), but we can deal with that
|
;; compact those after-the-fact). Some packages break when shallow cloned
|
||||||
;; when we cross that bridge.
|
;; (like magit and org), but we'll deal with that elsewhere.
|
||||||
straight-vc-git-default-clone-depth 1
|
straight-vc-git-default-clone-depth 1
|
||||||
;; Prefix declarations are unneeded bulk added to our autoloads file. Best
|
;; Prefix declarations are unneeded bulk added to our autoloads file. Best
|
||||||
;; we just don't have to deal with them at all.
|
;; we don't have to deal with them at all.
|
||||||
autoload-compute-prefixes nil
|
autoload-compute-prefixes nil
|
||||||
;; We handle it ourselves
|
;; We handle it ourselves
|
||||||
straight-fix-org nil)
|
straight-fix-org nil)
|
||||||
|
@ -119,7 +118,7 @@ missing) and shouldn't be deleted.")
|
||||||
(defadvice! doom--read-pinned-packages-a (orig-fn &rest args)
|
(defadvice! doom--read-pinned-packages-a (orig-fn &rest args)
|
||||||
"Read from `doom-pinned-packages' on top of straight's lockfiles."
|
"Read from `doom-pinned-packages' on top of straight's lockfiles."
|
||||||
:around #'straight--lockfile-read-all
|
:around #'straight--lockfile-read-all
|
||||||
(append (apply orig-fn args)
|
(append (apply orig-fn args) ; lockfiles still take priority
|
||||||
(doom-package-pinned-list)))
|
(doom-package-pinned-list)))
|
||||||
|
|
||||||
|
|
||||||
|
@ -260,7 +259,7 @@ elsewhere."
|
||||||
(doplist! ((prop val) (list ,@plist) plist)
|
(doplist! ((prop val) (list ,@plist) plist)
|
||||||
(unless (null val)
|
(unless (null val)
|
||||||
(plist-put! plist prop val)))
|
(plist-put! plist prop val)))
|
||||||
;; Some basic key validation; error if you're not using a valid key
|
;; Some basic key validation; throws an error on invalid properties
|
||||||
(condition-case e
|
(condition-case e
|
||||||
(when-let (recipe (plist-get plist :recipe))
|
(when-let (recipe (plist-get plist :recipe))
|
||||||
(cl-destructuring-bind
|
(cl-destructuring-bind
|
||||||
|
@ -286,8 +285,8 @@ elsewhere."
|
||||||
"A convenience macro for disabling packages in bulk.
|
"A convenience macro for disabling packages in bulk.
|
||||||
Only use this macro in a module's (or your private) packages.el file."
|
Only use this macro in a module's (or your private) packages.el file."
|
||||||
(macroexp-progn
|
(macroexp-progn
|
||||||
(cl-loop for p in packages
|
(mapcar (lambda (p) `(package! ,p :disable t))
|
||||||
collect `(package! ,p :disable t))))
|
packages)))
|
||||||
|
|
||||||
(defmacro unpin! (&rest targets)
|
(defmacro unpin! (&rest targets)
|
||||||
"Unpin packages in TARGETS.
|
"Unpin packages in TARGETS.
|
||||||
|
|
|
@ -15,9 +15,6 @@ Emacs.")
|
||||||
"fd")
|
"fd")
|
||||||
"name of `fd-find' executable binary")
|
"name of `fd-find' executable binary")
|
||||||
|
|
||||||
(defvar doom-projectile-cache-timer-file (concat doom-cache-dir "projectile.timers")
|
|
||||||
"Where to save project file cache timers.")
|
|
||||||
|
|
||||||
|
|
||||||
;;
|
;;
|
||||||
;;; Packages
|
;;; Packages
|
||||||
|
@ -45,18 +42,18 @@ Emacs.")
|
||||||
|
|
||||||
;; Projectile runs four functions to determine the root (in this order):
|
;; Projectile runs four functions to determine the root (in this order):
|
||||||
;;
|
;;
|
||||||
;; + `projectile-root-local' -> consults the `projectile-project-root'
|
;; + `projectile-root-local' -> checks the `projectile-project-root' variable
|
||||||
;; variable for an explicit path.
|
;; for an explicit path.
|
||||||
;; + `projectile-root-bottom-up' -> consults
|
;; + `projectile-root-bottom-up' -> searches from / to your current directory
|
||||||
;; `projectile-project-root-files-bottom-up'; searches from / to your
|
;; for the paths listed in `projectile-project-root-files-bottom-up'. This
|
||||||
;; current directory for certain files (including .project and .git)
|
;; includes .git and .project
|
||||||
;; + `projectile-root-top-down' -> consults `projectile-project-root-files';
|
;; + `projectile-root-top-down' -> searches from the current directory down to
|
||||||
;; searches from the current directory down to / for certain project
|
;; / the paths listed in `projectile-root-files', like package.json,
|
||||||
;; markers, like package.json, setup.py, or Cargo.toml
|
;; setup.py, or Cargo.toml
|
||||||
;; + `projectile-root-top-down-recurring' -> consults
|
;; + `projectile-root-top-down-recurring' -> searches from the current
|
||||||
;; `projectile-project-root-files-top-down-recurring'; e.g. searches from
|
;; directory down to / for a directory that has one of
|
||||||
;; the current directory down to / for a directory that has Makefile but
|
;; `projectile-project-root-files-top-down-recurring' but doesn't have a
|
||||||
;; doesn't have a parent with one of those files.
|
;; parent directory with the same file.
|
||||||
;;
|
;;
|
||||||
;; In the interest of performance, we reduce the number of project root marker
|
;; In the interest of performance, we reduce the number of project root marker
|
||||||
;; files/directories projectile searches for when resolving the project root.
|
;; files/directories projectile searches for when resolving the project root.
|
||||||
|
@ -75,6 +72,14 @@ Emacs.")
|
||||||
|
|
||||||
(push (abbreviate-file-name doom-local-dir) projectile-globally-ignored-directories)
|
(push (abbreviate-file-name doom-local-dir) projectile-globally-ignored-directories)
|
||||||
|
|
||||||
|
;; Override projectile's dirconfig file '.projectile' with doom's project marker '.project'.
|
||||||
|
(defadvice! doom--projectile-dirconfig-file-a ()
|
||||||
|
:override #'projectile-dirconfig-file
|
||||||
|
(cond
|
||||||
|
;; Prefers '.projectile' to maintain compatibility with existing projects.
|
||||||
|
((file-exists-p! (or ".projectile" ".project") (projectile-project-root)))
|
||||||
|
((expand-file-name ".project" (projectile-project-root)))))
|
||||||
|
|
||||||
;; Disable commands that won't work, as is, and that Doom already provides a
|
;; Disable commands that won't work, as is, and that Doom already provides a
|
||||||
;; better alternative for.
|
;; better alternative for.
|
||||||
(put 'projectile-ag 'disabled "Use +{ivy,helm}/project-search instead")
|
(put 'projectile-ag 'disabled "Use +{ivy,helm}/project-search instead")
|
||||||
|
|
109
core/core-ui.el
109
core/core-ui.el
|
@ -138,10 +138,11 @@ size.")
|
||||||
e.g. If you indent with spaces by default, tabs will be highlighted. If you
|
e.g. If you indent with spaces by default, tabs will be highlighted. If you
|
||||||
indent with tabs, spaces at BOL are highlighted.
|
indent with tabs, spaces at BOL are highlighted.
|
||||||
|
|
||||||
Does nothing if `whitespace-mode' is already active or the current buffer is
|
Does nothing if `whitespace-mode' or 'global-whitespace-mode' is already
|
||||||
read-only or not file-visiting."
|
active or if the current buffer is read-only or not file-visiting."
|
||||||
(unless (or (eq major-mode 'fundamental-mode)
|
(unless (or (eq major-mode 'fundamental-mode)
|
||||||
buffer-read-only
|
buffer-read-only
|
||||||
|
(bound-and-true-p global-whitespace-mode)
|
||||||
(null buffer-file-name))
|
(null buffer-file-name))
|
||||||
(require 'whitespace)
|
(require 'whitespace)
|
||||||
(set (make-local-variable 'whitespace-style)
|
(set (make-local-variable 'whitespace-style)
|
||||||
|
@ -159,6 +160,10 @@ read-only or not file-visiting."
|
||||||
;; Simpler confirmation prompt when killing Emacs
|
;; Simpler confirmation prompt when killing Emacs
|
||||||
(setq confirm-kill-emacs #'doom-quit-p)
|
(setq confirm-kill-emacs #'doom-quit-p)
|
||||||
|
|
||||||
|
;; Don't prompt for confirmation when we create a new file or buffer (assume the
|
||||||
|
;; user knows what they're doing).
|
||||||
|
(setq confirm-nonexistent-file-or-buffer nil)
|
||||||
|
|
||||||
(setq uniquify-buffer-name-style 'forward
|
(setq uniquify-buffer-name-style 'forward
|
||||||
;; no beeping or blinking please
|
;; no beeping or blinking please
|
||||||
ring-bell-function #'ignore
|
ring-bell-function #'ignore
|
||||||
|
@ -203,12 +208,18 @@ read-only or not file-visiting."
|
||||||
;;
|
;;
|
||||||
;;; Cursor
|
;;; Cursor
|
||||||
|
|
||||||
;; Don't blink the cursor, it's too distracting.
|
;; The blinking cursor is distracting, but also interferes with cursor settings
|
||||||
|
;; in some minor modes that try to change it buffer-locally (like treemacs) and
|
||||||
|
;; can cause freezing for folks (esp on macOS) with customized & color cursors.
|
||||||
(blink-cursor-mode -1)
|
(blink-cursor-mode -1)
|
||||||
|
|
||||||
;; Don't blink the paren matching the one at point, it's too distracting.
|
;; Don't blink the paren matching the one at point, it's too distracting.
|
||||||
(setq blink-matching-paren nil)
|
(setq blink-matching-paren nil)
|
||||||
|
|
||||||
|
;; Some terminals offer two different cursors: a “visible” static cursor and a
|
||||||
|
;; “very visible” blinking one. By default, Emacs uses the very visible cursor
|
||||||
|
;; and switches to it when you start or resume Emacs. If `visible-cursor' is nil
|
||||||
|
;; when Emacs starts or resumes, it uses the normal cursor.
|
||||||
(setq visible-cursor nil)
|
(setq visible-cursor nil)
|
||||||
|
|
||||||
;; Don't stretch the cursor to fit wide characters, it is disorienting,
|
;; Don't stretch the cursor to fit wide characters, it is disorienting,
|
||||||
|
@ -222,8 +233,6 @@ read-only or not file-visiting."
|
||||||
;; Make `next-buffer', `other-buffer', etc. ignore unreal buffers.
|
;; Make `next-buffer', `other-buffer', etc. ignore unreal buffers.
|
||||||
(push '(buffer-predicate . doom-buffer-frame-predicate) default-frame-alist)
|
(push '(buffer-predicate . doom-buffer-frame-predicate) default-frame-alist)
|
||||||
|
|
||||||
(setq confirm-nonexistent-file-or-buffer t)
|
|
||||||
|
|
||||||
(defadvice! doom--switch-to-fallback-buffer-maybe-a (&rest _)
|
(defadvice! doom--switch-to-fallback-buffer-maybe-a (&rest _)
|
||||||
"Switch to `doom-fallback-buffer' if on last real buffer.
|
"Switch to `doom-fallback-buffer' if on last real buffer.
|
||||||
|
|
||||||
|
@ -269,9 +278,6 @@ windows, switch to `doom-fallback-buffer'. Otherwise, delegate to original
|
||||||
(setq indicate-buffer-boundaries nil
|
(setq indicate-buffer-boundaries nil
|
||||||
indicate-empty-lines nil)
|
indicate-empty-lines nil)
|
||||||
|
|
||||||
;; remove continuation arrow on right fringe
|
|
||||||
(delq! 'continuation fringe-indicator-alist 'assq)
|
|
||||||
|
|
||||||
|
|
||||||
;;
|
;;
|
||||||
;;; Windows/frames
|
;;; Windows/frames
|
||||||
|
@ -328,8 +334,9 @@ windows, switch to `doom-fallback-buffer'. Otherwise, delegate to original
|
||||||
window-divider-default-right-width 1)
|
window-divider-default-right-width 1)
|
||||||
(add-hook 'doom-init-ui-hook #'window-divider-mode)
|
(add-hook 'doom-init-ui-hook #'window-divider-mode)
|
||||||
|
|
||||||
;; Prompt the user for confirmation when deleting a non-empty frame
|
;; Prompt for confirmation when deleting a non-empty frame; a last line of
|
||||||
(global-set-key [remap delete-frame] #'doom/delete-frame)
|
;; defense against accidental loss of work.
|
||||||
|
(global-set-key [remap delete-frame] #'doom/delete-frame-with-prompt)
|
||||||
|
|
||||||
;; always avoid GUI
|
;; always avoid GUI
|
||||||
(setq use-dialog-box nil)
|
(setq use-dialog-box nil)
|
||||||
|
@ -353,8 +360,8 @@ windows, switch to `doom-fallback-buffer'. Otherwise, delegate to original
|
||||||
;; while we're in the minibuffer.
|
;; while we're in the minibuffer.
|
||||||
(setq enable-recursive-minibuffers t)
|
(setq enable-recursive-minibuffers t)
|
||||||
|
|
||||||
;; Show current key-sequence in minibuffer, like vim does. Any feedback after
|
;; Show current key-sequence in minibuffer ala 'set showcmd' in vim. Any
|
||||||
;; typing is better UX than no feedback at all.
|
;; feedback after typing is better UX than no feedback at all.
|
||||||
(setq echo-keystrokes 0.02)
|
(setq echo-keystrokes 0.02)
|
||||||
|
|
||||||
;; Expand the minibuffer to fit multi-line text displayed in the echo-area. This
|
;; Expand the minibuffer to fit multi-line text displayed in the echo-area. This
|
||||||
|
@ -364,7 +371,7 @@ windows, switch to `doom-fallback-buffer'. Otherwise, delegate to original
|
||||||
max-mini-window-height 0.15)
|
max-mini-window-height 0.15)
|
||||||
|
|
||||||
;; Typing yes/no is obnoxious when y/n will do
|
;; Typing yes/no is obnoxious when y/n will do
|
||||||
(fset #'yes-or-no-p #'y-or-n-p)
|
(advice-add #'yes-or-no-p :override #'y-or-n-p)
|
||||||
|
|
||||||
;; Try really hard to keep the cursor from getting stuck in the read-only prompt
|
;; Try really hard to keep the cursor from getting stuck in the read-only prompt
|
||||||
;; portion of the minibuffer.
|
;; portion of the minibuffer.
|
||||||
|
@ -412,7 +419,7 @@ windows, switch to `doom-fallback-buffer'. Otherwise, delegate to original
|
||||||
|
|
||||||
(use-package! hl-line
|
(use-package! hl-line
|
||||||
;; Highlights the current line
|
;; Highlights the current line
|
||||||
:hook ((prog-mode text-mode conf-mode) . hl-line-mode)
|
:hook ((prog-mode text-mode conf-mode special-mode) . hl-line-mode)
|
||||||
:config
|
:config
|
||||||
;; Not having to render the hl-line overlay in multiple buffers offers a tiny
|
;; Not having to render the hl-line overlay in multiple buffers offers a tiny
|
||||||
;; performance boost. I also don't need to see it in other buffers.
|
;; performance boost. I also don't need to see it in other buffers.
|
||||||
|
@ -421,17 +428,17 @@ windows, switch to `doom-fallback-buffer'. Otherwise, delegate to original
|
||||||
|
|
||||||
;; Temporarily disable `hl-line' when selection is active, since it doesn't
|
;; Temporarily disable `hl-line' when selection is active, since it doesn't
|
||||||
;; serve much purpose when the selection is so much more visible.
|
;; serve much purpose when the selection is so much more visible.
|
||||||
(defvar doom-buffer-hl-line-mode nil)
|
(defvar doom--hl-line-mode nil)
|
||||||
|
|
||||||
(add-hook! '(evil-visual-state-entry-hook activate-mark-hook)
|
(add-hook! '(evil-visual-state-entry-hook activate-mark-hook)
|
||||||
(defun doom-disable-hl-line-h ()
|
(defun doom-disable-hl-line-h ()
|
||||||
(when hl-line-mode
|
(when hl-line-mode
|
||||||
(setq-local doom-buffer-hl-line-mode t)
|
(setq-local doom--hl-line-mode t)
|
||||||
(hl-line-mode -1))))
|
(hl-line-mode -1))))
|
||||||
|
|
||||||
(add-hook! '(evil-visual-state-exit-hook deactivate-mark-hook)
|
(add-hook! '(evil-visual-state-exit-hook deactivate-mark-hook)
|
||||||
(defun doom-enable-hl-line-maybe-h ()
|
(defun doom-enable-hl-line-maybe-h ()
|
||||||
(when doom-buffer-hl-line-mode
|
(when doom--hl-line-mode
|
||||||
(hl-line-mode +1)))))
|
(hl-line-mode +1)))))
|
||||||
|
|
||||||
|
|
||||||
|
@ -513,10 +520,6 @@ windows, switch to `doom-fallback-buffer'. Otherwise, delegate to original
|
||||||
;; languages like Lisp.
|
;; languages like Lisp.
|
||||||
(setq rainbow-delimiters-max-face-count 3)
|
(setq rainbow-delimiters-max-face-count 3)
|
||||||
|
|
||||||
;;;###package pos-tip
|
|
||||||
(setq pos-tip-internal-border-width 6
|
|
||||||
pos-tip-border-width 1)
|
|
||||||
|
|
||||||
|
|
||||||
;;
|
;;
|
||||||
;;; Line numbers
|
;;; Line numbers
|
||||||
|
@ -541,6 +544,7 @@ windows, switch to `doom-fallback-buffer'. Otherwise, delegate to original
|
||||||
;; Underline looks a bit better when drawn lower
|
;; Underline looks a bit better when drawn lower
|
||||||
(setq x-underline-at-descent-line t)
|
(setq x-underline-at-descent-line t)
|
||||||
|
|
||||||
|
;; DEPRECATED In Emacs 27
|
||||||
(defvar doom--prefer-theme-elc nil
|
(defvar doom--prefer-theme-elc nil
|
||||||
"If non-nil, `load-theme' will prefer the compiled theme (unlike its default
|
"If non-nil, `load-theme' will prefer the compiled theme (unlike its default
|
||||||
behavior). Do not set this directly, this is let-bound in `doom-init-theme-h'.")
|
behavior). Do not set this directly, this is let-bound in `doom-init-theme-h'.")
|
||||||
|
@ -588,29 +592,44 @@ behavior). Do not set this directly, this is let-bound in `doom-init-theme-h'.")
|
||||||
"Load the theme specified by `doom-theme' in FRAME."
|
"Load the theme specified by `doom-theme' in FRAME."
|
||||||
(when (and doom-theme (not (memq doom-theme custom-enabled-themes)))
|
(when (and doom-theme (not (memq doom-theme custom-enabled-themes)))
|
||||||
(with-selected-frame (or frame (selected-frame))
|
(with-selected-frame (or frame (selected-frame))
|
||||||
(let ((doom--prefer-theme-elc t))
|
(let ((doom--prefer-theme-elc t)) ; DEPRECATED in Emacs 27
|
||||||
(load-theme doom-theme t)))))
|
(load-theme doom-theme t)))))
|
||||||
|
|
||||||
(defadvice! doom--run-load-theme-hooks-a (theme &optional _no-confirm no-enable)
|
(defadvice! doom--load-theme-a (orig-fn theme &optional no-confirm no-enable)
|
||||||
"Set up `doom-load-theme-hook' to run after `load-theme' is called."
|
"Run `doom-load-theme-hook' on `load-theme' and fix its issues.
|
||||||
:after-while #'load-theme
|
|
||||||
(unless no-enable
|
|
||||||
(setq doom-theme theme
|
|
||||||
doom-init-theme-p t)
|
|
||||||
(run-hooks 'doom-load-theme-hook)))
|
|
||||||
|
|
||||||
(defadvice! doom--prefer-compiled-theme-a (orig-fn &rest args)
|
1. Disable previously enabled themes.
|
||||||
"Make `load-theme' prioritize the byte-compiled theme for a moderate boost in
|
2. Don't let face-remapping screw up loading the new theme
|
||||||
startup (or theme switch) time, so long as `doom--prefer-theme-elc' is non-nil."
|
(*cough*`mixed-pitch-mode').
|
||||||
|
3. Record the current theme in `doom-theme'."
|
||||||
:around #'load-theme
|
:around #'load-theme
|
||||||
(if (or (null after-init-time)
|
;; HACK Run `load-theme' from an estranged buffer, where we can be assured
|
||||||
doom--prefer-theme-elc)
|
;; that buffer-local face remaps (by `mixed-pitch-mode', for instance)
|
||||||
(cl-letf* ((old-locate-file (symbol-function 'locate-file))
|
;; won't interfere with changing themes.
|
||||||
((symbol-function 'locate-file)
|
(with-temp-buffer
|
||||||
(lambda (filename path &optional _suffixes predicate)
|
(when-let (result (funcall orig-fn theme no-confirm no-enable))
|
||||||
(funcall old-locate-file filename path '("c" "") predicate))))
|
(unless no-enable
|
||||||
(apply orig-fn args))
|
(setq doom-theme theme
|
||||||
(apply orig-fn args)))
|
doom-init-theme-p t)
|
||||||
|
(mapc #'disable-theme (remq theme custom-enabled-themes))
|
||||||
|
(run-hooks 'doom-load-theme-hook))
|
||||||
|
result)))
|
||||||
|
|
||||||
|
(unless EMACS27+
|
||||||
|
;; DEPRECATED Not needed in Emacs 27
|
||||||
|
(defadvice! doom--prefer-compiled-theme-a (orig-fn &rest args)
|
||||||
|
"Have `load-theme' prioritize the byte-compiled theme.
|
||||||
|
This offers a moderate boost in startup (or theme switch) time, so long as
|
||||||
|
`doom--prefer-theme-elc' is non-nil."
|
||||||
|
:around #'load-theme
|
||||||
|
(if (or (null after-init-time)
|
||||||
|
doom--prefer-theme-elc)
|
||||||
|
(cl-letf* ((old-locate-file (symbol-function 'locate-file))
|
||||||
|
((symbol-function 'locate-file)
|
||||||
|
(lambda (filename path &optional _suffixes predicate)
|
||||||
|
(funcall old-locate-file filename path '("c" "") predicate))))
|
||||||
|
(apply orig-fn args))
|
||||||
|
(apply orig-fn args))))
|
||||||
|
|
||||||
|
|
||||||
;;
|
;;
|
||||||
|
@ -624,9 +643,13 @@ startup (or theme switch) time, so long as `doom--prefer-theme-elc' is non-nil."
|
||||||
(add-hook 'after-change-major-mode-hook #'doom-highlight-non-default-indentation-h 'append)
|
(add-hook 'after-change-major-mode-hook #'doom-highlight-non-default-indentation-h 'append)
|
||||||
|
|
||||||
;; Initialize custom switch-{buffer,window,frame} hooks:
|
;; Initialize custom switch-{buffer,window,frame} hooks:
|
||||||
|
;;
|
||||||
;; + `doom-switch-buffer-hook'
|
;; + `doom-switch-buffer-hook'
|
||||||
;; + `doom-switch-window-hook'
|
;; + `doom-switch-window-hook'
|
||||||
;; + `doom-switch-frame-hook'
|
;; + `doom-switch-frame-hook'
|
||||||
|
;;
|
||||||
|
;; These should be done as late as possible, as not to prematurely trigger
|
||||||
|
;; hooks during startup.
|
||||||
(add-hook 'buffer-list-update-hook #'doom-run-switch-window-hooks-h)
|
(add-hook 'buffer-list-update-hook #'doom-run-switch-window-hooks-h)
|
||||||
(add-hook 'focus-in-hook #'doom-run-switch-frame-hooks-h)
|
(add-hook 'focus-in-hook #'doom-run-switch-frame-hooks-h)
|
||||||
(dolist (fn '(switch-to-next-buffer switch-to-prev-buffer))
|
(dolist (fn '(switch-to-next-buffer switch-to-prev-buffer))
|
||||||
|
@ -664,14 +687,14 @@ startup (or theme switch) time, so long as `doom--prefer-theme-elc' is non-nil."
|
||||||
(put 'customize-themes 'disabled "Set `doom-theme' or use `load-theme' in $DOOMDIR/config.el instead")
|
(put 'customize-themes 'disabled "Set `doom-theme' or use `load-theme' in $DOOMDIR/config.el instead")
|
||||||
|
|
||||||
;; Doesn't exist in terminal Emacs, so we define it to prevent void-function
|
;; Doesn't exist in terminal Emacs, so we define it to prevent void-function
|
||||||
;; errors emitted from packages use it without checking for it first.
|
;; errors emitted from packages that blindly try to use it.
|
||||||
(unless (fboundp 'define-fringe-bitmap)
|
(unless (fboundp 'define-fringe-bitmap)
|
||||||
(fset 'define-fringe-bitmap #'ignore))
|
(fset 'define-fringe-bitmap #'ignore))
|
||||||
|
|
||||||
(after! whitespace
|
(after! whitespace
|
||||||
(defun doom-disable-whitespace-mode-in-childframes-a (orig-fn)
|
(defun doom-disable-whitespace-mode-in-childframes-a (orig-fn)
|
||||||
"`whitespace-mode' inundates child frames with whitspace markers, so disable
|
"`whitespace-mode' inundates child frames with whitespace markers, so
|
||||||
it to fix all that visual noise."
|
disable it to fix all that visual noise."
|
||||||
(unless (frame-parameter nil 'parent-frame)
|
(unless (frame-parameter nil 'parent-frame)
|
||||||
(funcall orig-fn)))
|
(funcall orig-fn)))
|
||||||
(add-function :around whitespace-enable-predicate #'doom-disable-whitespace-mode-in-childframes-a))
|
(add-function :around whitespace-enable-predicate #'doom-disable-whitespace-mode-in-childframes-a))
|
||||||
|
|
145
core/core.el
145
core/core.el
|
@ -19,20 +19,26 @@
|
||||||
(defvar doom--initial-load-path load-path)
|
(defvar doom--initial-load-path load-path)
|
||||||
(defvar doom--initial-process-environment process-environment)
|
(defvar doom--initial-process-environment process-environment)
|
||||||
(defvar doom--initial-exec-path exec-path)
|
(defvar doom--initial-exec-path exec-path)
|
||||||
(defvar doom--initial-file-name-handler-alist file-name-handler-alist)
|
|
||||||
|
|
||||||
;; This is consulted on every `require', `load' and various path/io functions.
|
;; `file-name-handler-alist' is consulted on every `require', `load' and various
|
||||||
;; You get a minor speed up by nooping this.
|
;; path/io functions. You get a minor speed up by nooping this. However, this
|
||||||
|
;; may cause problems on builds of Emacs where its site lisp files aren't
|
||||||
|
;; byte-compiled and we're forced to load the *.el.gz files (e.g. on Alpine)
|
||||||
(unless noninteractive
|
(unless noninteractive
|
||||||
(setq file-name-handler-alist nil))
|
(defvar doom--initial-file-name-handler-alist file-name-handler-alist)
|
||||||
|
|
||||||
;; Restore `file-name-handler-alist', because it is needed for handling
|
(setq file-name-handler-alist nil)
|
||||||
;; encrypted or compressed files, among other things.
|
;; Restore `file-name-handler-alist', because it is needed for handling
|
||||||
(defun doom-reset-file-handler-alist-h ()
|
;; encrypted or compressed files, among other things.
|
||||||
(setq file-name-handler-alist doom--initial-file-name-handler-alist))
|
(defun doom-reset-file-handler-alist-h ()
|
||||||
(add-hook 'emacs-startup-hook #'doom-reset-file-handler-alist-h)
|
;; Re-add rather than `setq', because file-name-handler-alist may have
|
||||||
|
;; changed since startup, and we want to preserve those.
|
||||||
|
(dolist (handler file-name-handler-alist)
|
||||||
|
(add-to-list 'doom--initial-file-name-handler-alist handler))
|
||||||
|
(setq file-name-handler-alist doom--initial-file-name-handler-alist))
|
||||||
|
(add-hook 'emacs-startup-hook #'doom-reset-file-handler-alist-h))
|
||||||
|
|
||||||
;; Load the bare necessities
|
;; Just the bare necessities
|
||||||
(require 'core-lib)
|
(require 'core-lib)
|
||||||
|
|
||||||
|
|
||||||
|
@ -135,65 +141,88 @@ users).")
|
||||||
;;
|
;;
|
||||||
;;; Emacs core configuration
|
;;; Emacs core configuration
|
||||||
|
|
||||||
;; lo', longer logs ahoy, so we may reliably locate lapses in doom's logic
|
;; lo', longer logs ahoy, so to reliably locate lapses in doom's logic later
|
||||||
(setq message-log-max 8192)
|
(setq message-log-max 8192)
|
||||||
|
|
||||||
;; Reduce debug output, well, unless we've asked for it.
|
;; Reduce debug output, well, unless we've asked for it.
|
||||||
(setq debug-on-error doom-debug-mode
|
(setq debug-on-error doom-debug-mode
|
||||||
jka-compr-verbose doom-debug-mode)
|
jka-compr-verbose doom-debug-mode)
|
||||||
|
|
||||||
;; UTF-8 as the default coding system
|
;; Contrary to what many Emacs users have in their configs, you really don't
|
||||||
|
;; need more than this to make UTF-8 the default coding system:
|
||||||
(when (fboundp 'set-charset-priority)
|
(when (fboundp 'set-charset-priority)
|
||||||
(set-charset-priority 'unicode)) ; pretty
|
(set-charset-priority 'unicode)) ; pretty
|
||||||
(prefer-coding-system 'utf-8) ; pretty
|
(prefer-coding-system 'utf-8) ; pretty
|
||||||
(setq locale-coding-system 'utf-8) ; please
|
(setq locale-coding-system 'utf-8) ; please
|
||||||
;; Except for the clipboard on Windows, where its contents could be in an
|
;; The clipboard's on Windows could be in an encoding that's wider (or thinner)
|
||||||
;; encoding that's wider than utf-8, so we let Emacs/the OS decide what encoding
|
;; than utf-8, so let Emacs/the OS decide what encoding to use there.
|
||||||
;; to use.
|
|
||||||
(unless IS-WINDOWS
|
(unless IS-WINDOWS
|
||||||
(setq selection-coding-system 'utf-8)) ; with sugar on top
|
(setq selection-coding-system 'utf-8)) ; with sugar on top
|
||||||
|
|
||||||
;; Disable warnings from legacy advice system. They aren't useful, and we can't
|
;; Disable warnings from legacy advice system. They aren't useful, and what can
|
||||||
;; often do anything about them besides changing packages upstream
|
;; we do about them, besides changing packages upstream?
|
||||||
(setq ad-redefinition-action 'accept)
|
(setq ad-redefinition-action 'accept)
|
||||||
|
|
||||||
;; Make apropos omnipotent. It's more useful this way.
|
;; Make apropos omnipotent. It's more useful this way.
|
||||||
(setq apropos-do-all t)
|
(setq apropos-do-all t)
|
||||||
|
|
||||||
;; Don't make a second case-insensitive pass over `auto-mode-alist'. If it has
|
;; A second, case-insensitive pass over `auto-mode-alist' is time wasted, and
|
||||||
;; to, it's our (the user's) failure. One case for all!
|
;; indicates misconfiguration (or that the user needs to stop relying on case
|
||||||
|
;; insensitivity).
|
||||||
(setq auto-mode-case-fold nil)
|
(setq auto-mode-case-fold nil)
|
||||||
|
|
||||||
;; Display the bare minimum at startup. We don't need all that noise. The
|
;; Less noise at startup. The dashboard/empty scratch buffer is good enough.
|
||||||
;; dashboard/empty scratch buffer is good enough.
|
|
||||||
(setq inhibit-startup-message t
|
(setq inhibit-startup-message t
|
||||||
inhibit-startup-echo-area-message user-login-name
|
inhibit-startup-echo-area-message user-login-name
|
||||||
inhibit-default-init t
|
inhibit-default-init t
|
||||||
|
;; Avoid pulling in many packages by starting the scratch buffer in
|
||||||
|
;; `fundamental-mode', rather than, say, `org-mode' or `text-mode'.
|
||||||
initial-major-mode 'fundamental-mode
|
initial-major-mode 'fundamental-mode
|
||||||
initial-scratch-message nil)
|
initial-scratch-message nil)
|
||||||
(fset #'display-startup-echo-area-message #'ignore)
|
|
||||||
|
;; Get rid of "For information about GNU Emacs..." message at startup, unless
|
||||||
|
;; we're in a daemon session, where it'll say "Starting Emacs daemon." instead,
|
||||||
|
;; which isn't so bad.
|
||||||
|
(unless (daemonp)
|
||||||
|
(advice-add #'display-startup-echo-area-message :override #'ignore))
|
||||||
|
|
||||||
;; Emacs "updates" its ui more often than it needs to, so we slow it down
|
;; Emacs "updates" its ui more often than it needs to, so we slow it down
|
||||||
;; slightly, from 0.5s:
|
;; slightly from 0.5s:
|
||||||
(setq idle-update-delay 1)
|
(setq idle-update-delay 1)
|
||||||
|
|
||||||
;; Emacs is a huge security vulnerability, what with all the dependencies it
|
;; Emacs is essentially one huge security vulnerability, what with all the
|
||||||
;; pulls in from all corners of the globe. Let's at least try to be more
|
;; dependencies it pulls in from all corners of the globe. Let's try to be at
|
||||||
;; discerning.
|
;; least a little more discerning.
|
||||||
(setq gnutls-verify-error (getenv "INSECURE")
|
(setq gnutls-verify-error (not (getenv "INSECURE"))
|
||||||
|
gnutls-algorithm-priority
|
||||||
|
(when (boundp 'libgnutls-version)
|
||||||
|
(concat "SECURE128:+SECURE192:-VERS-ALL"
|
||||||
|
(if (and (not IS-WINDOWS)
|
||||||
|
(not (version< emacs-version "26.3"))
|
||||||
|
(>= libgnutls-version 30605))
|
||||||
|
":+VERS-TLS1.3")
|
||||||
|
":+VERS-TLS1.2"))
|
||||||
|
;; `gnutls-min-prime-bits' is set based on recommendations from
|
||||||
|
;; https://www.keylength.com/en/4/
|
||||||
|
gnutls-min-prime-bits 3072
|
||||||
tls-checktrust gnutls-verify-error
|
tls-checktrust gnutls-verify-error
|
||||||
tls-program '("gnutls-cli --x509cafile %t -p %p %h"
|
;; Emacs is built with `gnutls' by default, so `tls-program' would not
|
||||||
|
;; be used in that case. Otherwiese, people have reasons to not go with
|
||||||
|
;; `gnutls', we use `openssl' instead.
|
||||||
|
;; For more details, see https://redd.it/8sykl1
|
||||||
|
tls-program '("openssl s_client -connect %h:%p -CAfile %t -nbio -no_ssl3 -no_tls1 -no_tls1_1 -ign_eof"
|
||||||
|
"gnutls-cli -p %p --dh-bits=3072 --ocsp --x509cafile=%t \
|
||||||
|
--strict-tofu --priority='SECURE192:+SECURE128:-VERS-ALL:+VERS-TLS1.2:+VERS-TLS1.3' %h"
|
||||||
;; compatibility fallbacks
|
;; compatibility fallbacks
|
||||||
"gnutls-cli -p %p %h"
|
"gnutls-cli -p %p %h"))
|
||||||
"openssl s_client -connect %h:%p -no_ssl2 -no_ssl3 -ign_eof"))
|
|
||||||
|
|
||||||
;; Emacs stores authinfo in HOME and in plaintext. Let's not do that, mkay? This
|
;; Emacs stores authinfo in $HOME and in plaintext. Let's not do that, mkay?
|
||||||
;; file usually stores usernames, passwords, and other such treasures for the
|
;; This file stores usernames, passwords, and other such treasures for the
|
||||||
;; aspiring malicious third party.
|
;; aspiring malicious third party.
|
||||||
(setq auth-sources (list (expand-file-name "authinfo.gpg" doom-etc-dir)
|
(setq auth-sources (list (expand-file-name "authinfo.gpg" doom-etc-dir)
|
||||||
"~/.authinfo.gpg"))
|
"~/.authinfo.gpg"))
|
||||||
|
|
||||||
;; Emacs on Windows frequently confuses HOME (C:\Users\<NAME>) and APPDATA,
|
;; Emacs on Windows frequently confuses HOME (C:\Users\<NAME>) and %APPDATA%,
|
||||||
;; causing `abbreviate-home-dir' to produce incorrect paths.
|
;; causing `abbreviate-home-dir' to produce incorrect paths.
|
||||||
(when IS-WINDOWS
|
(when IS-WINDOWS
|
||||||
(setq abbreviated-home-dir "\\`'"))
|
(setq abbreviated-home-dir "\\`'"))
|
||||||
|
@ -228,9 +257,9 @@ users).")
|
||||||
;;
|
;;
|
||||||
;;; Optimizations
|
;;; Optimizations
|
||||||
|
|
||||||
;; Disable bidirectional text rendering for a modest performance boost. Of
|
;; Disable bidirectional text rendering for a modest performance boost. I've set
|
||||||
;; course, this renders Emacs unable to detect/display right-to-left languages
|
;; this to `nil' in the past, but the `bidi-display-reordering's docs say that
|
||||||
;; (sorry!), but for us left-to-right language speakers/writers, it's a boon.
|
;; is an undefined state and suggest this to be just as good:
|
||||||
(setq-default bidi-display-reordering 'left-to-right
|
(setq-default bidi-display-reordering 'left-to-right
|
||||||
bidi-paragraph-direction 'left-to-right)
|
bidi-paragraph-direction 'left-to-right)
|
||||||
|
|
||||||
|
@ -240,9 +269,15 @@ users).")
|
||||||
(setq highlight-nonselected-windows nil)
|
(setq highlight-nonselected-windows nil)
|
||||||
|
|
||||||
;; More performant rapid scrolling over unfontified regions. May cause brief
|
;; More performant rapid scrolling over unfontified regions. May cause brief
|
||||||
;; spells of inaccurate fontification immediately after scrolling.
|
;; spells of inaccurate syntax highlighting right after scrolling, which should
|
||||||
|
;; quickly self-correct.
|
||||||
(setq fast-but-imprecise-scrolling t)
|
(setq fast-but-imprecise-scrolling t)
|
||||||
|
|
||||||
|
;; Font locking is the source of much slowness in Emacs. jit-lock-mode tries to
|
||||||
|
;; defer fontification until the user is idle. This should help... in theory.
|
||||||
|
(setq jit-lock-defer-time 0 ; only defer while processing input
|
||||||
|
jit-lock-stealth-time 2) ; fontify the rest of the buffer after a delay
|
||||||
|
|
||||||
;; Resizing the Emacs frame can be a terribly expensive part of changing the
|
;; Resizing the Emacs frame can be a terribly expensive part of changing the
|
||||||
;; font. By inhibiting this, we halve startup times, particularly when we use
|
;; font. By inhibiting this, we halve startup times, particularly when we use
|
||||||
;; fonts that are larger than the system default (which would resize the frame).
|
;; fonts that are larger than the system default (which would resize the frame).
|
||||||
|
@ -251,16 +286,15 @@ users).")
|
||||||
;; Don't ping things that look like domain names.
|
;; Don't ping things that look like domain names.
|
||||||
(setq ffap-machine-p-known 'reject)
|
(setq ffap-machine-p-known 'reject)
|
||||||
|
|
||||||
|
;; Font compacting can be terribly expensive, especially for rendering icon
|
||||||
|
;; fonts on Windows. Whether it has a noteable affect on Linux and Mac hasn't
|
||||||
|
;; been determined, but we inhibit it there anyway.
|
||||||
|
(setq inhibit-compacting-font-caches t)
|
||||||
|
|
||||||
;; Performance on Windows is considerably worse than elsewhere, especially if
|
;; Performance on Windows is considerably worse than elsewhere, especially if
|
||||||
;; WSL is involved. We'll need everything we can get.
|
;; WSL is involved. We'll need everything we can get.
|
||||||
(when IS-WINDOWS
|
(when IS-WINDOWS
|
||||||
;; Reduce the workload when doing file IO
|
(setq w32-get-true-file-attributes nil)) ; slightly faster IO
|
||||||
(setq w32-get-true-file-attributes nil)
|
|
||||||
|
|
||||||
;; Font compacting can be terribly expensive, especially for rendering icon
|
|
||||||
;; fonts on Windows. Whether it has a noteable affect on Linux and Mac hasn't
|
|
||||||
;; been determined.
|
|
||||||
(setq inhibit-compacting-font-caches t))
|
|
||||||
|
|
||||||
;; Remove command line options that aren't relevant to our current OS; means
|
;; Remove command line options that aren't relevant to our current OS; means
|
||||||
;; slightly less to process at startup.
|
;; slightly less to process at startup.
|
||||||
|
@ -274,17 +308,19 @@ users).")
|
||||||
;; Adopt a sneaky garbage collection strategy of waiting until idle time to
|
;; Adopt a sneaky garbage collection strategy of waiting until idle time to
|
||||||
;; collect; staving off the collector while the user is working.
|
;; collect; staving off the collector while the user is working.
|
||||||
(when doom-interactive-mode
|
(when doom-interactive-mode
|
||||||
|
(setq gc-cons-percentage 0.6)
|
||||||
(add-transient-hook! 'pre-command-hook (gcmh-mode +1))
|
(add-transient-hook! 'pre-command-hook (gcmh-mode +1))
|
||||||
(with-eval-after-load 'gcmh
|
(with-eval-after-load 'gcmh
|
||||||
(setq gcmh-idle-delay 10
|
(setq gcmh-idle-delay 10
|
||||||
gcmh-verbose doom-debug-mode
|
gcmh-high-cons-threshold 16777216
|
||||||
gcmh-high-cons-threshold 16777216) ; 16mb
|
gcmh-verbose doom-debug-mode ; 16mb
|
||||||
|
gc-cons-percentage 0.1)
|
||||||
(add-hook 'focus-out-hook #'gcmh-idle-garbage-collect)))
|
(add-hook 'focus-out-hook #'gcmh-idle-garbage-collect)))
|
||||||
|
|
||||||
;; HACK `tty-run-terminal-initialization' is *tremendously* slow for some
|
;; HACK `tty-run-terminal-initialization' is *tremendously* slow for some
|
||||||
;; reason. Disabling it completely could have many side-effects, so we
|
;; reason. Disabling it completely could have many side-effects, so we
|
||||||
;; defer it until later.
|
;; defer it until later, at which time it (somehow) runs very quickly.
|
||||||
(unless (display-graphic-p)
|
(unless (daemonp)
|
||||||
(advice-add #'tty-run-terminal-initialization :override #'ignore)
|
(advice-add #'tty-run-terminal-initialization :override #'ignore)
|
||||||
(add-hook! 'window-setup-hook
|
(add-hook! 'window-setup-hook
|
||||||
(defun doom-init-tty-h ()
|
(defun doom-init-tty-h ()
|
||||||
|
@ -338,12 +374,12 @@ If you want to disable incremental loading altogether, either remove
|
||||||
`doom-incremental-first-idle-timer' to nil. Incremental loading does not occur
|
`doom-incremental-first-idle-timer' to nil. Incremental loading does not occur
|
||||||
in daemon sessions (they are loaded immediately at startup).")
|
in daemon sessions (they are loaded immediately at startup).")
|
||||||
|
|
||||||
(defvar doom-incremental-first-idle-timer 2
|
(defvar doom-incremental-first-idle-timer 2.0
|
||||||
"How long (in idle seconds) until incremental loading starts.
|
"How long (in idle seconds) until incremental loading starts.
|
||||||
|
|
||||||
Set this to nil to disable incremental loading.")
|
Set this to nil to disable incremental loading.")
|
||||||
|
|
||||||
(defvar doom-incremental-idle-timer 1.5
|
(defvar doom-incremental-idle-timer 0.75
|
||||||
"How long (in idle seconds) in between incrementally loading packages.")
|
"How long (in idle seconds) in between incrementally loading packages.")
|
||||||
|
|
||||||
(defun doom-load-packages-incrementally (packages &optional now)
|
(defun doom-load-packages-incrementally (packages &optional now)
|
||||||
|
@ -384,7 +420,7 @@ intervals."
|
||||||
If this is a daemon session, load them all immediately instead."
|
If this is a daemon session, load them all immediately instead."
|
||||||
(if (daemonp)
|
(if (daemonp)
|
||||||
(mapc #'require (cdr doom-incremental-packages))
|
(mapc #'require (cdr doom-incremental-packages))
|
||||||
(when (integerp doom-incremental-first-idle-timer)
|
(when (numberp doom-incremental-first-idle-timer)
|
||||||
(run-with-idle-timer doom-incremental-first-idle-timer
|
(run-with-idle-timer doom-incremental-first-idle-timer
|
||||||
nil #'doom-load-packages-incrementally
|
nil #'doom-load-packages-incrementally
|
||||||
(cdr doom-incremental-packages) t))))
|
(cdr doom-incremental-packages) t))))
|
||||||
|
@ -407,8 +443,7 @@ Meant to be used with `run-hook-wrapped'."
|
||||||
nil)
|
nil)
|
||||||
|
|
||||||
(defun doom-display-benchmark-h (&optional return-p)
|
(defun doom-display-benchmark-h (&optional return-p)
|
||||||
"Display a benchmark, showing number of packages and modules, and how quickly
|
"Display a benchmark including number of packages and modules loaded.
|
||||||
they were loaded at startup.
|
|
||||||
|
|
||||||
If RETURN-P, return the message as a string instead of displaying it."
|
If RETURN-P, return the message as a string instead of displaying it."
|
||||||
(funcall (if return-p #'format #'message)
|
(funcall (if return-p #'format #'message)
|
||||||
|
@ -481,7 +516,7 @@ The overall load order of Doom is as follows:
|
||||||
Module config.el files
|
Module config.el files
|
||||||
~/.doom.d/config.el
|
~/.doom.d/config.el
|
||||||
`doom-init-modules-hook'
|
`doom-init-modules-hook'
|
||||||
`after-init-hook'
|
`doom-after-init-hook' (`after-init-hook')
|
||||||
`emacs-startup-hook'
|
`emacs-startup-hook'
|
||||||
`doom-init-ui-hook'
|
`doom-init-ui-hook'
|
||||||
`window-setup-hook'
|
`window-setup-hook'
|
||||||
|
@ -493,7 +528,7 @@ to least)."
|
||||||
(setq doom-init-p t)
|
(setq doom-init-p t)
|
||||||
|
|
||||||
;; Reset as much state as possible, so `doom-initialize' can be treated like
|
;; Reset as much state as possible, so `doom-initialize' can be treated like
|
||||||
;; a reset function. Particularly useful for reloading the config.
|
;; a reset function. e.g. when reloading the config.
|
||||||
(setq-default exec-path doom--initial-exec-path
|
(setq-default exec-path doom--initial-exec-path
|
||||||
load-path doom--initial-load-path
|
load-path doom--initial-load-path
|
||||||
process-environment doom--initial-process-environment)
|
process-environment doom--initial-process-environment)
|
||||||
|
|
|
@ -3,10 +3,10 @@
|
||||||
|
|
||||||
;; core.el
|
;; core.el
|
||||||
(package! auto-minor-mode :pin "17cfa1b548")
|
(package! auto-minor-mode :pin "17cfa1b548")
|
||||||
(package! gcmh :pin "8867533a73")
|
(package! gcmh :pin "b1bde50891")
|
||||||
|
|
||||||
;; core-ui.el
|
;; core-ui.el
|
||||||
(package! all-the-icons :pin "1416f37984")
|
(package! all-the-icons :pin "0b74fc3618")
|
||||||
(package! hide-mode-line :pin "88888825b5")
|
(package! hide-mode-line :pin "88888825b5")
|
||||||
(package! highlight-numbers :pin "8b4744c7f4")
|
(package! highlight-numbers :pin "8b4744c7f4")
|
||||||
(package! rainbow-delimiters :pin "5125f4e476")
|
(package! rainbow-delimiters :pin "5125f4e476")
|
||||||
|
@ -14,12 +14,12 @@
|
||||||
|
|
||||||
;; core-editor.el
|
;; core-editor.el
|
||||||
(package! better-jumper :pin "6d240032ca")
|
(package! better-jumper :pin "6d240032ca")
|
||||||
(package! dtrt-indent :pin "48221c928b")
|
(package! dtrt-indent :pin "9163cd990f")
|
||||||
(package! helpful :pin "c54e9ddbd6")
|
(package! helpful :pin "c54e9ddbd6")
|
||||||
(when IS-MAC
|
(when IS-MAC
|
||||||
(package! ns-auto-titlebar :pin "1efc30d385"))
|
(package! ns-auto-titlebar :pin "1efc30d385"))
|
||||||
(package! pcre2el :pin "0b5b2a2c17")
|
(package! pcre2el :pin "0b5b2a2c17")
|
||||||
(package! smartparens :pin "1f8857c5fe")
|
(package! smartparens :pin "555626a43f")
|
||||||
(package! so-long
|
(package! so-long
|
||||||
:built-in 'prefer ; included in Emacs 27+
|
:built-in 'prefer ; included in Emacs 27+
|
||||||
;; REVIEW so-long is slated to be published to ELPA eventually, but until then
|
;; REVIEW so-long is slated to be published to ELPA eventually, but until then
|
||||||
|
@ -27,21 +27,22 @@
|
||||||
;; on a potato.
|
;; on a potato.
|
||||||
:recipe (:host github :repo "hlissner/emacs-so-long")
|
:recipe (:host github :repo "hlissner/emacs-so-long")
|
||||||
:pin "ed666b0716")
|
:pin "ed666b0716")
|
||||||
(package! undo-tree :pin "5b6df03781")
|
|
||||||
(package! ws-butler
|
(package! ws-butler
|
||||||
;; Use my fork of ws-butler, which has a few choice improvements and
|
;; Use my fork of ws-butler, which has a few choice improvements and
|
||||||
;; optimizations (the original has been abandoned).
|
;; optimizations (the original has been abandoned).
|
||||||
:recipe (:host github :repo "hlissner/ws-butler")
|
:recipe (:host github :repo "hlissner/ws-butler")
|
||||||
:pin "e4430d3778")
|
:pin "2bb49d3ee7")
|
||||||
(unless IS-WINDOWS
|
(unless IS-WINDOWS
|
||||||
(package! xclip :pin "d022cf947d"))
|
(package! clipetty
|
||||||
|
:recipe (:host github :repo "spudlyo/clipetty")
|
||||||
|
:pin "7ee3f9c52f"))
|
||||||
|
|
||||||
;; core-projects.el
|
;; core-projects.el
|
||||||
(package! projectile :pin "341150c0e7")
|
(package! projectile :pin "eec569dc32")
|
||||||
|
|
||||||
;; core-keybinds.el
|
;; core-keybinds.el
|
||||||
(package! general :pin "f6e928622d")
|
(package! general :pin "14ad4c888b")
|
||||||
(package! which-key :pin "7b068f3e95")
|
(package! which-key :pin "8b49ae978c")
|
||||||
|
|
||||||
;; autoload/cache.el
|
;; autoload/cache.el
|
||||||
(package! persistent-soft :pin "a1e0ddf2a1")
|
(package! persistent-soft :pin "a1e0ddf2a1")
|
||||||
|
|
|
@ -4,19 +4,15 @@
|
||||||
;; To install a package with Doom you must declare them here, run 'doom sync' on
|
;; To install a package with Doom you must declare them here, run 'doom sync' on
|
||||||
;; the command line, then restart Emacs for the changes to take effect.
|
;; the command line, then restart Emacs for the changes to take effect.
|
||||||
;; Alternatively, use M-x doom/reload.
|
;; Alternatively, use M-x doom/reload.
|
||||||
;;
|
|
||||||
;; WARNING: Disabling core packages listed in ~/.emacs.d/core/packages.el may
|
|
||||||
;; have nasty side-effects and is not recommended.
|
|
||||||
|
|
||||||
|
|
||||||
;; All of Doom's packages are pinned to a specific commit, and updated from
|
;; Doom's packages are pinned to a specific commit and updated from release to
|
||||||
;; release to release. To un-pin all packages and live on the edge, do:
|
;; release. The `unpin!' macro allows you to unpin single packages...
|
||||||
;(unpin! t)
|
|
||||||
|
|
||||||
;; ...but to unpin a single package:
|
|
||||||
;(unpin! pinned-package)
|
;(unpin! pinned-package)
|
||||||
;; Use it to unpin multiple packages
|
;; ...or multiple packages
|
||||||
;(unpin! pinned-package another-pinned-package)
|
;(unpin! pinned-package another-pinned-package)
|
||||||
|
;; ...Or *all* packages (NOT RECOMMENDED; will likely break things)
|
||||||
|
;(unpin! t)
|
||||||
|
|
||||||
|
|
||||||
;; To install SOME-PACKAGE from MELPA, ELPA or emacsmirror:
|
;; To install SOME-PACKAGE from MELPA, ELPA or emacsmirror:
|
||||||
|
|
263
docs/faq.org
263
docs/faq.org
|
@ -13,11 +13,11 @@
|
||||||
- [[#why-is-startup-time-important-why-not-use-the-daemon][Why is startup time important? Why not use the daemon?]]
|
- [[#why-is-startup-time-important-why-not-use-the-daemon][Why is startup time important? Why not use the daemon?]]
|
||||||
- [[#how-do-i-use-doom-alongside-other-emacs-configs][How do I use Doom alongside other Emacs configs?]]
|
- [[#how-do-i-use-doom-alongside-other-emacs-configs][How do I use Doom alongside other Emacs configs?]]
|
||||||
- [[#why-should-i-use-doom-instead-of-rolling-my-own-config][Why should I use Doom instead of rolling my own config?]]
|
- [[#why-should-i-use-doom-instead-of-rolling-my-own-config][Why should I use Doom instead of rolling my own config?]]
|
||||||
- [[#what-is-the-meaning-behind-dooms-naming-conventions][What is the meaning behind Doom's naming conventions?]]
|
- [[#what-is-the-meaning-behind-dooms-naming-convention-in-its-source-code][What is the meaning behind Doom's naming convention in its source code?]]
|
||||||
- [[#how-can-i-contribute-tosupport-doom][How can I contribute to/support Doom?]]
|
|
||||||
- [[#what-version-of-doom-am-i-running][What version of Doom am I running?]]
|
- [[#what-version-of-doom-am-i-running][What version of Doom am I running?]]
|
||||||
|
- [[#is-discord-the-only-option-for-interacting-with-your-community][Is Discord the only option for interacting with your community?]]
|
||||||
- [[#configuration][Configuration]]
|
- [[#configuration][Configuration]]
|
||||||
- [[#should-i-fork-doom-to-customize-it][Should I fork Doom to customize it?]]
|
- [[#does-doom-respect-xdg-conventions][Does Doom respect XDG conventions]]
|
||||||
- [[#how-do-i-configure-doom-emacs][How do I configure Doom Emacs?]]
|
- [[#how-do-i-configure-doom-emacs][How do I configure Doom Emacs?]]
|
||||||
- [[#how-do-i-enable-or-disable-a-doom-module][How do I enable or disable a Doom module?]]
|
- [[#how-do-i-enable-or-disable-a-doom-module][How do I enable or disable a Doom module?]]
|
||||||
- [[#how-do-i-change-the-theme][How do I change the theme?]]
|
- [[#how-do-i-change-the-theme][How do I change the theme?]]
|
||||||
|
@ -27,13 +27,14 @@
|
||||||
- [[#how-do-i-change-the-leaderlocalleader-keys][How do I change the leader/localleader keys?]]
|
- [[#how-do-i-change-the-leaderlocalleader-keys][How do I change the leader/localleader keys?]]
|
||||||
- [[#how-do-i-change-the-style-of-line-numbers-or-disable-them-altogether][How do I change the style of line-numbers (or disable them altogether)?]]
|
- [[#how-do-i-change-the-style-of-line-numbers-or-disable-them-altogether][How do I change the style of line-numbers (or disable them altogether)?]]
|
||||||
- [[#how-do-i-change-the-behavior-and-appearance-of-popup-windows][How do I change the behavior and appearance of popup windows?]]
|
- [[#how-do-i-change-the-behavior-and-appearance-of-popup-windows][How do I change the behavior and appearance of popup windows?]]
|
||||||
- [[#how-do-i-change-the-appearance-a-face-or-faces][How do I change the appearance a face (or faces)?]]
|
- [[#how-do-i-customize-a-theme-or-faces][How do I customize a theme or face(s)?]]
|
||||||
- [[#can-doom-be-customized-without-restarting-emacs][Can Doom be customized without restarting Emacs?]]
|
- [[#can-doom-be-customized-without-restarting-emacs][Can Doom be customized without restarting Emacs?]]
|
||||||
- [[#can-vimevil-be-removed-for-a-more-vanilla-emacs-experience][Can Vim/Evil be removed for a more vanilla Emacs experience?]]
|
- [[#can-vimevil-be-removed-for-a-more-vanilla-emacs-experience][Can Vim/Evil be removed for a more vanilla Emacs experience?]]
|
||||||
- [[#should-i-use-make-or-bindoom][Should I use ~make~ or ~bin/doom~?]]
|
|
||||||
- [[#when-should-and-shouldnt-i-use-bindoom][When should and shouldn't I use ~bin/doom~?]]
|
- [[#when-should-and-shouldnt-i-use-bindoom][When should and shouldn't I use ~bin/doom~?]]
|
||||||
- [[#when-to-run-doom-sync][When to run ~doom sync~]]
|
- [[#when-to-run-doom-sync][When to run ~doom sync~]]
|
||||||
- [[#how-to-suppress-confirmation-prompts-while-bindoom-is-running][How to suppress confirmation prompts while ~bin/doom~ is running]]
|
- [[#how-to-suppress-confirmation-prompts-while-bindoom-is-running][How to suppress confirmation prompts while ~bin/doom~ is running]]
|
||||||
|
- [[#which-terminal-should-i-use][Which terminal should I use?]]
|
||||||
|
- [[#how-do-i-enable-lsp-support-for-insert-language-here][How do I enable LSP support for <insert language here>?]]
|
||||||
- [[#package-management][Package Management]]
|
- [[#package-management][Package Management]]
|
||||||
- [[#how-do-i-install-a-package-from-elpa][How do I install a package from ELPA?]]
|
- [[#how-do-i-install-a-package-from-elpa][How do I install a package from ELPA?]]
|
||||||
- [[#how-do-i-install-a-package-from-githubanother-source][How do I install a package from github/another source?]]
|
- [[#how-do-i-install-a-package-from-githubanother-source][How do I install a package from github/another source?]]
|
||||||
|
@ -62,6 +63,7 @@
|
||||||
- [[#tramp-connections-hang-forever-when-connecting][TRAMP connections hang forever when connecting]]
|
- [[#tramp-connections-hang-forever-when-connecting][TRAMP connections hang forever when connecting]]
|
||||||
- [[#an-upstream-package-was-broken-and-i-cant-update-it][An upstream package was broken and I can't update it]]
|
- [[#an-upstream-package-was-broken-and-i-cant-update-it][An upstream package was broken and I can't update it]]
|
||||||
- [[#why-do-i-see-ugly-indentation-highlights-for-tabs][Why do I see ugly indentation highlights for tabs?]]
|
- [[#why-do-i-see-ugly-indentation-highlights-for-tabs][Why do I see ugly indentation highlights for tabs?]]
|
||||||
|
- [[#clipetty--emit-opening-output-file-permission-denied-devpts29-error]["clipetty--emit: Opening output file: Permission denied, /dev/pts/29" error]]
|
||||||
- [[#contributing][Contributing]]
|
- [[#contributing][Contributing]]
|
||||||
|
|
||||||
* General
|
* General
|
||||||
|
@ -81,9 +83,9 @@ in the [[file:getting_started.org::On Windows][Getting Starting guide]].
|
||||||
If you're a Windows user, help us improve our documentation!
|
If you're a Windows user, help us improve our documentation!
|
||||||
|
|
||||||
** Is Doom only for vimmers?
|
** Is Doom only for vimmers?
|
||||||
No, but it is Doom's primary audience. Its maintainer is a dyed-in-the-wool
|
No, but it is Doom's primary audience, because its maintainer is a
|
||||||
vimmer with almost two decades of vim muscle memory, and he came to Emacs to
|
dyed-in-the-wool vimmer with almost two decades of vim muscle memory, and he
|
||||||
find a better vim.
|
adopted Emacs in search of a better vim.
|
||||||
|
|
||||||
Although Doom is less polished without evil, its growing non-evil user base is
|
Although Doom is less polished without evil, its growing non-evil user base is
|
||||||
slowly improving the situation. We welcome suggestions and PRs to help
|
slowly improving the situation. We welcome suggestions and PRs to help
|
||||||
|
@ -93,12 +95,16 @@ If you'd still like a go at it, see the [[file:../modules/editor/evil/README.org
|
||||||
[[file:../modules/editor/evil/README.org][:editor evil]] module's documentation.
|
[[file:../modules/editor/evil/README.org][:editor evil]] module's documentation.
|
||||||
|
|
||||||
** I am a beginner. Can I use Doom?
|
** I am a beginner. Can I use Doom?
|
||||||
If you're new to the terminal, to programming, or Emacs and/or vim, Doom (or
|
This isn't a choice I can make for you. Generally, if you're new to the
|
||||||
Emacs, for that matter) is a rough place to start. Neither Doom nor Emacs are
|
terminal, to programming, or Emacs and/or vim, then Doom (and Emacs, for that
|
||||||
particularly beginner friendly. That's not to say it's impossible, or that we
|
matter) will be a rough place to start. Neither Doom nor Emacs are particularly
|
||||||
won't help you if you ask, but expect a hefty commitment and a bumpy journey.
|
beginner friendly. Emacs' main draw is its unparalleled extensibility, but
|
||||||
|
anything so extensible has a learning curve.
|
||||||
|
|
||||||
Remember to check out the [[file:index.org][Documentation]] for a guide to getting started.
|
That's not to say it's impossible, or that we won't help you if you ask, but
|
||||||
|
expect a hefty commitment and a bumpy journey. And don't pass up on the
|
||||||
|
[[file:index.org][Documentation]], which will walk you through setting up Doom, and includes links
|
||||||
|
to external resources created by our community.
|
||||||
|
|
||||||
** How does Doom compare to Spacemacs?
|
** How does Doom compare to Spacemacs?
|
||||||
To paraphrase (and expand upon) a [[https://www.reddit.com/r/emacs/comments/6pa0oq/quickstart_tutorial_for_emacs_newbies_with_doom/dkp1bhd/][reddit answer]] to this question by [[https://github.com/gilbertw1][@gilbertw1]]:
|
To paraphrase (and expand upon) a [[https://www.reddit.com/r/emacs/comments/6pa0oq/quickstart_tutorial_for_emacs_newbies_with_doom/dkp1bhd/][reddit answer]] to this question by [[https://github.com/gilbertw1][@gilbertw1]]:
|
||||||
|
@ -113,18 +119,19 @@ To paraphrase (and expand upon) a [[https://www.reddit.com/r/emacs/comments/6pa0
|
||||||
consensus. It is [mostly] the work of one developer and caters to his
|
consensus. It is [mostly] the work of one developer and caters to his
|
||||||
vim-slanted tastes. Doom's defaults enforce very particular (albeit optional)
|
vim-slanted tastes. Doom's defaults enforce very particular (albeit optional)
|
||||||
workflows.
|
workflows.
|
||||||
+ *Doom lacks manpower.* Bugs stick around longer, documentation is light and
|
+ *Doom lacks manpower.* Bugs stick around longer, documentation is lighter and
|
||||||
development is at the mercy of it's single maintainer's schedule, health and
|
development is at the mercy of it's maintainer's schedule, health and whims.
|
||||||
whims.
|
+ *Doom is not beginner friendly.* Doom lacks a large community to constantly
|
||||||
+ *Doom is not beginner friendly.* Spacemacs works out of the box. Your mileage
|
improve and produce tutorials/guides for it. Spacemacs is more likely to work
|
||||||
may vary with Doom; assembly is required! Familiarity with Emacs Lisp (or
|
right out of the box. Doom also holds your hand less. A little elisp, shell
|
||||||
programming in general), git and the command line will go a long way to ease
|
and git-fu will go a long way to ease you into Doom.
|
||||||
you into Doom.
|
+ *Doom is managed through it's command line interface.* The ~bin/doom~ script
|
||||||
+ *Doom manages its packages outside of Emacs.* Spacemacs installs (and checks
|
allows you to script package management, manage your config, or utilize elisp
|
||||||
for packages) on startup or on demand. Doom leaves package management to be
|
functionality externally, like org tangling or batch processing.
|
||||||
done externally, through the ~bin/doom~ script. This allows for package
|
+ *Doom's package manager is declarative and rolling release is opt-in.* Doom
|
||||||
management to be scripted on the command line and enables a number of startup
|
takes a little after nix, striving for as much config reproducibility as Emacs
|
||||||
optimizations we wouldn't have otherwise.
|
(and git) will permit. Spacemacs uses package.el, which is rolling release
|
||||||
|
only.
|
||||||
|
|
||||||
** Why such a complicated package management system?
|
** Why such a complicated package management system?
|
||||||
Doom had +four+ *five* goals for its package management system:
|
Doom had +four+ *five* goals for its package management system:
|
||||||
|
@ -293,34 +300,65 @@ Note: package.el is sneaky, and will initialize itself if you're not careful.
|
||||||
|
|
||||||
*** Lazy load more than everything
|
*** Lazy load more than everything
|
||||||
~use-package~ can defer your packages. Using it is a no-brainer, but Doom goes a
|
~use-package~ can defer your packages. Using it is a no-brainer, but Doom goes a
|
||||||
little further with lazy loading. There are some massive plugins out there. For
|
step further. There are some massive plugins out there for which ordinary lazy
|
||||||
some of them, ordinary lazy loading techniques don't work. To name a few:
|
loading techniques don't work. To name a few:
|
||||||
|
|
||||||
+ The =lang/org= module defers loading babel packages until their src blocks are
|
+ The =lang/org= module defers loading babel packages until their src blocks are
|
||||||
executed or read. You no longer need ~org-babel-do-load-languages~ in your
|
executed or read. You no longer need ~org-babel-do-load-languages~ in your
|
||||||
config -- in fact, you shouldn't use it at all!
|
config -- in fact, you shouldn't use it at all!
|
||||||
|
+ =org-protocol= needs to be loaded to intercept requests for org-protocol://
|
||||||
|
URLs. Since org-protocol depends on org, this can be expensive to load
|
||||||
|
yourself, so Doom loads as soon as a org-protocol:// request is received, just
|
||||||
|
before it is processed.
|
||||||
+ Company and yasnippet are loaded as late as possible (waiting until the user
|
+ Company and yasnippet are loaded as late as possible (waiting until the user
|
||||||
opens a non-read-only, file-visiting buffer (that isn't in fundamental-mode)).
|
opens a non-read-only, file-visiting buffer (that isn't in fundamental-mode)).
|
||||||
+ The =evil-easymotion= package binds many keys, none of which are available
|
+ The =evil-easymotion= package binds many keys, none of which are available
|
||||||
until you load the package. Instead of loading it at startup, =gs= is bound to
|
until you load the package. Instead of loading it at startup, =gs= is bound to
|
||||||
a command that loads the package, populates =gs=, then simulates the =gs= key
|
a command that loads the package, populates =gs=, then simulates the =gs= key
|
||||||
press as though those new keys had always been there.
|
press as though those new keys had always been there.
|
||||||
+ Doom loads some packages "incrementally". i.e. after a few seconds of idle
|
|
||||||
time post-startup, Doom loads packages piecemeal (one dependency at a time)
|
|
||||||
while Emacs. It aborts if it detects input, as to make the process as subtle
|
|
||||||
as possible.
|
|
||||||
|
|
||||||
For example, instead of loading =org= (a giant package), it will load these
|
In addition, Doom loads some packages "incrementally". i.e. after a few seconds
|
||||||
dependencies, one at a time, before finally loading =org=:
|
of idle time post-startup, Doom loads packages piecemeal (one dependency at a
|
||||||
|
time) while Emacs. It aborts if it detects input, as to make the process as
|
||||||
|
subtle as possible.
|
||||||
|
|
||||||
#+BEGIN_SRC elisp
|
For example, instead of loading =org= (a giant package), it will load these
|
||||||
(calendar find-func format-spec org-macs org-compat org-faces org-entities
|
dependencies, one at a time, before finally loading =org=:
|
||||||
org-list org-pcomplete org-src org-footnote org-macro ob org org-agenda
|
|
||||||
org-capture)
|
|
||||||
#+END_SRC
|
|
||||||
|
|
||||||
This ensures packages load as quickly as possible when you first load an org
|
#+BEGIN_SRC elisp
|
||||||
file.
|
(calendar find-func format-spec org-macs org-compat org-faces
|
||||||
|
org-entities org-list org-pcomplete org-src org-footnote
|
||||||
|
org-macro ob org org-agenda org-capture)
|
||||||
|
#+END_SRC
|
||||||
|
|
||||||
|
This ensures packages load as quickly as possible when you first load an org
|
||||||
|
file.
|
||||||
|
|
||||||
|
*** Unset ~file-name-handler-alist~ temporarily
|
||||||
|
Emacs consults this variable every time a file is read or library loaded, or
|
||||||
|
when certain functions in the file API are used (like ~expand-file-name~ or
|
||||||
|
~file-truename~).
|
||||||
|
|
||||||
|
Emacs does to check if a special handler is needed to read that file, but none
|
||||||
|
of them are (typically) necessary at startup, so we disable them (temporarily!):
|
||||||
|
|
||||||
|
#+BEGIN_SRC emacs-lisp
|
||||||
|
(defvar doom--file-name-handler-alist file-name-handler-alist)
|
||||||
|
(setq file-name-handler-alist nil)
|
||||||
|
|
||||||
|
;; ... your whole emacs config here ...
|
||||||
|
|
||||||
|
;; Then restore it later:
|
||||||
|
(setq file-name-handler-alist doom--file-name-handler-alist)
|
||||||
|
|
||||||
|
;; Alternatively, restore it even later:
|
||||||
|
(add-hook 'emacs-startup-hook
|
||||||
|
(lambda ()
|
||||||
|
(setq file-name-handler-alist doom--file-name-handler-alist)))
|
||||||
|
#+END_SRC
|
||||||
|
|
||||||
|
Don't forget to restore ~file-name-handler-alist~, otherwise TRAMP won't work
|
||||||
|
and compressed/encrypted files won't open.
|
||||||
|
|
||||||
*** Use [[https://www.gnu.org/software/emacs/manual/html_node/elisp/Lexical-Binding.html][lexical-binding]] everywhere
|
*** Use [[https://www.gnu.org/software/emacs/manual/html_node/elisp/Lexical-Binding.html][lexical-binding]] everywhere
|
||||||
Add ~;; -*- lexical-binding: t; -*-~ to the top of your elisp files. This can
|
Add ~;; -*- lexical-binding: t; -*-~ to the top of your elisp files. This can
|
||||||
|
@ -382,44 +420,61 @@ permanent entry point.
|
||||||
#+end_quote
|
#+end_quote
|
||||||
|
|
||||||
** Why should I use Doom instead of rolling my own config?
|
** Why should I use Doom instead of rolling my own config?
|
||||||
If you care about personalizing the software you use on a daily basis, even half
|
Time. If you care about personalizing the software you use on a daily basis,
|
||||||
as much as I do, then you probably need professional help, but you also know it
|
even half as much as I do, then you probably need professional help, but you
|
||||||
is time consuming. Emacs out-of-the-box is a barren wasteland with archaic
|
also know it is time consuming. Emacs out-of-the-box is a barren wasteland with
|
||||||
defaults. Building anything out here and getting a feel for it will take /a lot/
|
archaic defaults. Building anything out here and getting a feel for it will take
|
||||||
of time. Time that I've already wasted and can never get back.
|
/a lot/ of time. Time that I've already wasted and can never get back.
|
||||||
|
|
||||||
Time you could otherwise spend attending your daughter's dance recitals, that
|
Time you could otherwise spend attending your daughter's dance recitals, that
|
||||||
baseball game your son's team almost won last Thursday, or answering the court
|
baseball game your son's team almost won last Thursday, or answering the court
|
||||||
summons to fight for custody of your kids.
|
summons to fight for custody of your kids.
|
||||||
|
|
||||||
|
+ Doom has solved many problems big and small you'll likely run into at some
|
||||||
|
point in your Emacs career. And the problems don't end there! Let someone else
|
||||||
|
worry about the menial things.
|
||||||
|
+ Doom will be faster than most hand-rolled configs. Startup is one thing, but
|
||||||
|
Doom invests a lot of effort to improve runtime performance as well.
|
||||||
|
+ Doom's package manager (powered by straight.el) is declarative, non-rolling
|
||||||
|
release and (nominally) reproducible; which is unique on the Emacs distro
|
||||||
|
scene. Upstream issues won't surprise you as much, and you can roll back when
|
||||||
|
you don't have the time to deal with them.
|
||||||
|
+ It facilitates integration with the command line, which makes it easy to
|
||||||
|
integrate external tools with Emacs via the =bin/doom= script.
|
||||||
|
|
||||||
Also, Doom's fast yo.
|
Also, Doom's fast yo.
|
||||||
|
|
||||||
** What is the meaning behind Doom's naming conventions?
|
** What is the meaning behind Doom's naming convention in its source code?
|
||||||
You'll find [[file:contributing.org::*Conventions][an overview of Doom's code conventions]] in the [[file:contributing.org][contributing guide]].
|
You'll find [[file:contributing.org::*Conventions][an overview of Doom's code conventions]] in the [[file:contributing.org][contributing guide]].
|
||||||
|
|
||||||
** How can I contribute to/support Doom?
|
|
||||||
Take a look at the [[file:contributing.org][Contributing guide]].
|
|
||||||
|
|
||||||
** What version of Doom am I running?
|
** What version of Doom am I running?
|
||||||
You'll find the current version displayed in the modeline on the dashboard. It
|
You'll find the current version displayed in the modeline on the dashboard. It
|
||||||
can also be retrieved using ~M-x doom/version~ (bound to =SPC h d v= by default)
|
can also be retrieved using ~M-x doom/version~ (bound to =SPC h d v= or =C-h d
|
||||||
or ~doom info~ on the command line.
|
v= by default) or ~bin/doom version~ on the command line.
|
||||||
|
|
||||||
|
** Is Discord the only option for interacting with your community?
|
||||||
|
Yes. I selected it for my personal convenience and have no plans to extend our
|
||||||
|
community to any other platform (like Matrix, IRC or Slack), or add bridges for
|
||||||
|
them. I already have my hands full managing the one.
|
||||||
|
|
||||||
|
My being so active on our Discord is owed to that fact that my friends, family
|
||||||
|
and other communities were on Discord to begin with. My availability was the
|
||||||
|
most important factor in choosing a platform, even if there are other platforms
|
||||||
|
better suited to the task.
|
||||||
|
|
||||||
|
Email is a possible alternative, but it is constantly swamped; expect a long
|
||||||
|
turn-around time.
|
||||||
|
|
||||||
* Configuration
|
* Configuration
|
||||||
** Should I fork Doom to customize it?
|
** Does Doom respect XDG conventions
|
||||||
No. Not unless you have a good reason for doing so (and you're comfortable with
|
Yes. Your private config (normally in =~/.doom.d=) can be moved to
|
||||||
the git-rebase workflow). Your customization can be relegated to =~/.doom.d/=
|
=~/.config/doom=.
|
||||||
(or =~/.config/doom/=) entirely.
|
|
||||||
|
|
||||||
If you /must/ modify Doom proper to get something done, it's a code smell.
|
And as of Emacs 27, Emacs will recognize =~/.config/emacs=.
|
||||||
|
|
||||||
Visit the [[file:getting_started.org::*Customize][Customize section]] of [[file:getting_started.org][the Getting Started guide]] for details on how to
|
|
||||||
do this.
|
|
||||||
|
|
||||||
** How do I configure Doom Emacs?
|
** How do I configure Doom Emacs?
|
||||||
Canonically, your private config is kept in =~/.doom.d/= or =~/.config/doom/=.
|
Canonically, your private config is kept in =~/.doom.d/= (or =~/.config/doom/=).
|
||||||
Doom will prioritize =~/.config/doom=, if it exists. This directory is referred
|
This directory is referred to as your ~$DOOMDIR~.
|
||||||
to as your ~$DOOMDIR~.
|
|
||||||
|
|
||||||
Your private config is typically comprised of an =init.el=, =config.el= and
|
Your private config is typically comprised of an =init.el=, =config.el= and
|
||||||
=packages.el= file. Put all your config in =config.el=, install packages by
|
=packages.el= file. Put all your config in =config.el=, install packages by
|
||||||
|
@ -427,11 +482,14 @@ adding ~package!~ declarations to =packages.el=, and enable/disable modules in
|
||||||
you ~doom!~ block, which should have been created in your =init.el= when you
|
you ~doom!~ block, which should have been created in your =init.el= when you
|
||||||
first ran ~doom install~.
|
first ran ~doom install~.
|
||||||
|
|
||||||
|
You shouldn't need to fork Doom or modify =~/.emacs.d=. If you have to do this
|
||||||
|
to achieve something, it can be considered a bug.
|
||||||
|
|
||||||
Check out the [[file:getting_started.org::Customize][Customize section]] in the [[file:getting_started.org][Getting Started]] guide for details.
|
Check out the [[file:getting_started.org::Customize][Customize section]] in the [[file:getting_started.org][Getting Started]] guide for details.
|
||||||
|
|
||||||
** How do I enable or disable a Doom module?
|
** How do I enable or disable a Doom module?
|
||||||
Comment or uncomment the module in your ~doom!~ block, found in
|
Comment or uncomment the module in your ~doom!~ block, found in
|
||||||
=$DOOMDIR/init.el=.
|
=~/.doom.d/init.el=.
|
||||||
|
|
||||||
Remember to run ~bin/doom sync~ afterwards, on the command line, to sync your
|
Remember to run ~bin/doom sync~ afterwards, on the command line, to sync your
|
||||||
module list with Doom.
|
module list with Doom.
|
||||||
|
@ -613,18 +671,18 @@ rules.
|
||||||
You'll find more comprehensive documentation on ~set-popup-rule!~ in its
|
You'll find more comprehensive documentation on ~set-popup-rule!~ in its
|
||||||
docstring (available through =SPC h f= -- or =C-h f= for non-evil users).
|
docstring (available through =SPC h f= -- or =C-h f= for non-evil users).
|
||||||
|
|
||||||
** How do I change the appearance a face (or faces)?
|
** How do I customize a theme or face(s)?
|
||||||
Doom provides the ~custom-set-faces!~ and ~custom-theme-set-faces!~ macros as a
|
Doom provides the ~custom-set-faces!~ and ~custom-theme-set-faces!~ macros as a
|
||||||
convenience.
|
convenience.
|
||||||
|
|
||||||
#+begin_quote
|
See =SPC h f custom-set-faces\!= (or =C-h f custom-set-faces\!=) for
|
||||||
*Do not use ~M-x customize~ or any of the built-in Emacs customize-* API.* Doom
|
documentation on and examples of its use.
|
||||||
does not support it and never will; those settings could break at any time.
|
|
||||||
#+end_quote
|
|
||||||
|
|
||||||
See =<help> f custom-set-faces\!= (or =M-x helpful-function custom-set-faces\!=)
|
#+begin_quote
|
||||||
for documentation and examples on how to use it. =<help>= is =SPC h= for evil
|
Other sources may recommend ~M-x customize~, ~M-x customize-themes~ or ~M-x
|
||||||
users and =C-h= for non-evil users.
|
customize-face~. *Do not use these commands.* Doom does not support them and
|
||||||
|
their settings could break any time.
|
||||||
|
#+end_quote
|
||||||
|
|
||||||
** Can Doom be customized without restarting Emacs?
|
** Can Doom be customized without restarting Emacs?
|
||||||
Short answer: You can, but you shouldn't.
|
Short answer: You can, but you shouldn't.
|
||||||
|
@ -643,20 +701,13 @@ tools for experienced Emacs users to skirt around it (most of the time):
|
||||||
runs ~doom sync~, restarts the Doom initialization process and re-evaluates
|
runs ~doom sync~, restarts the Doom initialization process and re-evaluates
|
||||||
your personal config. However, this won't clear pre-existing state; Doom won't
|
your personal config. However, this won't clear pre-existing state; Doom won't
|
||||||
unload modules/packages that have already been loaded and it can't anticipate
|
unload modules/packages that have already been loaded and it can't anticipate
|
||||||
complications arising from a private config that isn't idempotent.
|
complications arising from your private config.
|
||||||
- Some ~bin/doom~ commands are available as elisp commands. e.g. ~doom/reload~
|
|
||||||
for ~doom sync~, ~doom/upgrade~ for ~doom upgrade~ ~doom//s~, ~doom//update~, etc. Feel free to use them, but
|
|
||||||
consider them highly experimental and subject to change without notice.
|
|
||||||
- You can quickly restart Emacs and restore the last session with
|
- You can quickly restart Emacs and restore the last session with
|
||||||
~doom/restart-and-restore~ (bound to =SPC q r=).
|
~doom/restart-and-restore~ (bound to =SPC q r=).
|
||||||
|
|
||||||
** Can Vim/Evil be removed for a more vanilla Emacs experience?
|
** Can Vim/Evil be removed for a more vanilla Emacs experience?
|
||||||
Yes! See the [[file:../modules/editor/evil/README.org::Removing evil-mode][Removing evil-mode]] section in [[file:../modules/editor/evil/README.org][:editor evil]]'s documentation.
|
Yes! See the [[file:../modules/editor/evil/README.org::Removing evil-mode][Removing evil-mode]] section in [[file:../modules/editor/evil/README.org][:editor evil]]'s documentation.
|
||||||
|
|
||||||
** Should I use ~make~ or ~bin/doom~?
|
|
||||||
~bin/doom~ is recommended. Doom's Makefile (to manage your config, at least) is
|
|
||||||
deprecated. It forwards to ~bin/doom~ anyway.
|
|
||||||
|
|
||||||
** When should and shouldn't I use ~bin/doom~?
|
** When should and shouldn't I use ~bin/doom~?
|
||||||
~bin/doom~ is your best friend. It'll keep all your secrets (mostly because it's
|
~bin/doom~ is your best friend. It'll keep all your secrets (mostly because it's
|
||||||
a shell script incapable of sentience and thus incapable of retaining, much less
|
a shell script incapable of sentience and thus incapable of retaining, much less
|
||||||
|
@ -710,6 +761,54 @@ doom --yes update
|
||||||
YES=1 doom update
|
YES=1 doom update
|
||||||
#+END_SRC
|
#+END_SRC
|
||||||
|
|
||||||
|
** Which terminal should I use?
|
||||||
|
Looking for a terminal in Emacs? Doom offers four modules:
|
||||||
|
|
||||||
|
+ =:term eshell=
|
||||||
|
+ =:term shell=,
|
||||||
|
+ =:term term=
|
||||||
|
+ =:term vterm=.
|
||||||
|
|
||||||
|
But which do you choose?
|
||||||
|
|
||||||
|
+ =eshell= is the Emacs Lisp shell. It's stable, works anywhere Emacs runs (on
|
||||||
|
any OS) and has no external dependencies, /but/ lacks features you'll expect
|
||||||
|
from mature shells and tends to be slower than them.
|
||||||
|
+ =shell= is a shell /for/ your shell. Think of it like a REPL for bash/zsh,
|
||||||
|
rather than terminal emulation. Due to its simplicity, you're less likely to
|
||||||
|
encounter edge cases (e.g. against your shell config), but it has the smallest
|
||||||
|
feature set. It also won't work with TUI programs like htop or vim.
|
||||||
|
+ =term= is Emacs' built-in terminal emulator. It's alright when it works, awful
|
||||||
|
when it doesn't. =vterm= is almost always a better option.
|
||||||
|
+ =vterm= is as good as terminal emulation gets in Emacs atm, but has a few
|
||||||
|
extra steps to get going. a) Emacs must be built with dynamic modules support
|
||||||
|
and b) you'll need to compile vterm-module.so, which has external dependencies
|
||||||
|
(libvterm). It is automatically built when you first open =vterm=, but this
|
||||||
|
will fail on Windows, NixOS and Guix out of the box -- you're on your own
|
||||||
|
there!
|
||||||
|
|
||||||
|
For a terminal in Emacs, =eshell= and =vterm= are generally the best options.
|
||||||
|
|
||||||
|
** How do I enable LSP support for <insert language here>?
|
||||||
|
Doom supports LSP, but it is not enabled by default. To enable it, you must:
|
||||||
|
|
||||||
|
1. Enable the =:tools lsp= module,
|
||||||
|
2. Enable the =+lsp= flag for the appropriate modules you want LSP support for
|
||||||
|
(e.g. =:lang (python +lsp)= or =:lang (rust +lsp)=),
|
||||||
|
3. Install the prerequisite LSP servers through your package manager or other
|
||||||
|
means. You can find a list of supported servers on [[https://github.com/emacs-lsp/lsp-mode#supported-languages][the lsp-mode project page]].
|
||||||
|
4. Run ~doom sync~ on the command line and restart Emacs.
|
||||||
|
|
||||||
|
Some language modules may lack LSP support (either because it hasn't been
|
||||||
|
implemented yet or I'm not aware of it yet -- let us know!). To enable LSP for
|
||||||
|
these languages, add this to =$DOOMDIR/config.el=:
|
||||||
|
|
||||||
|
#+BEGIN_SRC elisp
|
||||||
|
(add-hook 'MAJOR-MODE-local-vars-hook #'lsp!)
|
||||||
|
;; Where =MAJOR-MODE= is the major mode you're targeting. e.g.
|
||||||
|
;; lisp-mode-local-vars-hook
|
||||||
|
#+END_SRC
|
||||||
|
|
||||||
* Package Management
|
* Package Management
|
||||||
** How do I install a package from ELPA?
|
** How do I install a package from ELPA?
|
||||||
See the "[[file:getting_started.org::*Installing packages][Installing packages]]" section of the [[file:getting_started.org][Getting Started]] guide.
|
See the "[[file:getting_started.org::*Installing packages][Installing packages]]" section of the [[file:getting_started.org][Getting Started]] guide.
|
||||||
|
@ -968,9 +1067,6 @@ known fix for this. To work around it, you must either:
|
||||||
** Doom crashes when...
|
** Doom crashes when...
|
||||||
Here are a few common causes for random crashes:
|
Here are a few common causes for random crashes:
|
||||||
|
|
||||||
+ You have enabled ~undo-tree-auto-save-history~. A bloated cache for a
|
|
||||||
particular file can cause a stack overflow. These caches are stored in
|
|
||||||
=~/.emacs.d/.local/cache/undo-tree-hist/=. Delete this folder to clear it.
|
|
||||||
+ On some systems (particularly MacOS), manipulating the fringes or window
|
+ On some systems (particularly MacOS), manipulating the fringes or window
|
||||||
margins can cause Emacs to crash. This is most prominent in the Doom Dashboard
|
margins can cause Emacs to crash. This is most prominent in the Doom Dashboard
|
||||||
(which tries to center its contents), in org-mode buffers (which uses
|
(which tries to center its contents), in org-mode buffers (which uses
|
||||||
|
@ -1064,5 +1160,8 @@ There are a couple ways to address this:
|
||||||
when you open a file (that isn't in a project with an editorconfig file).
|
when you open a file (that isn't in a project with an editorconfig file).
|
||||||
This isn't foolproof, and won't work for files that have no content in them,
|
This isn't foolproof, and won't work for files that have no content in them,
|
||||||
but it can help in one-off scenarios.
|
but it can help in one-off scenarios.
|
||||||
|
** "clipetty--emit: Opening output file: Permission denied, /dev/pts/29" error
|
||||||
|
This applies to tmux users, in particular. See
|
||||||
|
https://github.com/spudlyo/clipetty/issues/15 for a solution.
|
||||||
|
|
||||||
* TODO Contributing
|
* TODO Contributing
|
||||||
|
|
|
@ -564,7 +564,7 @@ disabled by adding or removing them from your ~doom!~ block (found in
|
||||||
=$DOOMDIR/init.el=).
|
=$DOOMDIR/init.el=).
|
||||||
|
|
||||||
#+begin_quote
|
#+begin_quote
|
||||||
If =$DOOMDIR/init.el= doesn't exist, you haven't installed Doom yet. See [[*Install][the
|
If =$DOOMDIR/init.el= doesn't exist, you haven't installed Doom yet. See [[#install][the
|
||||||
"Install" section]] above.
|
"Install" section]] above.
|
||||||
#+end_quote
|
#+end_quote
|
||||||
|
|
||||||
|
@ -717,14 +717,29 @@ To unpin a package, use the ~unpin!~ macro:
|
||||||
|
|
||||||
;; Or to unpin an entire category of modules
|
;; Or to unpin an entire category of modules
|
||||||
(unpin! :completion :lang :tools)
|
(unpin! :completion :lang :tools)
|
||||||
|
|
||||||
|
;; This will work too, if you prefer the syntax, but it provides no concise
|
||||||
|
;; syntax for unpinning multiple packages:
|
||||||
|
(package! helm :pin nil)
|
||||||
#+END_SRC
|
#+END_SRC
|
||||||
|
|
||||||
To unpin all packages and make Doom Emacs rolling release, use
|
Though it is *highly* discouraged, you may unpin all packages and make Doom
|
||||||
|
Emacs rolling release:
|
||||||
|
|
||||||
#+BEGIN_SRC elisp
|
#+BEGIN_SRC elisp
|
||||||
(unpin! t)
|
(unpin! t)
|
||||||
#+END_SRC
|
#+END_SRC
|
||||||
|
|
||||||
|
#+begin_quote
|
||||||
|
Unpinning all packages is discouraged because Doom's modules are designed
|
||||||
|
against the pinned versions of its packages. More volatile packages (like
|
||||||
|
lsp-mode, ein and org) change rapidly, and are likely to cause breakages if
|
||||||
|
unpinned.
|
||||||
|
|
||||||
|
Instead, it's a better idea to selectively unpin packages, or repin them to the
|
||||||
|
exact commit you want.
|
||||||
|
#+end_quote
|
||||||
|
|
||||||
*** Disabling packages
|
*** Disabling packages
|
||||||
The ~package!~ macro possesses a ~:disable~ property:
|
The ~package!~ macro possesses a ~:disable~ property:
|
||||||
|
|
||||||
|
@ -895,7 +910,7 @@ also be helpful for debugging.
|
||||||
+ define-key
|
+ define-key
|
||||||
+ global-set-key
|
+ global-set-key
|
||||||
+ map!
|
+ map!
|
||||||
+ unmap!
|
+ undefine-key!
|
||||||
+ define-key!
|
+ define-key!
|
||||||
|
|
||||||
** Writing your own modules
|
** Writing your own modules
|
||||||
|
|
|
@ -29,7 +29,7 @@ d s= (or =C-h d s=).
|
||||||
- [[#asking-for-help][Asking for help]]
|
- [[#asking-for-help][Asking for help]]
|
||||||
- [[#project-roadmap][Project roadmap]]
|
- [[#project-roadmap][Project roadmap]]
|
||||||
- [[#tutorials--guides][Tutorials & guides]]
|
- [[#tutorials--guides][Tutorials & guides]]
|
||||||
- [[#projects-that-supportcompliment-doom][Projects that support/compliment Doom]]
|
- [[#projects-that-supportcomplement-doom][Projects that support/complement Doom]]
|
||||||
- [[#similar-projects][Similar projects]]
|
- [[#similar-projects][Similar projects]]
|
||||||
|
|
||||||
* TODO Release Notes
|
* TODO Release Notes
|
||||||
|
@ -96,7 +96,7 @@ d s= (or =C-h d s=).
|
||||||
+ *Vim & Evil*
|
+ *Vim & Evil*
|
||||||
- [[https://gist.github.com/dmsul/8bb08c686b70d5a68da0e2cb81cd857f][A crash course on modal editing and Ex commands]]
|
- [[https://gist.github.com/dmsul/8bb08c686b70d5a68da0e2cb81cd857f][A crash course on modal editing and Ex commands]]
|
||||||
|
|
||||||
** Projects that support/compliment Doom
|
** Projects that support/complement Doom
|
||||||
+ [[https://github.com/plexus/chemacs][plexus/chemacs]]
|
+ [[https://github.com/plexus/chemacs][plexus/chemacs]]
|
||||||
+ [[https://github.com/r-darwish/topgrade][r-darwish/topgrade]]
|
+ [[https://github.com/r-darwish/topgrade][r-darwish/topgrade]]
|
||||||
|
|
||||||
|
|
|
@ -42,7 +42,7 @@ completion.
|
||||||
+ [[file:../modules/completion/company/README.org][company]] =+childframe +tng= - The ultimate code completion backend
|
+ [[file:../modules/completion/company/README.org][company]] =+childframe +tng= - The ultimate code completion backend
|
||||||
+ helm =+fuzzy +childframe= - *Another* search engine for love and life
|
+ helm =+fuzzy +childframe= - *Another* search engine for love and life
|
||||||
+ ido - The /other/ *other* search engine for love and life
|
+ ido - The /other/ *other* search engine for love and life
|
||||||
+ [[file:../modules/completion/ivy/README.org][ivy]] =+fuzzy +prescient +childframe= - /The/ search engine for love and life
|
+ [[file:../modules/completion/ivy/README.org][ivy]] =+fuzzy +prescient +childframe +icons= - /The/ search engine for love and life
|
||||||
|
|
||||||
* :config
|
* :config
|
||||||
Modules that configure Emacs one way or another, or focus on making it easier
|
Modules that configure Emacs one way or another, or focus on making it easier
|
||||||
|
@ -61,6 +61,7 @@ Modules that affect and augment your ability to manipulate or insert text.
|
||||||
+ [[file:../modules/editor/file-templates/README.org][file-templates]] - Auto-inserted templates in blank new files
|
+ [[file:../modules/editor/file-templates/README.org][file-templates]] - Auto-inserted templates in blank new files
|
||||||
+ [[file:../modules/editor/fold/README.org][fold]] - universal code folding
|
+ [[file:../modules/editor/fold/README.org][fold]] - universal code folding
|
||||||
+ format =+onsave= - TODO
|
+ format =+onsave= - TODO
|
||||||
|
+ god - TODO
|
||||||
+ [[file:../modules/editor/lispy/README.org][lispy]] - TODO
|
+ [[file:../modules/editor/lispy/README.org][lispy]] - TODO
|
||||||
+ multiple-cursors - TODO
|
+ multiple-cursors - TODO
|
||||||
+ [[file:../modules/editor/objed/README.org][objed]] - TODO
|
+ [[file:../modules/editor/objed/README.org][objed]] - TODO
|
||||||
|
@ -75,6 +76,7 @@ Modules that reconfigure or augment packages or features built into Emacs.
|
||||||
+ [[file:../modules/emacs/dired/README.org][dired]] =+ranger +icons= - TODO
|
+ [[file:../modules/emacs/dired/README.org][dired]] =+ranger +icons= - TODO
|
||||||
+ electric - TODO
|
+ electric - TODO
|
||||||
+ [[file:../modules/emacs/ibuffer/README.org][ibuffer]] =+icons= - TODO
|
+ [[file:../modules/emacs/ibuffer/README.org][ibuffer]] =+icons= - TODO
|
||||||
|
+ [[file:../modules/emacs/undo/README.org][undo]] =+tree= - A smarter, more intuitive & persistent undo history
|
||||||
+ vc - TODO
|
+ vc - TODO
|
||||||
|
|
||||||
* :email
|
* :email
|
||||||
|
@ -90,7 +92,6 @@ Modules that reconfigure or augment packages or features built into Emacs.
|
||||||
Modules that bring support for a language or group of languages to Emacs.
|
Modules that bring support for a language or group of languages to Emacs.
|
||||||
|
|
||||||
+ [[file:../modules/lang/agda/README.org][agda]] - TODO
|
+ [[file:../modules/lang/agda/README.org][agda]] - TODO
|
||||||
+ assembly - TODO
|
|
||||||
+ [[file:../modules/lang/cc/README.org][cc]] =+lsp= - TODO
|
+ [[file:../modules/lang/cc/README.org][cc]] =+lsp= - TODO
|
||||||
+ [[file:../modules/lang/clojure/README.org][clojure]] =+lsp= - TODO
|
+ [[file:../modules/lang/clojure/README.org][clojure]] =+lsp= - TODO
|
||||||
+ common-lisp - TODO
|
+ common-lisp - TODO
|
||||||
|
@ -107,14 +108,16 @@ Modules that bring support for a language or group of languages to Emacs.
|
||||||
+ [[file:../modules/lang/fsharp/README.org][fsharp]] - TODO
|
+ [[file:../modules/lang/fsharp/README.org][fsharp]] - TODO
|
||||||
+ [[file:../modules/lang/fstar/README.org][fstar]] - F* support
|
+ [[file:../modules/lang/fstar/README.org][fstar]] - F* support
|
||||||
+ [[file:../modules/lang/go/README.org][go]] =+lsp= - TODO
|
+ [[file:../modules/lang/go/README.org][go]] =+lsp= - TODO
|
||||||
+ [[file:../modules/lang/haskell/README.org][haskell]] =+dante +intero +lsp= - TODO
|
+ [[file:../modules/lang/haskell/README.org][haskell]] =+dante +ghcide +lsp= - TODO
|
||||||
+ hy - TODO
|
+ hy - TODO
|
||||||
+ [[file:../modules/lang/idris/README.org][idris]] - TODO
|
+ [[file:../modules/lang/idris/README.org][idris]] - TODO
|
||||||
|
+ [[file:../modules/lang/json/README.org][json]] =+lsp= - TODO
|
||||||
+ java =+meghanada +lsp= - TODO
|
+ java =+meghanada +lsp= - TODO
|
||||||
+ [[file:../modules/lang/javascript/README.org][javascript]] =+lsp= - JavaScript, TypeScript, and CoffeeScript support
|
+ [[file:../modules/lang/javascript/README.org][javascript]] =+lsp= - JavaScript, TypeScript, and CoffeeScript support
|
||||||
+ julia - TODO
|
+ julia =+lsp= - TODO
|
||||||
+ kotlin =+lsp+= - TODO
|
+ kotlin =+lsp+= - TODO
|
||||||
+ [[file:../modules/lang/latex/README.org][latex]] =+latexmk +cdlatex +lsp= - TODO
|
+ [[file:../modules/lang/latex/README.org][latex]] =+latexmk +cdlatex +lsp= - TODO
|
||||||
|
+ [[file:../modules/lang/latex/README.org][latex]] =+latexmk +cdlatex +fold= - TODO
|
||||||
+ lean - TODO
|
+ lean - TODO
|
||||||
+ [[file:../modules/lang/ledger/README.org][ledger]] - TODO
|
+ [[file:../modules/lang/ledger/README.org][ledger]] - TODO
|
||||||
+ lua =+moonscript= - TODO
|
+ lua =+moonscript= - TODO
|
||||||
|
@ -122,7 +125,7 @@ Modules that bring support for a language or group of languages to Emacs.
|
||||||
+ [[file:../modules/lang/nim/README.org][nim]] - TODO
|
+ [[file:../modules/lang/nim/README.org][nim]] - TODO
|
||||||
+ nix - TODO
|
+ nix - TODO
|
||||||
+ [[file:../modules/lang/ocaml/README.org][ocaml]] =+lsp= - TODO
|
+ [[file:../modules/lang/ocaml/README.org][ocaml]] =+lsp= - TODO
|
||||||
+ [[file:../modules/lang/org/README.org][org]] =+brain +dragndrop +gnuplot +hugo +ipython +journal +jupyter +pandoc +pomodoro +present= - TODO
|
+ [[file:../modules/lang/org/README.org][org]] =+brain +dragndrop +gnuplot +hugo +ipython +journal +jupyter +pandoc +pomodoro +present +roam= - TODO
|
||||||
+ [[file:../modules/lang/perl/README.org][perl]] - TODO
|
+ [[file:../modules/lang/perl/README.org][perl]] - TODO
|
||||||
+ [[file:../modules/lang/php/README.org][php]] =+lsp= - TODO
|
+ [[file:../modules/lang/php/README.org][php]] =+lsp= - TODO
|
||||||
+ plantuml - TODO
|
+ plantuml - TODO
|
||||||
|
@ -136,10 +139,12 @@ Modules that bring support for a language or group of languages to Emacs.
|
||||||
+ scala =+lsp= - TODO
|
+ scala =+lsp= - TODO
|
||||||
+ [[file:../modules/lang/scheme/README.org][scheme]] - TODO
|
+ [[file:../modules/lang/scheme/README.org][scheme]] - TODO
|
||||||
+ [[file:../modules/lang/sh/README.org][sh]] =+fish +lsp= - TODO
|
+ [[file:../modules/lang/sh/README.org][sh]] =+fish +lsp= - TODO
|
||||||
|
+ [[file:../modules/lang/sml/README.org][sml]] - TODO
|
||||||
+ [[file:../modules/lang/solidity/README.org][solidity]] - TODO
|
+ [[file:../modules/lang/solidity/README.org][solidity]] - TODO
|
||||||
+ swift =+lsp= - TODO
|
+ swift =+lsp= - TODO
|
||||||
+ terra - TODO
|
+ terra - TODO
|
||||||
+ web =+lsp= - HTML and CSS (SCSS/SASS/LESS/Stylus) support.
|
+ web =+lsp= - HTML and CSS (SCSS/SASS/LESS/Stylus) support.
|
||||||
|
+ [[file:../modules/lang/yaml/README.org][yaml]] =+lsp= - TODO
|
||||||
|
|
||||||
* :term
|
* :term
|
||||||
Modules that offer terminal emulation.
|
Modules that offer terminal emulation.
|
||||||
|
@ -153,7 +158,7 @@ Modules that offer terminal emulation.
|
||||||
Small modules that give Emacs access to external tools & services.
|
Small modules that give Emacs access to external tools & services.
|
||||||
|
|
||||||
+ ansible - TODO
|
+ ansible - TODO
|
||||||
+ debugger - A (nigh-)universal debugger in Emacs
|
+ debugger =+lsp= - A (nigh-)universal debugger in Emacs
|
||||||
+ [[file:../modules/tools/direnv/README.org][direnv]] - TODO
|
+ [[file:../modules/tools/direnv/README.org][direnv]] - TODO
|
||||||
+ [[file:../modules/tools/docker/README.org][docker]] =+lsp= - TODO
|
+ [[file:../modules/tools/docker/README.org][docker]] =+lsp= - TODO
|
||||||
+ [[file:../modules/tools/editorconfig/README.org][editorconfig]] - TODO
|
+ [[file:../modules/tools/editorconfig/README.org][editorconfig]] - TODO
|
||||||
|
@ -164,7 +169,7 @@ Small modules that give Emacs access to external tools & services.
|
||||||
backend
|
backend
|
||||||
+ [[file:../modules/tools/lsp/README.org][lsp]] =+peek= - TODO
|
+ [[file:../modules/tools/lsp/README.org][lsp]] =+peek= - TODO
|
||||||
+ macos - TODO
|
+ macos - TODO
|
||||||
+ magit - TODO
|
+ [[file:../modules/tools/magit/README.org][magit]] =+forge= - TODO
|
||||||
+ make - TODO
|
+ make - TODO
|
||||||
+ pass - TODO
|
+ pass - TODO
|
||||||
+ pdf - TODO
|
+ pdf - TODO
|
||||||
|
@ -190,7 +195,7 @@ Aesthetic modules that affect the Emacs interface or user experience.
|
||||||
+ [[file:../modules/ui/neotree/README.org][neotree]] - TODO
|
+ [[file:../modules/ui/neotree/README.org][neotree]] - TODO
|
||||||
+ [[file:../modules/ui/ophints/README.org][ophints]] - TODO
|
+ [[file:../modules/ui/ophints/README.org][ophints]] - TODO
|
||||||
+ [[file:../modules/ui/popup/README.org][popup]] =+all +defaults= - Makes temporary/disposable windows less intrusive
|
+ [[file:../modules/ui/popup/README.org][popup]] =+all +defaults= - Makes temporary/disposable windows less intrusive
|
||||||
+ pretty-code - TODO
|
+ [[file:../modules//ui/pretty-code/README.org][pretty-code]] =+fira +hasklig +iosevka +pragmata-pro= - TODO
|
||||||
+ [[file:../modules/ui/tabs/README.org][tabs]] - TODO
|
+ [[file:../modules/ui/tabs/README.org][tabs]] - TODO
|
||||||
+ treemacs - TODO
|
+ treemacs - TODO
|
||||||
+ [[file:../modules/ui/unicode/README.org][unicode]] - TODO
|
+ [[file:../modules/ui/unicode/README.org][unicode]] - TODO
|
||||||
|
|
|
@ -1,11 +1,11 @@
|
||||||
;;; init.el -*- lexical-binding: t; -*-
|
;;; init.el -*- lexical-binding: t; -*-
|
||||||
|
|
||||||
;; This file controls what Doom modules are enabled and what order they load in.
|
;; This file controls what Doom modules are enabled and what order they load
|
||||||
;; Remember to run 'doom sync' after modifying it!
|
;; in. Remember to run 'doom sync' after modifying it!
|
||||||
|
|
||||||
;; NOTE Press 'SPC h d h' (or 'C-h d h' for non-vim users) to access Doom's
|
;; NOTE Press 'SPC h d h' (or 'C-h d h' for non-vim users) to access Doom's
|
||||||
;; documentation. There you'll find information about all of Doom's modules
|
;; documentation. There you'll find information about all of Doom's
|
||||||
;; and what flags they support.
|
;; modules and what flags they support.
|
||||||
|
|
||||||
;; NOTE Move your cursor over a module's name (or its flags) and press 'K' (or
|
;; NOTE Move your cursor over a module's name (or its flags) and press 'K' (or
|
||||||
;; 'C-c g k' for non-vim users) to view its documentation. This works on
|
;; 'C-c g k' for non-vim users) to view its documentation. This works on
|
||||||
|
@ -34,17 +34,17 @@
|
||||||
;;hydra
|
;;hydra
|
||||||
;;indent-guides ; highlighted indent columns
|
;;indent-guides ; highlighted indent columns
|
||||||
modeline ; snazzy, Atom-inspired modeline, plus API
|
modeline ; snazzy, Atom-inspired modeline, plus API
|
||||||
nav-flash ; blink the current line after jumping
|
;;nav-flash ; blink cursor line after big motions
|
||||||
;;neotree ; a project drawer, like NERDTree for vim
|
;;neotree ; a project drawer, like NERDTree for vim
|
||||||
ophints ; highlight the region an operation acts on
|
ophints ; highlight the region an operation acts on
|
||||||
(popup +defaults) ; tame sudden yet inevitable temporary windows
|
(popup +defaults) ; tame sudden yet inevitable temporary windows
|
||||||
;;pretty-code ; replace bits of code with pretty symbols
|
;;pretty-code ; ligatures or substitute text with pretty symbols
|
||||||
;;tabs ; an tab bar for Emacs
|
;;tabs ; an tab bar for Emacs
|
||||||
;;treemacs ; a project drawer, like neotree but cooler
|
;;treemacs ; a project drawer, like neotree but cooler
|
||||||
;;unicode ; extended unicode support for various languages
|
;;unicode ; extended unicode support for various languages
|
||||||
vc-gutter ; vcs diff in the fringe
|
vc-gutter ; vcs diff in the fringe
|
||||||
vi-tilde-fringe ; fringe tildes to mark beyond EOB
|
vi-tilde-fringe ; fringe tildes to mark beyond EOB
|
||||||
window-select ; visually switch windows
|
;;window-select ; visually switch windows
|
||||||
workspaces ; tab emulation, persistence & separate workspaces
|
workspaces ; tab emulation, persistence & separate workspaces
|
||||||
;;zen ; distraction-free coding or writing
|
;;zen ; distraction-free coding or writing
|
||||||
|
|
||||||
|
@ -66,13 +66,14 @@
|
||||||
dired ; making dired pretty [functional]
|
dired ; making dired pretty [functional]
|
||||||
electric ; smarter, keyword-based electric-indent
|
electric ; smarter, keyword-based electric-indent
|
||||||
;;ibuffer ; interactive buffer management
|
;;ibuffer ; interactive buffer management
|
||||||
|
undo ; persistent, smarter undo for your inevitable mistakes
|
||||||
vc ; version-control and Emacs, sitting in a tree
|
vc ; version-control and Emacs, sitting in a tree
|
||||||
|
|
||||||
:term
|
:term
|
||||||
;;eshell ; a consistent, cross-platform shell (WIP)
|
;;eshell ; the elisp shell that works everywhere
|
||||||
;;shell ; a terminal REPL for Emacs
|
;;shell ; simple shell REPL for Emacs
|
||||||
;;term ; terminals in Emacs
|
;;term ; basic terminal emulator for Emacs
|
||||||
;;vterm ; another terminals in Emacs
|
;;vterm ; the best terminal emulation in Emacs
|
||||||
|
|
||||||
:checkers
|
:checkers
|
||||||
syntax ; tasing you for every semicolon you forget
|
syntax ; tasing you for every semicolon you forget
|
||||||
|
@ -103,14 +104,14 @@
|
||||||
|
|
||||||
:lang
|
:lang
|
||||||
;;agda ; types of types of types of types...
|
;;agda ; types of types of types of types...
|
||||||
;;assembly ; assembly for fun or debugging
|
|
||||||
;;cc ; C/C++/Obj-C madness
|
;;cc ; C/C++/Obj-C madness
|
||||||
;;clojure ; java with a lisp
|
;;clojure ; java with a lisp
|
||||||
;;common-lisp ; if you've seen one lisp, you've seen them all
|
;;common-lisp ; if you've seen one lisp, you've seen them all
|
||||||
;;coq ; proofs-as-programs
|
;;coq ; proofs-as-programs
|
||||||
;;crystal ; ruby at the speed of c
|
;;crystal ; ruby at the speed of c
|
||||||
;;csharp ; unity, .NET, and mono shenanigans
|
;;csharp ; unity, .NET, and mono shenanigans
|
||||||
data ; config/data formats
|
;;data ; config/data formats
|
||||||
|
;;(dart +flutter) ; paint ui and not much else
|
||||||
;;elixir ; erlang done right
|
;;elixir ; erlang done right
|
||||||
;;elm ; care for a cup of TEA?
|
;;elm ; care for a cup of TEA?
|
||||||
emacs-lisp ; drown in parentheses
|
emacs-lisp ; drown in parentheses
|
||||||
|
@ -119,10 +120,11 @@
|
||||||
;;faust ; dsp, but you get to keep your soul
|
;;faust ; dsp, but you get to keep your soul
|
||||||
;;fsharp ; ML stands for Microsoft's Language
|
;;fsharp ; ML stands for Microsoft's Language
|
||||||
;;fstar ; (dependent) types and (monadic) effects and Z3
|
;;fstar ; (dependent) types and (monadic) effects and Z3
|
||||||
;;go ; the hipster dialect
|
;;(go +lsp) ; the hipster dialect
|
||||||
;;(haskell +dante) ; a language that's lazier than I am
|
;;(haskell +dante) ; a language that's lazier than I am
|
||||||
;;hy ; readability of scheme w/ speed of python
|
;;hy ; readability of scheme w/ speed of python
|
||||||
;;idris ;
|
;;idris ;
|
||||||
|
;;json ; At least it ain't XML
|
||||||
;;(java +meghanada) ; the poster child for carpal tunnel syndrome
|
;;(java +meghanada) ; the poster child for carpal tunnel syndrome
|
||||||
;;javascript ; all(hope(abandon(ye(who(enter(here))))))
|
;;javascript ; all(hope(abandon(ye(who(enter(here))))))
|
||||||
;;julia ; a better, faster MATLAB
|
;;julia ; a better, faster MATLAB
|
||||||
|
@ -136,13 +138,7 @@
|
||||||
;;nim ; python + lisp at the speed of c
|
;;nim ; python + lisp at the speed of c
|
||||||
;;nix ; I hereby declare "nix geht mehr!"
|
;;nix ; I hereby declare "nix geht mehr!"
|
||||||
;;ocaml ; an objective camel
|
;;ocaml ; an objective camel
|
||||||
(org ; organize your plain life in plain text
|
org ; organize your plain life in plain text
|
||||||
+dragndrop ; drag & drop files/images into org buffers
|
|
||||||
;;+hugo ; use Emacs for hugo blogging
|
|
||||||
;;+jupyter ; ipython/jupyter support for babel
|
|
||||||
;;+pandoc ; export-with-pandoc support
|
|
||||||
;;+pomodoro ; be fruitful with the tomato technique
|
|
||||||
+present) ; using org-mode for presentations
|
|
||||||
;;perl ; write code no one else can comprehend
|
;;perl ; write code no one else can comprehend
|
||||||
;;php ; perl's insecure younger brother
|
;;php ; perl's insecure younger brother
|
||||||
;;plantuml ; diagrams for confusing people more
|
;;plantuml ; diagrams for confusing people more
|
||||||
|
@ -157,10 +153,12 @@
|
||||||
;;scala ; java, but good
|
;;scala ; java, but good
|
||||||
;;scheme ; a fully conniving family of lisps
|
;;scheme ; a fully conniving family of lisps
|
||||||
sh ; she sells {ba,z,fi}sh shells on the C xor
|
sh ; she sells {ba,z,fi}sh shells on the C xor
|
||||||
|
;;sml
|
||||||
;;solidity ; do you need a blockchain? No.
|
;;solidity ; do you need a blockchain? No.
|
||||||
;;swift ; who asked for emoji variables?
|
;;swift ; who asked for emoji variables?
|
||||||
;;terra ; Earth and Moon in alignment for performance.
|
;;terra ; Earth and Moon in alignment for performance.
|
||||||
;;web ; the tubes
|
;;web ; the tubes
|
||||||
|
;;yaml ; JSON, but readable
|
||||||
|
|
||||||
:email
|
:email
|
||||||
;;(mu4e +gmail)
|
;;(mu4e +gmail)
|
||||||
|
|
|
@ -7,12 +7,14 @@
|
||||||
(not inhibit-workspace))
|
(not inhibit-workspace))
|
||||||
(+workspace-switch +irc--workspace-name 'auto-create))
|
(+workspace-switch +irc--workspace-name 'auto-create))
|
||||||
(let ((buffers (doom-buffers-in-mode 'circe-mode nil t)))
|
(let ((buffers (doom-buffers-in-mode 'circe-mode nil t)))
|
||||||
(if buffers
|
(if (not (member (window-buffer) buffers))
|
||||||
(ignore (switch-to-buffer (car buffers)))
|
(if buffers
|
||||||
(require 'circe)
|
(ignore (switch-to-buffer (car buffers)))
|
||||||
(delete-other-windows)
|
(require 'circe)
|
||||||
(switch-to-buffer (doom-fallback-buffer))
|
(delete-other-windows)
|
||||||
t)))
|
(switch-to-buffer (doom-fallback-buffer))
|
||||||
|
t)
|
||||||
|
(user-error "IRC buffer is already active and selected"))))
|
||||||
|
|
||||||
;;;###autoload
|
;;;###autoload
|
||||||
(defun =irc (&optional inhibit-workspace)
|
(defun =irc (&optional inhibit-workspace)
|
||||||
|
|
|
@ -48,7 +48,6 @@ playback.")
|
||||||
|
|
||||||
(use-package! circe
|
(use-package! circe
|
||||||
:commands circe circe-server-buffers
|
:commands circe circe-server-buffers
|
||||||
:init (setq circe-network-defaults nil)
|
|
||||||
:config
|
:config
|
||||||
(setq circe-default-quit-message nil
|
(setq circe-default-quit-message nil
|
||||||
circe-default-part-message nil
|
circe-default-part-message nil
|
||||||
|
@ -95,6 +94,25 @@ playback.")
|
||||||
(add-hook 'circe-mode-hook #'+irc--add-circe-buffer-to-persp-h)
|
(add-hook 'circe-mode-hook #'+irc--add-circe-buffer-to-persp-h)
|
||||||
(add-hook 'circe-mode-hook #'turn-off-smartparens-mode)
|
(add-hook 'circe-mode-hook #'turn-off-smartparens-mode)
|
||||||
|
|
||||||
|
;; HACK Fix #1862: circe hangs on TLS connections when using OpenSSL versions
|
||||||
|
;; > 1.1.0, where tls.el does not correctly determine the end of the info
|
||||||
|
;; block. This fixes proposed in jorgenschaefer/circe#340
|
||||||
|
(setq-hook! 'circe-mode-hook
|
||||||
|
tls-end-of-info
|
||||||
|
(concat "\\("
|
||||||
|
;; `openssl s_client' regexp. See ssl/ssl_txt.c lines 219-220.
|
||||||
|
;; According to apps/s_client.c line 1515 `---' is always the last
|
||||||
|
;; line that is printed by s_client before the real data.
|
||||||
|
"^ Verify return code: .+\n\\(\\|^ Extended master secret: .+\n\\)\\(\\|^ Max Early Data: .+\n\\)---\n\\|"
|
||||||
|
;; `gnutls' regexp. See src/cli.c lines 721-.
|
||||||
|
"^- Simple Client Mode:\n"
|
||||||
|
"\\(\n\\|" ; ignore blank lines
|
||||||
|
;; According to GnuTLS v2.1.5 src/cli.c lines 640-650 and 705-715 in
|
||||||
|
;; `main' the handshake will start after this message. If the
|
||||||
|
;; handshake fails, the programs will abort.
|
||||||
|
"^\\*\\*\\* Starting TLS handshake\n\\)*"
|
||||||
|
"\\)"))
|
||||||
|
|
||||||
(defadvice! +irc--circe-run-disconnect-hook-a (&rest _)
|
(defadvice! +irc--circe-run-disconnect-hook-a (&rest _)
|
||||||
"Runs `+irc-disconnect-hook' after circe disconnects."
|
"Runs `+irc-disconnect-hook' after circe disconnects."
|
||||||
:after #'circe--irc-conn-disconnected
|
:after #'circe--irc-conn-disconnected
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
;; -*- no-byte-compile: t; -*-
|
;; -*- no-byte-compile: t; -*-
|
||||||
;;; app/irc/packages.el
|
;;; app/irc/packages.el
|
||||||
|
|
||||||
(package! circe :pin "0c79138fb2")
|
(package! circe :pin "e5bf5f8974")
|
||||||
(package! circe-notifications :pin "291149ac12")
|
(package! circe-notifications :pin "291149ac12")
|
||||||
|
|
|
@ -1,14 +0,0 @@
|
||||||
;;; app/regex/autoload/export.el
|
|
||||||
|
|
||||||
;;;###autoload
|
|
||||||
(defun +regex/export () (interactive)) ; TODO +regex/export
|
|
||||||
|
|
||||||
|
|
||||||
;;
|
|
||||||
(defun +regex-export-python ()) ; import (re|regex)
|
|
||||||
|
|
||||||
(defun +regex-export-php ()) ; preg_(match(_all)?|replace)
|
|
||||||
|
|
||||||
(defun +regex-export-ruby ()) ; %r[.+]
|
|
||||||
|
|
||||||
(defun +regex-export-js ()) ; /.+/
|
|
|
@ -1,272 +0,0 @@
|
||||||
;;; app/regex/autoload/regex.el
|
|
||||||
|
|
||||||
(defvar +regex--text-buffer nil)
|
|
||||||
(defvar +regex--text-replace-buffer nil)
|
|
||||||
(defvar +regex--expr-buffer nil)
|
|
||||||
(defvar +regex--expr-replace-buffer nil)
|
|
||||||
(defvar +regex--groups-buffer nil)
|
|
||||||
(defvar +regex--replace-buffer nil)
|
|
||||||
|
|
||||||
;;
|
|
||||||
(defface +regex-match-0-face
|
|
||||||
`((t (:foreground "Black" :background ,(doom-color 'magenta) :bold t)))
|
|
||||||
"TODO"
|
|
||||||
:group 'faces)
|
|
||||||
|
|
||||||
(defface +regex-match-1-face
|
|
||||||
`((t (:foreground "Black" :background ,(doom-color 'blue) :bold t)))
|
|
||||||
"TODO"
|
|
||||||
:group 'faces)
|
|
||||||
|
|
||||||
(defface +regex-match-2-face
|
|
||||||
`((t (:foreground "Black" :background ,(doom-color 'green) :bold t)))
|
|
||||||
"TODO"
|
|
||||||
:group 'faces)
|
|
||||||
|
|
||||||
(defvar +regex-faces
|
|
||||||
'(+regex-match-0-face +regex-match-1-face +regex-match-2-face)
|
|
||||||
"TODO")
|
|
||||||
|
|
||||||
;;
|
|
||||||
(defvar +regex-mode-map
|
|
||||||
(let ((map (make-sparse-keymap)))
|
|
||||||
(define-key map "\C-c\C-c" #'+regex-update-buffers)
|
|
||||||
(define-key map "\C-c\C-r" #'=regex/replace)
|
|
||||||
(define-key map "\C-c\C-k" #'+regex/quit)
|
|
||||||
(define-key map [remap kill-current-buffer] #'+regex/quit)
|
|
||||||
(define-key map [remap kill-buffer] #'+regex/quit)
|
|
||||||
map)
|
|
||||||
"TODO")
|
|
||||||
|
|
||||||
;;;###autoload
|
|
||||||
(define-minor-mode +regex-mode
|
|
||||||
"TODO"
|
|
||||||
:init-value nil
|
|
||||||
:global nil
|
|
||||||
:lighter ""
|
|
||||||
:keymap +regex-mode-map
|
|
||||||
(if +regex-mode
|
|
||||||
(add-hook 'after-change-functions #'+regex-update-buffers nil t)
|
|
||||||
(remove-hook 'after-change-functions #'+regex-update-buffers t)))
|
|
||||||
|
|
||||||
;;;###autoload
|
|
||||||
(defun =regex (&optional dummy-text)
|
|
||||||
"Start the Regex IDE."
|
|
||||||
(interactive "P")
|
|
||||||
(unless (buffer-live-p +regex--expr-buffer)
|
|
||||||
(condition-case ex
|
|
||||||
(progn
|
|
||||||
(setq +regex--expr-buffer (get-buffer-create "*doom-regex*")
|
|
||||||
+regex--text-buffer (if dummy-text (get-buffer-create "*doom-regex-text*") (current-buffer))
|
|
||||||
+regex--groups-buffer (get-buffer-create "*doom-regex-groups*"))
|
|
||||||
(when dummy-text
|
|
||||||
(+workspace-switch +regex-workspace-name t)
|
|
||||||
(switch-to-buffer +regex--text-buffer)
|
|
||||||
(with-current-buffer +regex--text-buffer
|
|
||||||
(insert +regex-dummy-text)))
|
|
||||||
(pop-to-buffer +regex--groups-buffer)
|
|
||||||
(pop-to-buffer +regex--expr-buffer)
|
|
||||||
(with-current-buffer +regex--expr-buffer
|
|
||||||
(conf-mode)
|
|
||||||
(rainbow-delimiters-mode +1)
|
|
||||||
(doom/toggle-line-numbers +1)
|
|
||||||
(setq-local require-final-newline nil)
|
|
||||||
(+regex-mode +1)
|
|
||||||
(text-scale-set 3)))
|
|
||||||
('error
|
|
||||||
(+regex/quit)
|
|
||||||
(error "Failed to open the Regexp IDE: %s" ex)))))
|
|
||||||
|
|
||||||
;;;###autoload
|
|
||||||
(defun =regex/replace ()
|
|
||||||
(interactive)
|
|
||||||
(unless (buffer-live-p +regex--replace-buffer)
|
|
||||||
(let (text)
|
|
||||||
(=regex t)
|
|
||||||
(with-selected-window (get-buffer-window +regex--text-buffer)
|
|
||||||
(setq text (buffer-string))
|
|
||||||
(select-window (split-window-right))
|
|
||||||
(switch-to-buffer (get-buffer-create "*doom-regex-text-repl*"))
|
|
||||||
(erase-buffer)
|
|
||||||
(insert text)
|
|
||||||
(read-only-mode +1)
|
|
||||||
(setq +regex--text-replace-buffer (current-buffer)))
|
|
||||||
(with-current-buffer +regex--expr-buffer
|
|
||||||
(select-window (split-window-right))
|
|
||||||
(switch-to-buffer (get-buffer-create "*doom-regex-repl*"))
|
|
||||||
(conf-mode)
|
|
||||||
(rainbow-delimiters-mode +1)
|
|
||||||
(doom/toggle-line-numbers -1)
|
|
||||||
(setq-local require-final-newline nil)
|
|
||||||
(setq mode-line-format nil
|
|
||||||
+regex--expr-replace-buffer (current-buffer))
|
|
||||||
(+regex-mode +1)
|
|
||||||
(text-scale-set 3)))))
|
|
||||||
|
|
||||||
;;;###autoload
|
|
||||||
(defun +regex/quit ()
|
|
||||||
"TODO"
|
|
||||||
(interactive)
|
|
||||||
(when (and +regex--text-buffer (buffer-live-p +regex--text-buffer))
|
|
||||||
(with-current-buffer +regex--text-buffer
|
|
||||||
(+regex-mode -1)
|
|
||||||
(remove-overlays nil nil 'category '+regex))
|
|
||||||
(when (equal (buffer-name +regex--text-buffer) "*doom-regex-text*")
|
|
||||||
(kill-buffer +regex--text-buffer)))
|
|
||||||
(when (equal (+workspace-current-name) +regex-workspace-name)
|
|
||||||
(+workspace/delete +regex-workspace-name))
|
|
||||||
(mapc (lambda (bufname)
|
|
||||||
(let ((buf (symbol-value bufname)))
|
|
||||||
(when (and buf (buffer-live-p buf))
|
|
||||||
(kill-buffer buf)
|
|
||||||
(set bufname nil))))
|
|
||||||
(list '+regex--text-replace-buffer
|
|
||||||
'+regex--expr-replace-buffer
|
|
||||||
'+regex--expr-buffer
|
|
||||||
'+regex--groups-buffer
|
|
||||||
'+regex--replace-buffer)))
|
|
||||||
|
|
||||||
(defun +regex--expr ()
|
|
||||||
(when (buffer-live-p +regex--expr-buffer)
|
|
||||||
(with-current-buffer +regex--expr-buffer
|
|
||||||
(string-trim (buffer-string)))))
|
|
||||||
|
|
||||||
(defun +regex--expr-replace ()
|
|
||||||
(when (buffer-live-p +regex--expr-replace-buffer)
|
|
||||||
(with-current-buffer +regex--expr-replace-buffer
|
|
||||||
(string-trim (buffer-string)))))
|
|
||||||
|
|
||||||
;;;###autoload
|
|
||||||
(defun +regex-update-buffers (&optional beg end len)
|
|
||||||
(interactive)
|
|
||||||
(let* ((inhibit-read-only t)
|
|
||||||
(regex (or (+regex--expr) ""))
|
|
||||||
(replace (or (+regex--expr-replace) ""))
|
|
||||||
(str (or (with-current-buffer +regex--text-buffer (buffer-string)) "")))
|
|
||||||
(with-current-buffer +regex--groups-buffer
|
|
||||||
(erase-buffer))
|
|
||||||
(with-current-buffer +regex--text-buffer
|
|
||||||
(remove-overlays nil nil 'category '+regex)
|
|
||||||
(when (> (length regex) 0)
|
|
||||||
(save-excursion
|
|
||||||
(goto-char (point-min))
|
|
||||||
(pcase +regex-default-backend
|
|
||||||
('emacs (+regex-backend-emacs regex replace str))
|
|
||||||
('perl (+regex-backend-perl regex replace str))))))
|
|
||||||
(with-current-buffer +regex--groups-buffer
|
|
||||||
(goto-char (point-min)))))
|
|
||||||
|
|
||||||
|
|
||||||
;; --- backends ---------------------------
|
|
||||||
|
|
||||||
(defun +regex--render-perl (regex text)
|
|
||||||
"From <https://github.com/jwiegley/regex-tool>"
|
|
||||||
(with-temp-buffer
|
|
||||||
(insert (format "@lines = <DATA>;
|
|
||||||
$line = join(\"\", @lines);
|
|
||||||
print \"(\";
|
|
||||||
while ($line =~ m/%s/gm) {
|
|
||||||
print \"(\", length($`), \" \", length($&), \" \";
|
|
||||||
for $i (1 .. 20) {
|
|
||||||
if ($$i) {
|
|
||||||
my $group = $$i;
|
|
||||||
$group =~ s/([\\\\\"])/\\\\\\1/g;
|
|
||||||
print \"(\", $i, \" . \\\"\", $group, \"\\\") \";
|
|
||||||
}
|
|
||||||
}
|
|
||||||
print \")\";
|
|
||||||
}
|
|
||||||
print \")\";
|
|
||||||
__DATA__
|
|
||||||
%s" (replace-regexp-in-string "/" "\\/" regex nil t) text))
|
|
||||||
(call-process-region (point-min) (point-max) "perl" t t)
|
|
||||||
(goto-char (point-min))
|
|
||||||
(read (current-buffer))))
|
|
||||||
|
|
||||||
(defun +regex--replace-perl (regex replace text)
|
|
||||||
(unless (or (string-empty-p regex)
|
|
||||||
(string-empty-p replace)
|
|
||||||
(string-empty-p text))
|
|
||||||
(with-temp-buffer
|
|
||||||
(insert (format "@lines = <DATA>;
|
|
||||||
$line = join(\"\", @lines);
|
|
||||||
$line =~ s/%s/%s/gm;
|
|
||||||
print $line;
|
|
||||||
__DATA__
|
|
||||||
%s" (replace-regexp-in-string "/" "\\/" regex nil t) (replace-regexp-in-string "/" "\\/" replace nil t) text))
|
|
||||||
(call-process-region (point-min) (point-max) "perl" t t)
|
|
||||||
(buffer-string))))
|
|
||||||
|
|
||||||
;;;###autoload
|
|
||||||
(defun +regex-backend-perl (regex replace str)
|
|
||||||
"TODO"
|
|
||||||
(cl-assert (stringp regex))
|
|
||||||
(cl-assert (stringp replace))
|
|
||||||
(cl-assert (stringp str))
|
|
||||||
(let ((i 0)
|
|
||||||
(results (+regex--render-perl regex str)))
|
|
||||||
(when (buffer-live-p +regex--text-replace-buffer)
|
|
||||||
(let ((replace (+regex--replace-perl regex replace str)))
|
|
||||||
(with-current-buffer +regex--text-replace-buffer
|
|
||||||
(erase-buffer)
|
|
||||||
(insert
|
|
||||||
(if (and (listp results)
|
|
||||||
replace
|
|
||||||
(not (string-empty-p replace)))
|
|
||||||
replace
|
|
||||||
str)))))
|
|
||||||
(dolist (result (if (listp results) results))
|
|
||||||
(let* ((offset (nth 0 result))
|
|
||||||
(length (nth 1 result))
|
|
||||||
(matches (nthcdr 2 result))
|
|
||||||
(ov (make-overlay (1+ offset) (+ offset length 1))))
|
|
||||||
(overlay-put ov 'face (nth (mod i 3) +regex-faces))
|
|
||||||
(overlay-put ov 'category '+regex)
|
|
||||||
(cl-incf i)
|
|
||||||
(let* ((match-zero (buffer-substring (1+ offset) (+ offset length 1)))
|
|
||||||
(line (format "Match: %s\n" (propertize match-zero 'face 'font-lock-string-face))))
|
|
||||||
(with-current-buffer +regex--groups-buffer
|
|
||||||
(insert line)))
|
|
||||||
(dolist (match matches)
|
|
||||||
(with-current-buffer +regex--groups-buffer
|
|
||||||
(goto-char (point-max))
|
|
||||||
(insert (format "Group %d: %s\n"
|
|
||||||
(propertize (car match) 'face 'font-lock-constant-face)
|
|
||||||
(propertize (cdr match) 'face 'font-lock-string-face)))))
|
|
||||||
(with-current-buffer +regex--groups-buffer
|
|
||||||
(insert ?\n))))))
|
|
||||||
|
|
||||||
;;;###autoload
|
|
||||||
(defun +regex-backend-emacs (regex replace str)
|
|
||||||
"TODO"
|
|
||||||
(cl-assert (stringp regex))
|
|
||||||
(cl-assert (stringp replace))
|
|
||||||
(cl-assert (stringp str))
|
|
||||||
(let ((i 0)
|
|
||||||
pos)
|
|
||||||
(when (buffer-live-p +regex--text-replace-buffer)
|
|
||||||
(with-current-buffer +regex--text-replace-buffer
|
|
||||||
(erase-buffer)
|
|
||||||
(insert str)
|
|
||||||
(when (and (listp results) (string-empty-p replace))
|
|
||||||
(replace-regexp regex replace))))
|
|
||||||
(while (and (setq pos (point))
|
|
||||||
(re-search-forward regex nil t))
|
|
||||||
(if (= (point) pos)
|
|
||||||
(forward-char 1)
|
|
||||||
(let ((ov (make-overlay (match-beginning 0) (match-end 0))))
|
|
||||||
(overlay-put ov 'face (nth (mod i 3) +regex-faces))
|
|
||||||
(overlay-put ov 'category '+regex))
|
|
||||||
(cl-incf i)
|
|
||||||
(dotimes (i 10)
|
|
||||||
(when-let (text (match-string i))
|
|
||||||
(save-match-data
|
|
||||||
(with-current-buffer +regex--groups-buffer
|
|
||||||
(goto-char (point-max))
|
|
||||||
(insert
|
|
||||||
(format "Group %d: %s\n"
|
|
||||||
(propertize i 'face 'font-lock-constant-face)
|
|
||||||
(propertize text 'face 'font-lock-string-face)))))))
|
|
||||||
(with-current-buffer +regex--groups-buffer
|
|
||||||
(insert ?\n))))))
|
|
||||||
|
|
|
@ -1,51 +0,0 @@
|
||||||
;;; app/regex/config.el
|
|
||||||
|
|
||||||
;; Often, I find myself writing regular expressions that could terrify seasoned
|
|
||||||
;; programmers (or little children). To hone my regex fu, I need a regex
|
|
||||||
;; playground. Sure, there's regexr.com, but don't be silly, that's not Emacs.
|
|
||||||
;;
|
|
||||||
;; Sadly, the Emacs' regex syntax is niche and lacks support for a few
|
|
||||||
;; questionably useful features, like lookaround assertions, conditionals, case
|
|
||||||
;; modifiers or backreferences, among others. No, I want PCRE. I am going to
|
|
||||||
;; have my cake and eat it too, damn it!
|
|
||||||
;;
|
|
||||||
;; Workflow:
|
|
||||||
;; + Invoke `=regex' (if opened with C-u, opens in separate workspace with a
|
|
||||||
;; dummy text buffer).
|
|
||||||
;; + A regex window will popup up. Any matches will be highlighted in the
|
|
||||||
;; original buffer.
|
|
||||||
;; + C-c C-k to close it
|
|
||||||
;; + TODO C-c C-e to export to various langauges
|
|
||||||
;;
|
|
||||||
;; WARNING: THIS IS A WORK IN PROGRESS
|
|
||||||
|
|
||||||
(defvar +regex-workspace-name "*regex*"
|
|
||||||
"TODO")
|
|
||||||
|
|
||||||
(defvar +regex-default-backend 'perl
|
|
||||||
"The backend used to process regular expressions.
|
|
||||||
The `emacs' backend handles regular expressions directly.
|
|
||||||
The `perl' backend talks to a perl subprocess to do the handling.")
|
|
||||||
|
|
||||||
(defvar +regex-dummy-text
|
|
||||||
"Welcome to DOOM Emacs, proudly hosted by the demons of hell!
|
|
||||||
|
|
||||||
Edit the Expression & Text to see matches. Roll over matches or the expression
|
|
||||||
for details. Undo mistakes with ctrl-z. Save Favorites & Share expressions with
|
|
||||||
friends or the Community. Explore your results with Tools. A full Reference &
|
|
||||||
Help is available in the Library, or watch the video Tutorial.
|
|
||||||
|
|
||||||
Sample text for testing:
|
|
||||||
abcdefghijklmnopqrstuvwxyz ABCDEFGHIJKLMNOPQRSTUVWXYZ
|
|
||||||
0123456789 _+-.,!@#$%^&*();\/|<>\"'
|
|
||||||
12345 -98.7 3.141 .6180 9,000 +42
|
|
||||||
555.123.4567 +1-(800)-555-2468
|
|
||||||
foo@demo.net bar.ba@test.co.uk
|
|
||||||
www.demo.com http://foo.co.uk/
|
|
||||||
http://regexr.com/foo.html?q=bar
|
|
||||||
https://mediatemple.net"
|
|
||||||
"TODO")
|
|
||||||
|
|
||||||
(set-popup-rules!
|
|
||||||
'(("^\\*doom-regex\\*$" :size 4 :quit nil)
|
|
||||||
("^\\*doom-regex-groups" :side 'left :size 28 :select nil :quit nil)))
|
|
|
@ -1,5 +1,5 @@
|
||||||
;; -*- no-byte-compile: t; -*-
|
;; -*- no-byte-compile: t; -*-
|
||||||
;;; app/rss/packages.el
|
;;; app/rss/packages.el
|
||||||
|
|
||||||
(package! elfeed :pin "3f0edb1737")
|
(package! elfeed :pin "d0405e6386")
|
||||||
(package! elfeed-org :pin "77b6bbf222")
|
(package! elfeed-org :pin "77b6bbf222")
|
||||||
|
|
|
@ -2,4 +2,4 @@
|
||||||
;;; app/twitter/packages.el
|
;;; app/twitter/packages.el
|
||||||
|
|
||||||
(package! twittering-mode :pin "114891e8fd")
|
(package! twittering-mode :pin "114891e8fd")
|
||||||
(package! avy :pin "cf95ba9582")
|
(package! avy :pin "3bf83140fa")
|
||||||
|
|
|
@ -7,7 +7,8 @@
|
||||||
langtool-correct-buffer)
|
langtool-correct-buffer)
|
||||||
:init (setq langtool-default-language "en-US")
|
:init (setq langtool-default-language "en-US")
|
||||||
:config
|
:config
|
||||||
(unless langtool-language-tool-jar
|
(unless (or langtool-bin
|
||||||
|
langtool-language-tool-jar)
|
||||||
(setq langtool-language-tool-jar
|
(setq langtool-language-tool-jar
|
||||||
(cond (IS-MAC
|
(cond (IS-MAC
|
||||||
(locate-file "libexec/languagetool-commandline.jar"
|
(locate-file "libexec/languagetool-commandline.jar"
|
||||||
|
|
|
@ -65,10 +65,10 @@
|
||||||
(defun +spell-inhibit-duplicate-detection-maybe-h ()
|
(defun +spell-inhibit-duplicate-detection-maybe-h ()
|
||||||
"Don't mark duplicates when style/grammar linters are present.
|
"Don't mark duplicates when style/grammar linters are present.
|
||||||
e.g. proselint and langtool."
|
e.g. proselint and langtool."
|
||||||
(when (or (and (bound-and-true-p flycheck-mode)
|
(and (or (and (bound-and-true-p flycheck-mode)
|
||||||
(executable-find "proselint"))
|
(executable-find "proselint"))
|
||||||
(featurep 'langtool))
|
(featurep 'langtool))
|
||||||
(setq-local flyspell-mark-duplications-flag nil))))
|
(setq-local flyspell-mark-duplications-flag nil))))
|
||||||
|
|
||||||
;; Ensure mode-local predicates declared with `set-flyspell-predicate!' are
|
;; Ensure mode-local predicates declared with `set-flyspell-predicate!' are
|
||||||
;; used in their respective major modes.
|
;; used in their respective major modes.
|
||||||
|
|
|
@ -10,9 +10,14 @@
|
||||||
(setq flycheck-emacs-lisp-load-path 'inherit)
|
(setq flycheck-emacs-lisp-load-path 'inherit)
|
||||||
|
|
||||||
;; Check only when saving or opening files. Newline & idle checks are a mote
|
;; Check only when saving or opening files. Newline & idle checks are a mote
|
||||||
;; excessive, especially when that can easily catch code in an incomplete
|
;; excessive and can catch code in an incomplete state, producing false
|
||||||
;; state, so we removed them.
|
;; positives, so we removed them.
|
||||||
(setq flycheck-check-syntax-automatically '(save mode-enabled))
|
(setq flycheck-check-syntax-automatically '(save mode-enabled idle-buffer-switch))
|
||||||
|
|
||||||
|
;; For the above functionality, check syntax in a buffer that you switched to
|
||||||
|
;; only briefly. This allows "refreshing" the syntax check state for several
|
||||||
|
;; buffers quickly after e.g. changing a config file.
|
||||||
|
(setq flycheck-buffer-switch-check-intermediate-buffers t)
|
||||||
|
|
||||||
;; Display errors a little quicker (default is 0.9s)
|
;; Display errors a little quicker (default is 0.9s)
|
||||||
(setq flycheck-display-errors-delay 0.25)
|
(setq flycheck-display-errors-delay 0.25)
|
||||||
|
@ -41,7 +46,7 @@
|
||||||
|
|
||||||
(use-package! flycheck-popup-tip
|
(use-package! flycheck-popup-tip
|
||||||
:commands flycheck-popup-tip-show-popup flycheck-popup-tip-delete-popup
|
:commands flycheck-popup-tip-show-popup flycheck-popup-tip-delete-popup
|
||||||
:init (add-hook 'flycheck-mode-hook #'+syntax-init-popups-h)
|
:hook (flycheck-mode . +syntax-init-popups-h)
|
||||||
:config
|
:config
|
||||||
(setq flycheck-popup-tip-error-prefix "✕ ")
|
(setq flycheck-popup-tip-error-prefix "✕ ")
|
||||||
(after! evil
|
(after! evil
|
||||||
|
@ -58,8 +63,7 @@
|
||||||
|
|
||||||
(use-package! flycheck-posframe
|
(use-package! flycheck-posframe
|
||||||
:when (featurep! +childframe)
|
:when (featurep! +childframe)
|
||||||
:defer t
|
:hook (flycheck-mode . +syntax-init-popups-h)
|
||||||
:init (add-hook 'flycheck-mode-hook #'+syntax-init-popups-h)
|
|
||||||
:config
|
:config
|
||||||
(setq flycheck-posframe-warning-prefix "⚠ "
|
(setq flycheck-posframe-warning-prefix "⚠ "
|
||||||
flycheck-posframe-info-prefix "··· "
|
flycheck-posframe-info-prefix "··· "
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
;; -*- no-byte-compile: t; -*-
|
;; -*- no-byte-compile: t; -*-
|
||||||
;;; checkers/syntax/packages.el
|
;;; checkers/syntax/packages.el
|
||||||
|
|
||||||
(package! flycheck :pin "08345d38e2")
|
(package! flycheck :pin "f19a51c0f1")
|
||||||
(package! flycheck-popup-tip :pin "ef86aad907")
|
(package! flycheck-popup-tip :pin "ef86aad907")
|
||||||
(when (featurep! +childframe)
|
(when (featurep! +childframe)
|
||||||
(package! flycheck-posframe :pin "2b3e94c2e4"))
|
(package! flycheck-posframe :pin "2b3e94c2e4"))
|
||||||
|
|
|
@ -4,24 +4,23 @@
|
||||||
:commands company-complete-common company-manual-begin company-grab-line
|
:commands company-complete-common company-manual-begin company-grab-line
|
||||||
:after-call pre-command-hook after-find-file
|
:after-call pre-command-hook after-find-file
|
||||||
:init
|
:init
|
||||||
(setq company-minimum-prefix-length 2
|
(setq company-idle-delay 0.25
|
||||||
|
company-minimum-prefix-length 2
|
||||||
company-tooltip-limit 14
|
company-tooltip-limit 14
|
||||||
company-dabbrev-downcase nil
|
|
||||||
company-dabbrev-ignore-case nil
|
|
||||||
company-dabbrev-code-other-buffers t
|
|
||||||
company-tooltip-align-annotations t
|
company-tooltip-align-annotations t
|
||||||
company-require-match 'never
|
company-require-match 'never
|
||||||
company-global-modes
|
company-global-modes
|
||||||
'(not erc-mode message-mode help-mode gud-mode eshell-mode)
|
'(not erc-mode message-mode help-mode gud-mode eshell-mode)
|
||||||
company-backends '(company-capf)
|
company-backends '(company-capf)
|
||||||
company-frontends
|
company-frontends '(company-pseudo-tooltip-frontend
|
||||||
'(company-pseudo-tooltip-frontend
|
company-echo-metadata-frontend))
|
||||||
company-echo-metadata-frontend))
|
|
||||||
:config
|
:config
|
||||||
(when (featurep! :editor evil)
|
(when (featurep! :editor evil)
|
||||||
(add-hook 'company-mode-hook #'evil-normalize-keymaps)
|
(add-hook 'company-mode-hook #'evil-normalize-keymaps)
|
||||||
;; Don't persist company popups when switching back to normal mode.
|
(unless (featurep! +childframe)
|
||||||
(add-hook 'evil-normal-state-entry-hook #'company-abort)
|
;; Don't persist company popups when switching back to normal mode.
|
||||||
|
;; `company-box' aborts on mode switch so it doesn't need this.
|
||||||
|
(add-hook 'evil-normal-state-entry-hook #'company-abort))
|
||||||
;; Allow users to switch between backends on the fly. E.g. C-x C-s followed
|
;; Allow users to switch between backends on the fly. E.g. C-x C-s followed
|
||||||
;; by C-x C-n, will switch from `company-yasnippet' to
|
;; by C-x C-n, will switch from `company-yasnippet' to
|
||||||
;; `company-dabbrev-code'.
|
;; `company-dabbrev-code'.
|
||||||
|
@ -50,8 +49,7 @@
|
||||||
;; Packages
|
;; Packages
|
||||||
|
|
||||||
(after! company-files
|
(after! company-files
|
||||||
(pushnew! company-files--regexps
|
(add-to-list 'company-files--regexps "file:\\(\\(?:\\.\\{1,2\\}/\\|~/\\|/\\)[^\]\n]*\\)"))
|
||||||
"file:\\(\\(?:\\.\\{1,2\\}/\\|~/\\|/\\)[^\]\n]*\\)"))
|
|
||||||
|
|
||||||
|
|
||||||
(use-package! company-prescient
|
(use-package! company-prescient
|
||||||
|
|
|
@ -1,8 +1,8 @@
|
||||||
;; -*- no-byte-compile: t; -*-
|
;; -*- no-byte-compile: t; -*-
|
||||||
;;; completion/company/packages.el
|
;;; completion/company/packages.el
|
||||||
|
|
||||||
(package! company :pin "9de9905ed2")
|
(package! company :pin "61ddd9afb5")
|
||||||
(package! company-dict :pin "cd7b8394f6")
|
(package! company-dict :pin "cd7b8394f6")
|
||||||
(package! company-prescient :pin "7fd8c3b802")
|
(package! company-prescient :pin "53307731f3")
|
||||||
(when (featurep! +childframe)
|
(when (featurep! +childframe)
|
||||||
(package! company-box :pin "8fc6168f2d"))
|
(package! company-box :pin "8fc6168f2d"))
|
||||||
|
|
|
@ -77,35 +77,31 @@ be negative.")
|
||||||
(setq helm-display-function #'+helm-posframe-display-fn))
|
(setq helm-display-function #'+helm-posframe-display-fn))
|
||||||
|
|
||||||
(let ((fuzzy (featurep! +fuzzy)))
|
(let ((fuzzy (featurep! +fuzzy)))
|
||||||
(setq helm-M-x-fuzzy-match fuzzy
|
(setq helm-apropos-fuzzy-match fuzzy
|
||||||
helm-apropos-fuzzy-match fuzzy
|
|
||||||
helm-apropos-fuzzy-match fuzzy
|
|
||||||
helm-bookmark-show-location fuzzy
|
helm-bookmark-show-location fuzzy
|
||||||
helm-buffers-fuzzy-matching fuzzy
|
helm-buffers-fuzzy-matching fuzzy
|
||||||
helm-completion-in-region-fuzzy-match fuzzy
|
|
||||||
helm-completion-in-region-fuzzy-match fuzzy
|
|
||||||
helm-ff-fuzzy-matching fuzzy
|
helm-ff-fuzzy-matching fuzzy
|
||||||
helm-file-cache-fuzzy-match fuzzy
|
helm-file-cache-fuzzy-match fuzzy
|
||||||
helm-flx-for-helm-locate fuzzy
|
helm-flx-for-helm-locate fuzzy
|
||||||
helm-imenu-fuzzy-match fuzzy
|
helm-imenu-fuzzy-match fuzzy
|
||||||
helm-lisp-fuzzy-completion fuzzy
|
helm-lisp-fuzzy-completion fuzzy
|
||||||
helm-locate-fuzzy-match fuzzy
|
helm-locate-fuzzy-match fuzzy
|
||||||
helm-mode-fuzzy-match fuzzy
|
|
||||||
helm-projectile-fuzzy-match fuzzy
|
helm-projectile-fuzzy-match fuzzy
|
||||||
helm-recentf-fuzzy-match fuzzy
|
helm-recentf-fuzzy-match fuzzy
|
||||||
helm-semantic-fuzzy-match fuzzy))
|
helm-semantic-fuzzy-match fuzzy)
|
||||||
|
;; Make sure that we have helm-multi-matching or fuzzy matching,
|
||||||
|
;; (as prescribed by the fuzzy flag) also in the following cases:
|
||||||
|
;; - helmized commands that use `completion-at-point' and similar functions
|
||||||
|
;; - native commands that fall back to `completion-styles' like `helm-M-x'
|
||||||
|
(push (if EMACS27+
|
||||||
|
(if fuzzy 'flex 'helm)
|
||||||
|
(if fuzzy 'helm-flex 'helm))
|
||||||
|
completion-styles))
|
||||||
|
|
||||||
:config
|
:config
|
||||||
(set-popup-rule! "^\\*helm" :vslot -100 :size 0.22 :ttl nil)
|
(set-popup-rule! "^\\*helm" :vslot -100 :size 0.22 :ttl nil)
|
||||||
|
|
||||||
;; HACK Doom doesn't support these commands, which invite the user to install
|
;; Hide the modeline in helm windows as it serves little purpose.
|
||||||
;; the package via ELPA. Force them to use +helm/* instead, because they work
|
|
||||||
;; out of the box.
|
|
||||||
(advice-add #'helm-projectile-rg :override #'+helm/project-search)
|
|
||||||
(advice-add #'helm-projectile-ag :override #'+helm/project-search)
|
|
||||||
(advice-add #'helm-projectile-grep :override #'+helm/project-search)
|
|
||||||
|
|
||||||
;; Hide the modeline
|
|
||||||
(defun +helm--hide-mode-line (&rest _)
|
(defun +helm--hide-mode-line (&rest _)
|
||||||
(with-current-buffer (helm-buffer-get)
|
(with-current-buffer (helm-buffer-get)
|
||||||
(unless helm-mode-line-string
|
(unless helm-mode-line-string
|
||||||
|
@ -121,7 +117,6 @@ be negative.")
|
||||||
(dolist (fn '(helm-describe-variable helm-describe-function))
|
(dolist (fn '(helm-describe-variable helm-describe-function))
|
||||||
(advice-add fn :around #'doom-use-helpful-a)))
|
(advice-add fn :around #'doom-use-helpful-a)))
|
||||||
|
|
||||||
|
|
||||||
(use-package! helm-flx
|
(use-package! helm-flx
|
||||||
:when (featurep! +fuzzy)
|
:when (featurep! +fuzzy)
|
||||||
:hook (helm-mode . helm-flx-mode)
|
:hook (helm-mode . helm-flx-mode)
|
||||||
|
@ -187,3 +182,7 @@ be negative.")
|
||||||
(lambda (buf &optional _resume) (pop-to-buffer buf)))
|
(lambda (buf &optional _resume) (pop-to-buffer buf)))
|
||||||
(global-set-key [remap swiper] #'swiper-helm)
|
(global-set-key [remap swiper] #'swiper-helm)
|
||||||
(add-to-list 'swiper-font-lock-exclude #'+doom-dashboard-mode nil #'eq))
|
(add-to-list 'swiper-font-lock-exclude #'+doom-dashboard-mode nil #'eq))
|
||||||
|
|
||||||
|
|
||||||
|
(use-package! helm-descbinds
|
||||||
|
:hook (helm-mode . helm-descbinds-mode))
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
;; -*- no-byte-compile: t; -*-
|
;; -*- no-byte-compile: t; -*-
|
||||||
;;; completion/helm/packages.el
|
;;; completion/helm/packages.el
|
||||||
|
|
||||||
(package! helm :pin "21e778bc88")
|
(package! helm :pin "d978f20f4c")
|
||||||
(package! helm-rg :pin "785a80fe5c")
|
(package! helm-rg :pin "785a80fe5c")
|
||||||
(package! helm-c-yasnippet :pin "65ca732b51")
|
(package! helm-c-yasnippet :pin "65ca732b51")
|
||||||
(package! helm-company :pin "6eb5c2d730")
|
(package! helm-company :pin "6eb5c2d730")
|
||||||
|
@ -13,6 +13,7 @@
|
||||||
(when (featurep! +fuzzy)
|
(when (featurep! +fuzzy)
|
||||||
(package! helm-flx :pin "6640fac5cb"))
|
(package! helm-flx :pin "6640fac5cb"))
|
||||||
(when (featurep! +childframe)
|
(when (featurep! +childframe)
|
||||||
(package! posframe :pin "8a9af547e6"))
|
(package! posframe :pin "e62e584268"))
|
||||||
(when (featurep! :lang org)
|
(when (featurep! :lang org)
|
||||||
(package! helm-org :pin "8457e1e462"))
|
(package! helm-org :pin "b7a18dfc17"))
|
||||||
|
(package! helm-descbinds :pin "b725159823")
|
||||||
|
|
|
@ -1,59 +1,64 @@
|
||||||
;;; completion/ido/config.el -*- lexical-binding: t; -*-
|
;;; completion/ido/config.el -*- lexical-binding: t; -*-
|
||||||
|
|
||||||
(defun +ido-init-h ()
|
(defvar ido-mode-hook nil
|
||||||
(setq ido-ignore-buffers
|
"List of hooks to run when `ido-mode' is activated.")
|
||||||
'("\\` " "^\\*ESS\\*" "^\\*Messages\\*" "^\\*Help\\*" "^\\*Buffer"
|
|
||||||
"^\\*.*Completions\\*$" "^\\*Ediff" "^\\*tramp" "^\\*cvs-"
|
|
||||||
"_region_" " output\\*$" "^TAGS$" "^\*Ido")
|
|
||||||
ido-use-faces nil
|
|
||||||
ido-confirm-unique-completion t
|
|
||||||
ido-case-fold t
|
|
||||||
ido-enable-tramp-completion nil
|
|
||||||
ido-enable-flex-matching t
|
|
||||||
ido-create-new-buffer 'always
|
|
||||||
ido-enable-tramp-completion t
|
|
||||||
ido-enable-last-directory-history t
|
|
||||||
ido-save-directory-list-file (concat doom-cache-dir "ido.last"))
|
|
||||||
|
|
||||||
(unless (member "\\`.DS_Store$" ido-ignore-files)
|
|
||||||
(push "\\`.DS_Store$" ido-ignore-files)
|
|
||||||
(push "Icon\\?$" ido-ignore-files))
|
|
||||||
|
|
||||||
(define-key! (ido-common-completion-map ido-completion-map ido-file-completion-map)
|
|
||||||
"\C-n" #'ido-next-match
|
|
||||||
"\C-p" #'ido-prev-match
|
|
||||||
"\C-w" #'ido-delete-backward-word-updir
|
|
||||||
;; Go to $HOME with ~
|
|
||||||
"~" (λ! (if (looking-back "/" (point-min))
|
|
||||||
(insert "~/")
|
|
||||||
(call-interactively #'self-insert-command))))
|
|
||||||
|
|
||||||
(defadvice! +ido--sort-mtime-a ()
|
|
||||||
"Sort ido filelist by mtime instead of alphabetically."
|
|
||||||
:override #'ido-sort-mtime
|
|
||||||
(setq ido-temp-list
|
|
||||||
(sort ido-temp-list
|
|
||||||
(lambda (a b)
|
|
||||||
(time-less-p
|
|
||||||
(sixth (file-attributes (concat ido-current-directory b)))
|
|
||||||
(sixth (file-attributes (concat ido-current-directory a)))))))
|
|
||||||
(ido-to-end ;; move . files to end (again)
|
|
||||||
(cl-loop for x in ido-temp-list
|
|
||||||
if (char-equal (string-to-char x) ?.)
|
|
||||||
collect x)))
|
|
||||||
(add-hook! '(ido-make-file-list-hook ido-make-dir-list-hook)
|
|
||||||
#'ido-sort-mtime)
|
|
||||||
|
|
||||||
;;
|
|
||||||
(ido-mode 1)
|
|
||||||
(ido-everywhere 1)
|
|
||||||
(ido-ubiquitous-mode 1)
|
|
||||||
(ido-vertical-mode 1)
|
|
||||||
(flx-ido-mode +1)
|
|
||||||
(crm-custom-mode +1)
|
|
||||||
|
|
||||||
;;
|
|
||||||
(remove-hook 'ido-setup-hook #'+ido-init-h))
|
|
||||||
|
|
||||||
;;
|
;;
|
||||||
(add-hook 'ido-setup-hook #'+ido-init-h)
|
;;; Packages
|
||||||
|
|
||||||
|
(use-package! ido
|
||||||
|
:after-call pre-command-hook
|
||||||
|
:hook (ido-mode . ido-everywhere)
|
||||||
|
:hook (ido-mode . ido-ubiquitous-mode)
|
||||||
|
:preface
|
||||||
|
;; HACK `ido' is a really old package. It defines `ido-mode' manually and
|
||||||
|
;; doesn't define a hook, so we define one for it.")
|
||||||
|
(defadvice! +ido-run-hooks-a (&rest _)
|
||||||
|
:after #'ido-mode
|
||||||
|
(run-hooks 'ido-mode-hook))
|
||||||
|
:init
|
||||||
|
(setq ido-save-directory-list-file (concat doom-cache-dir "ido.last"))
|
||||||
|
:config
|
||||||
|
(pushnew! ido-ignore-files "\\`.DS_Store$" "Icon\\?$")
|
||||||
|
(setq ido-ignore-buffers
|
||||||
|
'("\\` " "^\\*ESS\\*" "^\\*Messages\\*" "^\\*[Hh]elp" "^\\*Buffer"
|
||||||
|
"^\\*.*Completions\\*$" "^\\*Ediff" "^\\*tramp" "^\\*cvs-" "_region_"
|
||||||
|
" output\\*$" "^TAGS$" "^\*Ido")
|
||||||
|
ido-auto-merge-work-directories-length -1
|
||||||
|
ido-confirm-unique-completion t
|
||||||
|
ido-case-fold t
|
||||||
|
ido-create-new-buffer 'always
|
||||||
|
ido-enable-flex-matching t)
|
||||||
|
|
||||||
|
(map! :map (ido-common-completion-map ido-file-completion-map)
|
||||||
|
"C-w" #'ido-delete-backward-word-updir
|
||||||
|
:map ido-common-completion-map
|
||||||
|
"C-n" #'ido-next-match
|
||||||
|
"C-p" #'ido-prev-match
|
||||||
|
[down] #'ido-next-match
|
||||||
|
[up] #'ido-prev-match
|
||||||
|
:map ido-file-completion-map
|
||||||
|
;; Go to $HOME with ~
|
||||||
|
"~" (λ! (if (looking-back "/" (point-min))
|
||||||
|
(insert "~/")
|
||||||
|
(call-interactively #'self-insert-command))))
|
||||||
|
|
||||||
|
(ido-mode +1))
|
||||||
|
|
||||||
|
|
||||||
|
(use-package! ido-vertical-mode
|
||||||
|
:hook (ido-mode . ido-vertical-mode)
|
||||||
|
:config (setq ido-vertical-show-count t))
|
||||||
|
|
||||||
|
|
||||||
|
(use-package! ido-sort-mtime
|
||||||
|
:hook (ido-mode . ido-sort-mtime-mode))
|
||||||
|
|
||||||
|
|
||||||
|
(use-package! crm-custom
|
||||||
|
:hook (ido-mode . crm-custom-mode))
|
||||||
|
|
||||||
|
|
||||||
|
(use-package! flx-ido
|
||||||
|
:hook (ido-mode . flx-ido-mode))
|
||||||
|
|
|
@ -2,6 +2,7 @@
|
||||||
;;; completion/ido/packages.el
|
;;; completion/ido/packages.el
|
||||||
|
|
||||||
(package! flx-ido :pin "17f5c9cb2a")
|
(package! flx-ido :pin "17f5c9cb2a")
|
||||||
(package! ido-completing-read+ :pin "74861eabd0")
|
(package! ido-completing-read+ :pin "98d3a6e56b")
|
||||||
|
(package! ido-sort-mtime :pin "f638ff0c92")
|
||||||
(package! ido-vertical-mode :pin "16c4c1a112")
|
(package! ido-vertical-mode :pin "16c4c1a112")
|
||||||
(package! crm-custom :pin "f1aaccf643")
|
(package! crm-custom :pin "f1aaccf643")
|
||||||
|
|
|
@ -136,7 +136,7 @@ These keybindings are available while a search is active:
|
||||||
| =C-c C-o= | Open a buffer with your search results |
|
| =C-c C-o= | Open a buffer with your search results |
|
||||||
| =C-c C-e= | Open a writable buffer of your search results |
|
| =C-c C-e= | Open a writable buffer of your search results |
|
||||||
| =C-SPC= | Preview the current candidate |
|
| =C-SPC= | Preview the current candidate |
|
||||||
| =M-RET= | Open the selected candidate in other-window |
|
| =C-RET= | Open the selected candidate in other-window |
|
||||||
|
|
||||||
Changes to the resulting wgrep buffer (opened by =C-c C-e=) can be committed
|
Changes to the resulting wgrep buffer (opened by =C-c C-e=) can be committed
|
||||||
with =C-c C-c= and aborted with =C-c C-k= (alternatively =ZZ= and =ZQ=, for evil
|
with =C-c C-c= and aborted with =C-c C-k= (alternatively =ZZ= and =ZQ=, for evil
|
||||||
|
|
|
@ -207,8 +207,8 @@ If ARG (universal argument), open selection in other-window."
|
||||||
;;;###autoload
|
;;;###autoload
|
||||||
(defun +ivy/projectile-find-file ()
|
(defun +ivy/projectile-find-file ()
|
||||||
"A more sensible `counsel-projectile-find-file', which will revert to
|
"A more sensible `counsel-projectile-find-file', which will revert to
|
||||||
`counsel-find-file' if invoked from $HOME, `counsel-file-jump' if invoked from a
|
`counsel-find-file' if invoked from $HOME or /, `counsel-file-jump' if invoked
|
||||||
non-project, `projectile-find-file' if in a big project (more than
|
from a non-project, `projectile-find-file' if in a big project (more than
|
||||||
`ivy-sort-max-size' files), or `counsel-projectile-find-file' otherwise.
|
`ivy-sort-max-size' files), or `counsel-projectile-find-file' otherwise.
|
||||||
|
|
||||||
The point of this is to avoid Emacs locking up indexing massive file trees."
|
The point of this is to avoid Emacs locking up indexing massive file trees."
|
||||||
|
@ -219,6 +219,7 @@ The point of this is to avoid Emacs locking up indexing massive file trees."
|
||||||
(let ((this-command 'counsel-find-file))
|
(let ((this-command 'counsel-find-file))
|
||||||
(call-interactively
|
(call-interactively
|
||||||
(cond ((or (file-equal-p default-directory "~")
|
(cond ((or (file-equal-p default-directory "~")
|
||||||
|
(file-equal-p default-directory "/")
|
||||||
(when-let (proot (doom-project-root))
|
(when-let (proot (doom-project-root))
|
||||||
(file-equal-p proot "~")))
|
(file-equal-p proot "~")))
|
||||||
#'counsel-find-file)
|
#'counsel-find-file)
|
||||||
|
|
|
@ -122,7 +122,14 @@ evil-ex-specific constructs, so we disable it solely in evil-ex."
|
||||||
'(:columns
|
'(:columns
|
||||||
((counsel-describe-variable-transformer (:width 40)) ; the original transformer
|
((counsel-describe-variable-transformer (:width 40)) ; the original transformer
|
||||||
(+ivy-rich-describe-variable-transformer (:width 50))
|
(+ivy-rich-describe-variable-transformer (:width 50))
|
||||||
(ivy-rich-counsel-variable-docstring (:face font-lock-doc-face)))))
|
(ivy-rich-counsel-variable-docstring (:face font-lock-doc-face))))
|
||||||
|
'counsel-M-x
|
||||||
|
'(:columns
|
||||||
|
((counsel-M-x-transformer (:width 60))
|
||||||
|
(ivy-rich-counsel-function-docstring (:face font-lock-doc-face))))
|
||||||
|
;; Apply switch buffer transformers to `counsel-projectile-switch-to-buffer' as well
|
||||||
|
'counsel-projectile-switch-to-buffer
|
||||||
|
(plist-get ivy-rich-display-transformers-list 'ivy-switch-buffer))
|
||||||
|
|
||||||
;; Remove built-in coloring of buffer list; we do our own
|
;; Remove built-in coloring of buffer list; we do our own
|
||||||
(setq ivy-switch-buffer-faces-alist nil)
|
(setq ivy-switch-buffer-faces-alist nil)
|
||||||
|
@ -135,11 +142,6 @@ evil-ex-specific constructs, so we disable it solely in evil-ex."
|
||||||
(when switch-buffer-alist
|
(when switch-buffer-alist
|
||||||
(setcar switch-buffer-alist '+ivy-rich-buffer-name)))
|
(setcar switch-buffer-alist '+ivy-rich-buffer-name)))
|
||||||
|
|
||||||
;; Apply switch buffer transformers to `counsel-projectile-switch-to-buffer' as well
|
|
||||||
(plist-put! ivy-rich-display-transformers-list
|
|
||||||
'counsel-projectile-switch-to-buffer
|
|
||||||
(plist-get ivy-rich-display-transformers-list 'ivy-switch-buffer))
|
|
||||||
|
|
||||||
(ivy-rich-mode +1))
|
(ivy-rich-mode +1))
|
||||||
|
|
||||||
|
|
||||||
|
@ -153,9 +155,10 @@ evil-ex-specific constructs, so we disable it solely in evil-ex."
|
||||||
|
|
||||||
(all-the-icons-ivy-setup)
|
(all-the-icons-ivy-setup)
|
||||||
(after! counsel-projectile
|
(after! counsel-projectile
|
||||||
(let ((all-the-icons-ivy-file-commands '(counsel-projectile
|
(let ((all-the-icons-ivy-file-commands
|
||||||
counsel-projectile-find-file
|
'(counsel-projectile
|
||||||
counsel-projectile-find-dir)))
|
counsel-projectile-find-file
|
||||||
|
counsel-projectile-find-dir)))
|
||||||
(all-the-icons-ivy-setup))))
|
(all-the-icons-ivy-setup))))
|
||||||
|
|
||||||
|
|
||||||
|
@ -259,7 +262,10 @@ evil-ex-specific constructs, so we disable it solely in evil-ex."
|
||||||
(cond ((executable-find doom-projectile-fd-binary)
|
(cond ((executable-find doom-projectile-fd-binary)
|
||||||
(cons doom-projectile-fd-binary (list "-t" "f" "-E" ".git")))
|
(cons doom-projectile-fd-binary (list "-t" "f" "-E" ".git")))
|
||||||
((executable-find "rg")
|
((executable-find "rg")
|
||||||
(split-string (format counsel-rg-base-command "--files --no-messages") " " t))
|
(append (list "rg" "--files" "--color=never" "--hidden" "--no-messages")
|
||||||
|
(cl-loop for dir in projectile-globally-ignored-directories
|
||||||
|
collect "--glob" and collect (concat "!" dir))
|
||||||
|
(if IS-WINDOWS (list "--path-separator /"))))
|
||||||
((cons find-program args)))
|
((cons find-program args)))
|
||||||
(unless (listp args)
|
(unless (listp args)
|
||||||
(user-error "`counsel-file-jump-args' is a list now, please customize accordingly."))
|
(user-error "`counsel-file-jump-args' is a list now, please customize accordingly."))
|
||||||
|
@ -297,8 +303,8 @@ evil-ex-specific constructs, so we disable it solely in evil-ex."
|
||||||
;; no highlighting visited files; slows down the filtering
|
;; no highlighting visited files; slows down the filtering
|
||||||
(ivy-set-display-transformer #'counsel-projectile-find-file nil)
|
(ivy-set-display-transformer #'counsel-projectile-find-file nil)
|
||||||
|
|
||||||
(if (featurep! +prescient)
|
(when (featurep! +prescient)
|
||||||
(setq counsel-projectile-sort-files t)))
|
(setq counsel-projectile-sort-files t)))
|
||||||
|
|
||||||
|
|
||||||
(use-package! wgrep
|
(use-package! wgrep
|
||||||
|
@ -325,7 +331,9 @@ evil-ex-specific constructs, so we disable it solely in evil-ex."
|
||||||
;; posframe.
|
;; posframe.
|
||||||
(dolist (fn '(swiper counsel-rg counsel-grep counsel-git-grep))
|
(dolist (fn '(swiper counsel-rg counsel-grep counsel-git-grep))
|
||||||
(setf (alist-get fn ivy-posframe-display-functions-alist)
|
(setf (alist-get fn ivy-posframe-display-functions-alist)
|
||||||
#'ivy-display-function-fallback)))
|
#'ivy-display-function-fallback))
|
||||||
|
|
||||||
|
(add-hook 'doom-reload-hook #'posframe-delete-all))
|
||||||
|
|
||||||
|
|
||||||
(use-package! flx
|
(use-package! flx
|
||||||
|
@ -336,8 +344,9 @@ evil-ex-specific constructs, so we disable it solely in evil-ex."
|
||||||
|
|
||||||
|
|
||||||
(use-package! ivy-prescient
|
(use-package! ivy-prescient
|
||||||
:hook (ivy-mode . ivy-prescient-mode)
|
|
||||||
:when (featurep! +prescient)
|
:when (featurep! +prescient)
|
||||||
|
:hook (ivy-mode . ivy-prescient-mode)
|
||||||
|
:hook (ivy-prescient-mode . prescient-persist-mode)
|
||||||
:init
|
:init
|
||||||
(setq prescient-filter-method
|
(setq prescient-filter-method
|
||||||
(if (featurep! +fuzzy)
|
(if (featurep! +fuzzy)
|
||||||
|
@ -354,8 +363,7 @@ evil-ex-specific constructs, so we disable it solely in evil-ex."
|
||||||
(ivy-prescient-re-builder str)))
|
(ivy-prescient-re-builder str)))
|
||||||
|
|
||||||
;; NOTE prescient config duplicated with `company'
|
;; NOTE prescient config duplicated with `company'
|
||||||
(setq prescient-save-file (concat doom-cache-dir "prescient-save.el"))
|
(setq prescient-save-file (concat doom-cache-dir "prescient-save.el")))
|
||||||
(prescient-persist-mode +1))
|
|
||||||
|
|
||||||
|
|
||||||
;;;###package swiper
|
;;;###package swiper
|
||||||
|
|
|
@ -1,23 +1,23 @@
|
||||||
;; -*- no-byte-compile: t; -*-
|
;; -*- no-byte-compile: t; -*-
|
||||||
;;; completion/ivy/packages.el
|
;;; completion/ivy/packages.el
|
||||||
|
|
||||||
(package! swiper :pin "5f1d9ce045")
|
(package! swiper :pin "64f05f4735")
|
||||||
(package! ivy)
|
(package! ivy)
|
||||||
(package! ivy-hydra)
|
(package! ivy-hydra)
|
||||||
(package! counsel)
|
(package! counsel)
|
||||||
|
|
||||||
(package! amx :pin "e512e74e83")
|
(package! amx :pin "e512e74e83")
|
||||||
(package! counsel-projectile :pin "b556ed8995")
|
(package! counsel-projectile :pin "b556ed8995")
|
||||||
(package! ivy-rich :pin "0f22aff4c7")
|
(package! ivy-rich :pin "596874d146")
|
||||||
(package! wgrep :pin "5977b8e000")
|
(package! wgrep :pin "5977b8e000")
|
||||||
|
|
||||||
(if (featurep! +prescient)
|
(if (featurep! +prescient)
|
||||||
(package! ivy-prescient :pin "7fd8c3b802")
|
(package! ivy-prescient :pin "53307731f3")
|
||||||
(when (featurep! +fuzzy)
|
(when (featurep! +fuzzy)
|
||||||
(package! flx :pin "17f5c9cb2a")))
|
(package! flx :pin "17f5c9cb2a")))
|
||||||
|
|
||||||
(when (featurep! +childframe)
|
(when (featurep! +childframe)
|
||||||
(package! ivy-posframe :pin "6d697ff00a"))
|
(package! ivy-posframe :pin "ae9bafe94f"))
|
||||||
|
|
||||||
(when (featurep! +icons)
|
(when (featurep! +icons)
|
||||||
(package! all-the-icons-ivy :pin "a70cbfa1ef"))
|
(package! all-the-icons-ivy :pin "a70cbfa1ef"))
|
||||||
|
|
|
@ -86,6 +86,7 @@
|
||||||
|
|
||||||
;;; <leader> s --- search
|
;;; <leader> s --- search
|
||||||
(:prefix-map ("s" . "search")
|
(:prefix-map ("s" . "search")
|
||||||
|
:desc "Search project for symbol" "." #'+default/search-project-for-symbol-at-point
|
||||||
:desc "Search buffer" "b" #'swiper
|
:desc "Search buffer" "b" #'swiper
|
||||||
:desc "Search current directory" "d" #'+default/search-cwd
|
:desc "Search current directory" "d" #'+default/search-cwd
|
||||||
:desc "Search other directory" "D" #'+default/search-other-cwd
|
:desc "Search other directory" "D" #'+default/search-other-cwd
|
||||||
|
@ -123,6 +124,17 @@
|
||||||
(:prefix-map ("n" . "notes")
|
(:prefix-map ("n" . "notes")
|
||||||
:desc "Search notes for symbol" "." #'+default/search-notes-for-symbol-at-point
|
:desc "Search notes for symbol" "." #'+default/search-notes-for-symbol-at-point
|
||||||
:desc "Org agenda" "a" #'org-agenda
|
:desc "Org agenda" "a" #'org-agenda
|
||||||
|
(:when (featurep! :tools biblio)
|
||||||
|
:desc "Bibliographic entries" "b"
|
||||||
|
(cond ((featurep! :completion ivy) #'ivy-bibtex)
|
||||||
|
((featurep! :completion helm) #'helm-bibtex)))
|
||||||
|
|
||||||
|
:desc "Toggle org-clock" "c" #'+org/toggle-clock
|
||||||
|
:desc "Cancel org-clock" "C" #'org-clock-cancel
|
||||||
|
:desc "Open deft" "d" #'deft
|
||||||
|
(:when (featurep! :lang org +noter)
|
||||||
|
:desc "Org noter" "e" #'org-noter)
|
||||||
|
|
||||||
:desc "Find file in notes" "f" #'+default/find-in-notes
|
:desc "Find file in notes" "f" #'+default/find-in-notes
|
||||||
:desc "Browse notes" "F" #'+default/browse-notes
|
:desc "Browse notes" "F" #'+default/browse-notes
|
||||||
:desc "Org store link" "l" #'org-store-link
|
:desc "Org store link" "l" #'org-store-link
|
||||||
|
@ -139,7 +151,20 @@
|
||||||
(:when (featurep! :lang org +journal)
|
(:when (featurep! :lang org +journal)
|
||||||
(:prefix ("j" . "journal")
|
(:prefix ("j" . "journal")
|
||||||
:desc "New Entry" "j" #'org-journal-new-entry
|
:desc "New Entry" "j" #'org-journal-new-entry
|
||||||
:desc "Search Forever" "s" #'org-journal-search-forever)))
|
:desc "Search Forever" "s" #'org-journal-search-forever))
|
||||||
|
(:when (featurep! :lang org +roam)
|
||||||
|
(:prefix ("r" . "roam")
|
||||||
|
:desc "Switch to buffer" "b" #'org-roam-switch-to-buffer
|
||||||
|
:desc "Org Roam Capture" "c" #'org-roam-capture
|
||||||
|
:desc "Find file" "f" #'org-roam-find-file
|
||||||
|
:desc "Show graph" "g" #'org-roam-graph-show
|
||||||
|
:desc "Insert" "i" #'org-roam-insert
|
||||||
|
:desc "Org Roam" "r" #'org-roam
|
||||||
|
(:prefix ("d" . "by date")
|
||||||
|
:desc "Arbitrary date" "d" #'org-roam-dailies-date
|
||||||
|
:desc "Today" "t" #'org-roam-dailies-today
|
||||||
|
:desc "Tomorrow" "m" #'org-roam-dailies-tomorrow
|
||||||
|
:desc "Yesterday" "y" #'org-roam-dailies-yesterday))))
|
||||||
|
|
||||||
;;; <leader> o --- open
|
;;; <leader> o --- open
|
||||||
"o" nil ; we need to unbind it first as Org claims this prefix
|
"o" nil ; we need to unbind it first as Org claims this prefix
|
||||||
|
@ -180,6 +205,7 @@
|
||||||
|
|
||||||
;;; <leader> p --- project
|
;;; <leader> p --- project
|
||||||
(:prefix ("p" . "project")
|
(:prefix ("p" . "project")
|
||||||
|
:desc "Search project for symbol" "." #'+default/search-project-for-symbol-at-point
|
||||||
:desc "Find file in other project" "F" #'doom/find-file-in-other-project
|
:desc "Find file in other project" "F" #'doom/find-file-in-other-project
|
||||||
:desc "Search project" "s" #'+default/search-project
|
:desc "Search project" "s" #'+default/search-project
|
||||||
:desc "List project tasks" "t" #'magit-todos-list
|
:desc "List project tasks" "t" #'magit-todos-list
|
||||||
|
|
|
@ -7,9 +7,9 @@
|
||||||
(define-key! evil-ex-completion-map
|
(define-key! evil-ex-completion-map
|
||||||
"C-a" #'evil-beginning-of-line
|
"C-a" #'evil-beginning-of-line
|
||||||
"C-b" #'evil-backward-char
|
"C-b" #'evil-backward-char
|
||||||
"C-s" (if (featurep! :completion ivy)
|
"C-f" #'evil-forward-char
|
||||||
#'counsel-minibuffer-history
|
"C-j" #'previous-complete-history-element
|
||||||
#'helm-minibuffer-history))
|
"C-k" #'next-complete-history-element)
|
||||||
|
|
||||||
(define-key! :keymaps +default-minibuffer-maps
|
(define-key! :keymaps +default-minibuffer-maps
|
||||||
[escape] #'abort-recursive-edit
|
[escape] #'abort-recursive-edit
|
||||||
|
@ -18,16 +18,21 @@
|
||||||
"C-u" #'evil-delete-back-to-indentation
|
"C-u" #'evil-delete-back-to-indentation
|
||||||
"C-v" #'yank
|
"C-v" #'yank
|
||||||
"C-w" #'doom/delete-backward-word
|
"C-w" #'doom/delete-backward-word
|
||||||
"C-z" (λ! (ignore-errors (call-interactively #'undo)))
|
"C-z" (λ! (ignore-errors (call-interactively #'undo))))
|
||||||
;; Scrolling lines
|
|
||||||
"C-j" #'next-line
|
|
||||||
"C-k" #'previous-line
|
|
||||||
"C-S-j" #'scroll-up-command
|
|
||||||
"C-S-k" #'scroll-down-command)
|
|
||||||
|
|
||||||
(define-key! read-expression-map
|
(when (featurep! :editor evil +everywhere)
|
||||||
"C-j" #'next-line-or-history-element
|
(define-key! :keymaps +default-minibuffer-maps
|
||||||
"C-k" #'previous-line-or-history-element))
|
"C-f" #'forward-word
|
||||||
|
"C-b" #'backward-word
|
||||||
|
"M-f" #'foward-char
|
||||||
|
"M-b" #'backward-char
|
||||||
|
"C-j" #'next-line
|
||||||
|
"C-k" #'previous-line
|
||||||
|
"C-S-j" #'scroll-up-command
|
||||||
|
"C-S-k" #'scroll-down-command)
|
||||||
|
(define-key! read-expression-map
|
||||||
|
"C-j" #'next-line-or-history-element
|
||||||
|
"C-k" #'previous-line-or-history-element)))
|
||||||
|
|
||||||
|
|
||||||
;;
|
;;
|
||||||
|
@ -42,19 +47,11 @@
|
||||||
(and (featurep! :completion company +tng)
|
(and (featurep! :completion company +tng)
|
||||||
(+company-has-completion-p))
|
(+company-has-completion-p))
|
||||||
#'+company/complete)
|
#'+company/complete)
|
||||||
:n [tab] (general-predicate-dispatch nil
|
|
||||||
(and (featurep! :editor fold)
|
|
||||||
(save-excursion (end-of-line) (invisible-p (point))))
|
|
||||||
#'+fold/toggle
|
|
||||||
(fboundp 'evil-jump-item)
|
|
||||||
#'evil-jump-item)
|
|
||||||
:v [tab] (general-predicate-dispatch nil
|
:v [tab] (general-predicate-dispatch nil
|
||||||
(and (bound-and-true-p yas-minor-mode)
|
(and (bound-and-true-p yas-minor-mode)
|
||||||
(or (eq evil-visual-selection 'line)
|
(or (eq evil-visual-selection 'line)
|
||||||
(not (memq (char-after) (list ?\( ?\[ ?\{ ?\} ?\] ?\))))))
|
(not (memq (char-after) (list ?\( ?\[ ?\{ ?\} ?\] ?\))))))
|
||||||
#'yas-insert-snippet
|
#'yas-insert-snippet)
|
||||||
(fboundp 'evil-jump-item)
|
|
||||||
#'evil-jump-item)
|
|
||||||
|
|
||||||
;; Smarter newlines
|
;; Smarter newlines
|
||||||
:i [remap newline] #'newline-and-indent ; auto-indent on newline
|
:i [remap newline] #'newline-and-indent ; auto-indent on newline
|
||||||
|
@ -76,7 +73,6 @@
|
||||||
(:after man :map Man-mode-map
|
(:after man :map Man-mode-map
|
||||||
:n "q" #'kill-current-buffer)
|
:n "q" #'kill-current-buffer)
|
||||||
|
|
||||||
:m "gs" #'+evil/easymotion ; lazy-load `evil-easymotion'
|
|
||||||
(:after (evil-org evil-easymotion)
|
(:after (evil-org evil-easymotion)
|
||||||
:map evil-org-mode-map
|
:map evil-org-mode-map
|
||||||
:m "gsh" #'+org/goto-visible)
|
:m "gsh" #'+org/goto-visible)
|
||||||
|
@ -161,15 +157,18 @@
|
||||||
|
|
||||||
(:when (featurep! :completion helm)
|
(:when (featurep! :completion helm)
|
||||||
(:after helm :map helm-map
|
(:after helm :map helm-map
|
||||||
|
[remap next-line] #'helm-next-line
|
||||||
|
[remap previous-line] #'helm-previous-line
|
||||||
[left] #'left-char
|
[left] #'left-char
|
||||||
[right] #'right-char
|
[right] #'right-char
|
||||||
"C-S-f" #'helm-previous-page
|
"C-S-f" #'helm-previous-page
|
||||||
"C-S-n" #'helm-next-source
|
"C-S-n" #'helm-next-source
|
||||||
"C-S-p" #'helm-previous-source
|
"C-S-p" #'helm-previous-source
|
||||||
"C-S-j" #'helm-next-source
|
(:when (featurep! :editor evil +everywhere)
|
||||||
"C-S-k" #'helm-previous-source
|
"C-j" #'helm-next-line
|
||||||
"C-j" #'helm-next-line
|
"C-k" #'helm-previous-line
|
||||||
"C-k" #'helm-previous-line
|
"C-S-j" #'helm-next-source
|
||||||
|
"C-S-k" #'helm-previous-source)
|
||||||
"C-u" #'helm-delete-minibuffer-contents
|
"C-u" #'helm-delete-minibuffer-contents
|
||||||
"C-s" #'helm-minibuffer-history
|
"C-s" #'helm-minibuffer-history
|
||||||
;; Swap TAB and C-z
|
;; Swap TAB and C-z
|
||||||
|
@ -266,7 +265,6 @@
|
||||||
:desc "M-x" ":" #'execute-extended-command
|
:desc "M-x" ":" #'execute-extended-command
|
||||||
:desc "Pop up scratch buffer" "x" #'doom/open-scratch-buffer
|
:desc "Pop up scratch buffer" "x" #'doom/open-scratch-buffer
|
||||||
:desc "Org Capture" "X" #'org-capture
|
:desc "Org Capture" "X" #'org-capture
|
||||||
|
|
||||||
;; C-u is used by evil
|
;; C-u is used by evil
|
||||||
:desc "Universal argument" "u" #'universal-argument
|
:desc "Universal argument" "u" #'universal-argument
|
||||||
:desc "window" "w" evil-window-map
|
:desc "window" "w" evil-window-map
|
||||||
|
@ -275,12 +273,10 @@
|
||||||
(:when (featurep! :ui popup)
|
(:when (featurep! :ui popup)
|
||||||
:desc "Toggle last popup" "~" #'+popup/toggle)
|
:desc "Toggle last popup" "~" #'+popup/toggle)
|
||||||
:desc "Find file" "." #'find-file
|
:desc "Find file" "." #'find-file
|
||||||
|
|
||||||
:desc "Switch buffer" "," #'switch-to-buffer
|
:desc "Switch buffer" "," #'switch-to-buffer
|
||||||
(:when (featurep! :ui workspaces)
|
(:when (featurep! :ui workspaces)
|
||||||
:desc "Switch workspace buffer" "," #'persp-switch-to-buffer
|
:desc "Switch workspace buffer" "," #'persp-switch-to-buffer
|
||||||
:desc "Switch buffer" "<" #'switch-to-buffer)
|
:desc "Switch buffer" "<" #'switch-to-buffer)
|
||||||
|
|
||||||
:desc "Switch to last buffer" "`" #'evil-switch-to-windows-last-buffer
|
:desc "Switch to last buffer" "`" #'evil-switch-to-windows-last-buffer
|
||||||
:desc "Resume last search" "'"
|
:desc "Resume last search" "'"
|
||||||
(cond ((featurep! :completion ivy) #'ivy-resume)
|
(cond ((featurep! :completion ivy) #'ivy-resume)
|
||||||
|
@ -468,14 +464,23 @@
|
||||||
(:prefix-map ("n" . "notes")
|
(:prefix-map ("n" . "notes")
|
||||||
:desc "Search notes for symbol" "*" #'+default/search-notes-for-symbol-at-point
|
:desc "Search notes for symbol" "*" #'+default/search-notes-for-symbol-at-point
|
||||||
:desc "Org agenda" "a" #'org-agenda
|
:desc "Org agenda" "a" #'org-agenda
|
||||||
|
(:when (featurep! :tools biblio)
|
||||||
|
:desc "Bibliographic entries" "b"
|
||||||
|
(cond ((featurep! :completion ivy) #'ivy-bibtex)
|
||||||
|
((featurep! :completion helm) #'helm-bibtex)))
|
||||||
|
|
||||||
:desc "Toggle org-clock" "c" #'+org/toggle-clock
|
:desc "Toggle org-clock" "c" #'+org/toggle-clock
|
||||||
:desc "Cancel org-clock" "C" #'org-clock-cancel
|
:desc "Cancel org-clock" "C" #'org-clock-cancel
|
||||||
:desc "Open deft" "d" #'deft
|
:desc "Open deft" "d" #'deft
|
||||||
|
(:when (featurep! :lang org +noter)
|
||||||
|
:desc "Org noter" "e" #'org-noter)
|
||||||
|
|
||||||
:desc "Find file in notes" "f" #'+default/find-in-notes
|
:desc "Find file in notes" "f" #'+default/find-in-notes
|
||||||
:desc "Browse notes" "F" #'+default/browse-notes
|
:desc "Browse notes" "F" #'+default/browse-notes
|
||||||
:desc "Org store link" "l" #'org-store-link
|
:desc "Org store link" "l" #'org-store-link
|
||||||
:desc "Tags search" "m" #'org-tags-view
|
:desc "Tags search" "m" #'org-tags-view
|
||||||
:desc "Org capture" "n" #'org-capture
|
:desc "Org capture" "n" #'org-capture
|
||||||
|
:desc "Goto capture" "N" #'org-capture-goto-target
|
||||||
:desc "Active org-clock" "o" #'org-clock-goto
|
:desc "Active org-clock" "o" #'org-clock-goto
|
||||||
:desc "Todo list" "t" #'org-todo-list
|
:desc "Todo list" "t" #'org-todo-list
|
||||||
:desc "Search notes" "s" #'+default/org-notes-search
|
:desc "Search notes" "s" #'+default/org-notes-search
|
||||||
|
@ -484,6 +489,20 @@
|
||||||
:desc "Org export to clipboard" "y" #'+org/export-to-clipboard
|
:desc "Org export to clipboard" "y" #'+org/export-to-clipboard
|
||||||
:desc "Org export to clipboard as RTF" "Y" #'+org/export-to-clipboard-as-rich-text
|
:desc "Org export to clipboard as RTF" "Y" #'+org/export-to-clipboard-as-rich-text
|
||||||
|
|
||||||
|
(:when (featurep! :lang org +roam)
|
||||||
|
(:prefix ("r" . "roam")
|
||||||
|
:desc "Switch to buffer" "b" #'org-roam-switch-to-buffer
|
||||||
|
:desc "Org Roam Capture" "c" #'org-roam-capture
|
||||||
|
:desc "Find file" "f" #'org-roam-find-file
|
||||||
|
:desc "Show graph" "g" #'org-roam-graph-show
|
||||||
|
:desc "Insert" "i" #'org-roam-insert
|
||||||
|
:desc "Org Roam" "r" #'org-roam
|
||||||
|
(:prefix ("d" . "by date")
|
||||||
|
:desc "Arbitrary date" "d" #'org-roam-dailies-date
|
||||||
|
:desc "Today" "t" #'org-roam-dailies-today
|
||||||
|
:desc "Tomorrow" "m" #'org-roam-dailies-tomorrow
|
||||||
|
:desc "Yesterday" "y" #'org-roam-dailies-yesterday)))
|
||||||
|
|
||||||
(:when (featurep! :lang org +journal)
|
(:when (featurep! :lang org +journal)
|
||||||
(:prefix ("j" . "journal")
|
(:prefix ("j" . "journal")
|
||||||
:desc "New Entry" "j" #'org-journal-new-entry
|
:desc "New Entry" "j" #'org-journal-new-entry
|
||||||
|
@ -553,10 +572,10 @@
|
||||||
:desc "Find recent project files" "r" #'projectile-recentf
|
:desc "Find recent project files" "r" #'projectile-recentf
|
||||||
:desc "Run project" "R" #'projectile-run-project
|
:desc "Run project" "R" #'projectile-run-project
|
||||||
:desc "Save project files" "s" #'projectile-save-project-buffers
|
:desc "Save project files" "s" #'projectile-save-project-buffers
|
||||||
:desc "Pop up scratch buffer" "x" #'doom/open-project-scratch-buffer
|
|
||||||
:desc "Switch to scratch buffer" "X" #'doom/switch-to-project-scratch-buffer
|
|
||||||
:desc "List project tasks" "t" #'magit-todos-list
|
:desc "List project tasks" "t" #'magit-todos-list
|
||||||
:desc "Test project" "T" #'projectile-test-project)
|
:desc "Test project" "T" #'projectile-test-project
|
||||||
|
:desc "Pop up scratch buffer" "x" #'doom/open-project-scratch-buffer
|
||||||
|
:desc "Switch to scratch buffer" "X" #'doom/switch-to-project-scratch-buffer)
|
||||||
|
|
||||||
;;; <leader> q --- quit/session
|
;;; <leader> q --- quit/session
|
||||||
(:prefix-map ("q" . "quit/session")
|
(:prefix-map ("q" . "quit/session")
|
||||||
|
@ -626,7 +645,7 @@
|
||||||
(:when (featurep! :lang org +pomodoro)
|
(:when (featurep! :lang org +pomodoro)
|
||||||
:desc "Pomodoro timer" "t" #'org-pomodoro)
|
:desc "Pomodoro timer" "t" #'org-pomodoro)
|
||||||
:desc "Soft line wrapping" "w" #'visual-line-mode
|
:desc "Soft line wrapping" "w" #'visual-line-mode
|
||||||
(:when (featurep! :ui word-wrap)
|
(:when (featurep! :editor word-wrap)
|
||||||
:desc "Soft line wrapping" "w" #'+word-wrap-mode)
|
:desc "Soft line wrapping" "w" #'+word-wrap-mode)
|
||||||
:desc "Zen mode" "z" #'writeroom-mode))
|
:desc "Zen mode" "z" #'writeroom-mode))
|
||||||
|
|
||||||
|
|
|
@ -27,11 +27,15 @@
|
||||||
;;;###autoload
|
;;;###autoload
|
||||||
(defun +default/browse-notes ()
|
(defun +default/browse-notes ()
|
||||||
"Browse files from `org-directory'."
|
"Browse files from `org-directory'."
|
||||||
(interactive) (doom-project-browse org-directory))
|
(interactive)
|
||||||
|
(require 'org)
|
||||||
|
(doom-project-browse org-directory))
|
||||||
;;;###autoload
|
;;;###autoload
|
||||||
(defun +default/find-in-notes ()
|
(defun +default/find-in-notes ()
|
||||||
"Find a file under `org-directory', recursively."
|
"Find a file under `org-directory', recursively."
|
||||||
(interactive) (doom-project-find-file org-directory))
|
(interactive)
|
||||||
|
(require 'org)
|
||||||
|
(doom-project-find-file org-directory))
|
||||||
|
|
||||||
;;;###autoload
|
;;;###autoload
|
||||||
(defun +default/find-file-under-here ()
|
(defun +default/find-file-under-here ()
|
||||||
|
|
|
@ -35,7 +35,7 @@
|
||||||
(defun +default/yank-buffer-filename ()
|
(defun +default/yank-buffer-filename ()
|
||||||
"Copy the current buffer's path to the kill ring."
|
"Copy the current buffer's path to the kill ring."
|
||||||
(interactive)
|
(interactive)
|
||||||
(if-let* ((filename (or buffer-file-name (bound-and-true-p list-buffers-directory))))
|
(if-let (filename (or buffer-file-name (bound-and-true-p list-buffers-directory)))
|
||||||
(message (kill-new (abbreviate-file-name filename)))
|
(message (kill-new (abbreviate-file-name filename)))
|
||||||
(error "Couldn't find filename in current buffer")))
|
(error "Couldn't find filename in current buffer")))
|
||||||
|
|
||||||
|
|
|
@ -1,19 +1,19 @@
|
||||||
;;; config/default/config.el -*- lexical-binding: t; -*-
|
;;; config/default/config.el -*- lexical-binding: t; -*-
|
||||||
|
|
||||||
(defvar +default-minibuffer-maps
|
(defvar +default-minibuffer-maps
|
||||||
`(minibuffer-local-map
|
(append '(minibuffer-local-map
|
||||||
minibuffer-local-ns-map
|
minibuffer-local-ns-map
|
||||||
minibuffer-local-completion-map
|
minibuffer-local-completion-map
|
||||||
minibuffer-local-must-match-map
|
minibuffer-local-must-match-map
|
||||||
minibuffer-local-isearch-map
|
minibuffer-local-isearch-map
|
||||||
read-expression-map
|
read-expression-map)
|
||||||
,@(cond ((featurep! :completion ivy)
|
(cond ((featurep! :completion ivy)
|
||||||
'(ivy-minibuffer-map
|
'(ivy-minibuffer-map
|
||||||
ivy-switch-buffer-map))
|
ivy-switch-buffer-map))
|
||||||
((featurep! :completion helm)
|
((featurep! :completion helm)
|
||||||
'(helm-map
|
'(helm-map
|
||||||
helm-ag-map
|
helm-ag-map
|
||||||
helm-read-file-map))))
|
helm-read-file-map))))
|
||||||
"A list of all the keymaps used for the minibuffer.")
|
"A list of all the keymaps used for the minibuffer.")
|
||||||
|
|
||||||
|
|
||||||
|
@ -31,8 +31,11 @@
|
||||||
(after! epa
|
(after! epa
|
||||||
;; With GPG 2.1+, this forces gpg-agent to use the Emacs minibuffer to prompt
|
;; With GPG 2.1+, this forces gpg-agent to use the Emacs minibuffer to prompt
|
||||||
;; for the key passphrase.
|
;; for the key passphrase.
|
||||||
(setq epa-pinentry-mode 'loopback)
|
(set (if EMACS27+
|
||||||
;; Default to the first secret key available in your keyring.
|
'epg-pinentry-mode
|
||||||
|
'epa-pinentry-mode) ; DEPRECATED `epa-pinentry-mode'
|
||||||
|
'loopback)
|
||||||
|
;; Default to the first secret key available in your keyring.
|
||||||
(setq-default
|
(setq-default
|
||||||
epa-file-encrypt-to
|
epa-file-encrypt-to
|
||||||
(or (default-value 'epa-file-encrypt-to)
|
(or (default-value 'epa-file-encrypt-to)
|
||||||
|
@ -254,6 +257,7 @@
|
||||||
"s-c" (if (featurep 'evil) #'evil-yank #'copy-region-as-kill)
|
"s-c" (if (featurep 'evil) #'evil-yank #'copy-region-as-kill)
|
||||||
"s-v" #'yank
|
"s-v" #'yank
|
||||||
"s-s" #'save-buffer
|
"s-s" #'save-buffer
|
||||||
|
"s-x" #'execute-extended-command
|
||||||
:v "s-x" #'kill-region
|
:v "s-x" #'kill-region
|
||||||
;; Buffer-local font scaling
|
;; Buffer-local font scaling
|
||||||
"s-+" #'doom/reset-font-size
|
"s-+" #'doom/reset-font-size
|
||||||
|
@ -377,10 +381,15 @@
|
||||||
|
|
||||||
;; A Doom convention where C-s on popups and interactive searches will invoke
|
;; A Doom convention where C-s on popups and interactive searches will invoke
|
||||||
;; ivy/helm for their superior filtering.
|
;; ivy/helm for their superior filtering.
|
||||||
(define-key! :keymaps +default-minibuffer-maps
|
(when-let (command (cond ((featurep! :completion ivy)
|
||||||
"C-s" (if (featurep! :completion ivy)
|
#'counsel-minibuffer-history)
|
||||||
#'counsel-minibuffer-history
|
((featurep! :completion helm)
|
||||||
#'helm-minibuffer-history))
|
#'helm-minibuffer-history)))
|
||||||
|
(define-key!
|
||||||
|
:keymaps (append +default-minibuffer-maps
|
||||||
|
(when (featurep! :editor evil +everywhere)
|
||||||
|
'(evil-ex-completion-map)))
|
||||||
|
"C-s" command))
|
||||||
|
|
||||||
;; Smarter C-a/C-e for both Emacs and Evil. C-a will jump to indentation.
|
;; Smarter C-a/C-e for both Emacs and Evil. C-a will jump to indentation.
|
||||||
;; Pressing it again will send you to the true bol. Same goes for C-e, except
|
;; Pressing it again will send you to the true bol. Same goes for C-e, except
|
||||||
|
|
|
@ -1,9 +1,9 @@
|
||||||
;; -*- no-byte-compile: t; -*-
|
;; -*- no-byte-compile: t; -*-
|
||||||
;;; config/default/packages.el
|
;;; config/default/packages.el
|
||||||
|
|
||||||
(package! avy :pin "cf95ba9582")
|
(package! avy :pin "3bf83140fa")
|
||||||
(package! drag-stuff :pin "6d06d846cd")
|
(package! drag-stuff :pin "6d06d846cd")
|
||||||
(package! link-hint :pin "0d9cabcdb7")
|
(package! link-hint :pin "0d9cabcdb7")
|
||||||
|
|
||||||
(unless (featurep! :editor evil)
|
(unless (featurep! :editor evil)
|
||||||
(package! expand-region :pin "1603d01fbf"))
|
(package! expand-region :pin "ea6b4cbb99"))
|
||||||
|
|
|
@ -28,8 +28,6 @@
|
||||||
|
|
||||||
;; TODO (evil-ex-define-cmd "rx" 'doom:regex) ; open re-builder
|
;; TODO (evil-ex-define-cmd "rx" 'doom:regex) ; open re-builder
|
||||||
(evil-ex-define-cmd "sh[ell]" #'+eshell:run)
|
(evil-ex-define-cmd "sh[ell]" #'+eshell:run)
|
||||||
(evil-ex-define-cmd "t[mux]" #'+tmux:run) ; send to tmux
|
|
||||||
(evil-ex-define-cmd "tcd" #'+tmux:cd-here) ; cd to default-directory in tmux
|
|
||||||
(evil-ex-define-cmd "pad" #'+evil:open-scratch-buffer)
|
(evil-ex-define-cmd "pad" #'+evil:open-scratch-buffer)
|
||||||
|
|
||||||
;;; GIT
|
;;; GIT
|
||||||
|
@ -49,9 +47,9 @@
|
||||||
(evil-ex-define-cmd "k[ill]m" #'+evil:kill-matching-buffers)
|
(evil-ex-define-cmd "k[ill]m" #'+evil:kill-matching-buffers)
|
||||||
(evil-ex-define-cmd "k[ill]o" #'doom/kill-other-buffers)
|
(evil-ex-define-cmd "k[ill]o" #'doom/kill-other-buffers)
|
||||||
(evil-ex-define-cmd "k[ill]b" #'doom/kill-buried-buffers)
|
(evil-ex-define-cmd "k[ill]b" #'doom/kill-buried-buffers)
|
||||||
(evil-ex-define-cmd "l[ast]" #'doom/popup-restore)
|
(evil-ex-define-cmd "l[ast]" #'+popup/restore)
|
||||||
(evil-ex-define-cmd "messages" #'view-echo-area-messages)
|
(evil-ex-define-cmd "messages" #'view-echo-area-messages)
|
||||||
(evil-ex-define-cmd "pop[up]" #'doom/popup-this-buffer)
|
(evil-ex-define-cmd "pop[up]" #'+popup/buffer)
|
||||||
|
|
||||||
;;; Project navigation
|
;;; Project navigation
|
||||||
(evil-ex-define-cmd "a" #'projectile-find-other-file)
|
(evil-ex-define-cmd "a" #'projectile-find-other-file)
|
||||||
|
@ -100,4 +98,8 @@
|
||||||
(evil-ex-define-cmd "tabsave" #'+workspace:save)
|
(evil-ex-define-cmd "tabsave" #'+workspace:save)
|
||||||
|
|
||||||
;;; Org-mode
|
;;; Org-mode
|
||||||
(evil-ex-define-cmd "cap" #'org-capture)
|
(evil-ex-define-cmd "cap[ture]" #'org-capture)
|
||||||
|
|
||||||
|
;;; ibuffer
|
||||||
|
(when (featurep! :emacs ibuffer)
|
||||||
|
(evil-ex-define-cmd "buffers" #'ibuffer))
|
||||||
|
|
|
@ -1,250 +0,0 @@
|
||||||
;;; editor/evil/+everywhere.el -*- lexical-binding: t; -*-
|
|
||||||
|
|
||||||
;; We load evil-collection ourselves for these reasons:
|
|
||||||
;;
|
|
||||||
;; 1. To truly lazy load it. Some of its modules, like
|
|
||||||
;; evil-collection-{elisp-mode,buff-menu} are loaded immediately, because
|
|
||||||
;; Emacs loads their packages immediately, which pulls in all of
|
|
||||||
;; evil-collection (and other packages with it, sometimes).
|
|
||||||
;; 2. This ensures a predictable load order, versus lazy loading using :defer or
|
|
||||||
;; :after-call. This means users can use (after! org ...) and be sure that
|
|
||||||
;; their changes will override evil-collection's.
|
|
||||||
;; 3. Ideally, we'd do away with evil-collection entirely. It changes too often,
|
|
||||||
;; introduces breaking bugs too frequently, and I don't agree with all their
|
|
||||||
;; design choices. Regardless, it does more good than trouble, so it may be
|
|
||||||
;; here to stay.
|
|
||||||
;; 4. Adds `+evil-collection-disabled-list', to make it easier for users to
|
|
||||||
;; disable modules, and to reduce the effort required to maintain our copy of
|
|
||||||
;; `evil-collection-list' (now I can just copy it from time to time).
|
|
||||||
|
|
||||||
(defvar +evil-collection-disabled-list
|
|
||||||
'(anaconda-mode
|
|
||||||
buff-menu
|
|
||||||
comint
|
|
||||||
company
|
|
||||||
custom
|
|
||||||
eldoc
|
|
||||||
elisp-mode
|
|
||||||
ert
|
|
||||||
free-keys
|
|
||||||
help
|
|
||||||
helm
|
|
||||||
image
|
|
||||||
kotlin-mode
|
|
||||||
occur
|
|
||||||
package-menu
|
|
||||||
ruby-mode
|
|
||||||
simple
|
|
||||||
slime
|
|
||||||
lispy)
|
|
||||||
"A list of `evil-collection' modules to ignore. See the definition of this
|
|
||||||
variable for an explanation of the defaults (in comments). See
|
|
||||||
`evil-collection-mode-list' for a list of available options.")
|
|
||||||
|
|
||||||
(defvar evil-collection-setup-minibuffer nil)
|
|
||||||
|
|
||||||
;; We do this ourselves, and better.
|
|
||||||
(defvar evil-collection-want-unimpaired-p nil)
|
|
||||||
|
|
||||||
;; We handle loading evil-collection ourselves
|
|
||||||
(defvar evil-collection--supported-modes nil)
|
|
||||||
|
|
||||||
;; This has to be defined here since evil-collection doesn't autoload its own.
|
|
||||||
;; It must be updated whenever evil-collection updates theirs. Here's an easy
|
|
||||||
;; way to update it:
|
|
||||||
;;
|
|
||||||
;; (with-current-buffer
|
|
||||||
;; (url-retrieve-synchronously "https://raw.githubusercontent.com/emacs-evil/evil-collection/master/evil-collection.el" t t)
|
|
||||||
;; (goto-char (point-min))
|
|
||||||
;; (when (re-search-forward "^(defvar evil-collection--supported-modes\n[^(]+")
|
|
||||||
;; (let ((list (sexp-at-point)))
|
|
||||||
;; ;; Fixes
|
|
||||||
;; (when (assq 'pdf list)
|
|
||||||
;; (setf (alist-get 'pdf list) '(pdf-tools)))
|
|
||||||
;; (kill-new (prin1-to-string list)))))
|
|
||||||
|
|
||||||
(defvar evil-collection-mode-list
|
|
||||||
`(2048-game
|
|
||||||
ag
|
|
||||||
alchemist
|
|
||||||
anaconda-mode
|
|
||||||
apropos
|
|
||||||
arc-mode
|
|
||||||
bookmark
|
|
||||||
(buff-menu "buff-menu")
|
|
||||||
calc
|
|
||||||
calendar
|
|
||||||
cider
|
|
||||||
cmake-mode
|
|
||||||
comint
|
|
||||||
company
|
|
||||||
compile
|
|
||||||
(custom cus-edit)
|
|
||||||
cus-theme
|
|
||||||
daemons
|
|
||||||
dashboard
|
|
||||||
deadgrep
|
|
||||||
debbugs
|
|
||||||
debug
|
|
||||||
diff-mode
|
|
||||||
dired
|
|
||||||
dired-sidebar
|
|
||||||
disk-usage
|
|
||||||
doc-view
|
|
||||||
docker
|
|
||||||
ebib
|
|
||||||
edbi
|
|
||||||
edebug
|
|
||||||
ediff
|
|
||||||
eglot
|
|
||||||
elfeed
|
|
||||||
elisp-mode
|
|
||||||
elisp-refs
|
|
||||||
elisp-slime-nav
|
|
||||||
emms
|
|
||||||
epa
|
|
||||||
ert
|
|
||||||
eshell
|
|
||||||
eval-sexp-fu
|
|
||||||
evil-mc
|
|
||||||
eww
|
|
||||||
flycheck
|
|
||||||
flymake
|
|
||||||
free-keys
|
|
||||||
geiser
|
|
||||||
ggtags
|
|
||||||
git-timemachine
|
|
||||||
gnus
|
|
||||||
go-mode
|
|
||||||
grep
|
|
||||||
guix
|
|
||||||
hackernews
|
|
||||||
helm
|
|
||||||
help
|
|
||||||
helpful
|
|
||||||
hg-histedit
|
|
||||||
hungry-delete
|
|
||||||
ibuffer
|
|
||||||
image
|
|
||||||
image-dired
|
|
||||||
image+
|
|
||||||
imenu-list
|
|
||||||
indium
|
|
||||||
info
|
|
||||||
ivy
|
|
||||||
js2-mode
|
|
||||||
leetcode
|
|
||||||
lispy
|
|
||||||
log-edit
|
|
||||||
log-view
|
|
||||||
lsp-ui-imenu
|
|
||||||
lua-mode
|
|
||||||
kotlin-mode
|
|
||||||
macrostep
|
|
||||||
man
|
|
||||||
magit
|
|
||||||
magit-todos
|
|
||||||
,@(if evil-collection-setup-minibuffer '(minibuffer))
|
|
||||||
monky
|
|
||||||
mu4e
|
|
||||||
mu4e-conversation
|
|
||||||
neotree
|
|
||||||
notmuch
|
|
||||||
nov
|
|
||||||
(occur replace)
|
|
||||||
omnisharp
|
|
||||||
outline
|
|
||||||
p4
|
|
||||||
(package-menu package)
|
|
||||||
pass
|
|
||||||
(pdf pdf-tools)
|
|
||||||
popup
|
|
||||||
proced
|
|
||||||
process-menu
|
|
||||||
prodigy
|
|
||||||
profiler
|
|
||||||
python
|
|
||||||
quickrun
|
|
||||||
racer
|
|
||||||
realgud
|
|
||||||
reftex
|
|
||||||
restclient
|
|
||||||
rjsx-mode
|
|
||||||
robe
|
|
||||||
rtags
|
|
||||||
ruby-mode
|
|
||||||
simple
|
|
||||||
slime
|
|
||||||
sly
|
|
||||||
tablist
|
|
||||||
tar-mode
|
|
||||||
(term term ansi-term multi-term)
|
|
||||||
tetris
|
|
||||||
tide
|
|
||||||
transmission
|
|
||||||
typescript-mode
|
|
||||||
vc-annotate
|
|
||||||
vc-dir
|
|
||||||
vc-git
|
|
||||||
vdiff
|
|
||||||
view
|
|
||||||
vlf
|
|
||||||
vterm
|
|
||||||
w3m
|
|
||||||
wdired
|
|
||||||
wgrep
|
|
||||||
which-key
|
|
||||||
woman
|
|
||||||
xref
|
|
||||||
youtube-dl
|
|
||||||
(ztree ztree-diff)))
|
|
||||||
|
|
||||||
(defun +evil-collection-init (module &optional disabled-list)
|
|
||||||
"Initialize evil-collection-MODULE.
|
|
||||||
|
|
||||||
Unlike `evil-collection-init', this respects `+evil-collection-disabled-list',
|
|
||||||
and complains if a module is loaded too early (during startup)."
|
|
||||||
(unless (memq (or (car-safe module) module) disabled-list)
|
|
||||||
(doom-log "Initialized evil-collection-%s %s"
|
|
||||||
(or (car-safe module) module)
|
|
||||||
(if doom-init-time "" "(too early!)"))
|
|
||||||
(with-demoted-errors "evil-collection error: %s"
|
|
||||||
(evil-collection-init (list module)))))
|
|
||||||
|
|
||||||
|
|
||||||
;;
|
|
||||||
;;; Bootstrap
|
|
||||||
|
|
||||||
;; These modes belong to packages that Emacs always loads at startup, causing
|
|
||||||
;; evil-collection to load immediately. We avoid this by loading them after
|
|
||||||
;; evil-collection has first loaded...
|
|
||||||
(with-eval-after-load 'evil-collection
|
|
||||||
(mapc #'+evil-collection-init '(comint custom help)))
|
|
||||||
|
|
||||||
;; ...or on first invokation of their associated major/minor modes.
|
|
||||||
(add-transient-hook! 'Buffer-menu-mode
|
|
||||||
(+evil-collection-init '(buff-menu "buff-menu")))
|
|
||||||
(add-transient-hook! 'image-mode
|
|
||||||
(+evil-collection-init 'image))
|
|
||||||
(add-transient-hook! 'emacs-lisp-mode
|
|
||||||
(+evil-collection-init 'elisp-mode))
|
|
||||||
(add-transient-hook! 'occur-mode
|
|
||||||
(+evil-collection-init 'occur))
|
|
||||||
|
|
||||||
(evil-define-key* 'normal process-menu-mode-map
|
|
||||||
"q" #'kill-current-buffer
|
|
||||||
"d" #'process-menu-delete-process)
|
|
||||||
|
|
||||||
;; Don't overwrite the leader keys
|
|
||||||
(setq evil-collection-key-blacklist
|
|
||||||
(list doom-leader-key doom-localleader-key
|
|
||||||
doom-leader-alt-key doom-localleader-alt-key))
|
|
||||||
|
|
||||||
;; HACK Do this ourselves because evil-collection break's `eval-after-load' load
|
|
||||||
;; order by loading their target plugin before applying keys. It'd be too
|
|
||||||
;; much work to accommodate this eveywhere we want to bind our own evil
|
|
||||||
;; keybinds.
|
|
||||||
(dolist (mode evil-collection-mode-list)
|
|
||||||
(dolist (req (or (cdr-safe mode) (list mode)))
|
|
||||||
(with-eval-after-load req
|
|
||||||
(+evil-collection-init mode +evil-collection-disabled-list))))
|
|
|
@ -36,7 +36,6 @@ This holy module brings the vim experience to Emacs.
|
||||||
+ [[https://github.com/TheBB/evil-indent-plus][evil-indent-plus]]
|
+ [[https://github.com/TheBB/evil-indent-plus][evil-indent-plus]]
|
||||||
+ [[https://github.com/edkolev/evil-lion][evil-lion]]
|
+ [[https://github.com/edkolev/evil-lion][evil-lion]]
|
||||||
+ [[https://github.com/redguardtoo/evil-nerd-commenter][evil-nerd-commentary]]
|
+ [[https://github.com/redguardtoo/evil-nerd-commenter][evil-nerd-commentary]]
|
||||||
+ [[https://github.com/redguardtoo/evil-matchit][evil-matchit]]
|
|
||||||
+ [[https://github.com/cofi/evil-numbers][evil-numbers]]
|
+ [[https://github.com/cofi/evil-numbers][evil-numbers]]
|
||||||
+ [[https://github.com/noctuid/evil-textobj-anyblock][evil-textobj-anyblock]]
|
+ [[https://github.com/noctuid/evil-textobj-anyblock][evil-textobj-anyblock]]
|
||||||
+ [[https://github.com/hlissner/evil-snipe][evil-snipe]]
|
+ [[https://github.com/hlissner/evil-snipe][evil-snipe]]
|
||||||
|
@ -72,6 +71,7 @@ The following vim plugins have been ported to evil:
|
||||||
| vim-lion | evil-lion | omap =gl= / =gL= |
|
| vim-lion | evil-lion | omap =gl= / =gL= |
|
||||||
| vim-seek or vim-sneak | evil-snipe | mmap =s= / =S=, omap =z= / =Z= & =x= / =X= |
|
| vim-seek or vim-sneak | evil-snipe | mmap =s= / =S=, omap =z= / =Z= & =x= / =X= |
|
||||||
| vim-surround | evil-embrace and evil-surround | vmap =S=, omap =ys= |
|
| vim-surround | evil-embrace and evil-surround | vmap =S=, omap =ys= |
|
||||||
|
| vim-unimpaired | (provided by Doom) | [[https://github.com/hlissner/doom-emacs/blob/develop/modules/editor/evil/config.el#L413-L460][see the list]] |
|
||||||
|
|
||||||
This module has also ported vim-unimpaired keybinds to Emacs.
|
This module has also ported vim-unimpaired keybinds to Emacs.
|
||||||
|
|
||||||
|
|
|
@ -92,22 +92,6 @@ the only window, use evil-window-move-* (e.g. `evil-window-move-far-left')."
|
||||||
"Swap windows downward."
|
"Swap windows downward."
|
||||||
(interactive) (+evil--window-swap 'down))
|
(interactive) (+evil--window-swap 'down))
|
||||||
|
|
||||||
;;;###autoload
|
|
||||||
(defun +evil/easymotion (&optional state keymap)
|
|
||||||
"Invoke `evil-easymotion' lazily without compromising which-key integration."
|
|
||||||
(interactive (list 'motion 'global))
|
|
||||||
(let ((prefix (this-command-keys)))
|
|
||||||
(require 'evil-easymotion)
|
|
||||||
(evil-define-key* state keymap prefix evilem-map)
|
|
||||||
(setq prefix-arg current-prefix-arg
|
|
||||||
unread-command-events
|
|
||||||
(mapcar (lambda (e) (cons t e))
|
|
||||||
(vconcat (when evil-this-operator
|
|
||||||
(where-is-internal evil-this-operator
|
|
||||||
nil
|
|
||||||
t))
|
|
||||||
prefix)))))
|
|
||||||
|
|
||||||
;;;###autoload (autoload '+evil:apply-macro "editor/evil/autoload/evil" nil t)
|
;;;###autoload (autoload '+evil:apply-macro "editor/evil/autoload/evil" nil t)
|
||||||
(evil-define-operator +evil:apply-macro (beg end)
|
(evil-define-operator +evil:apply-macro (beg end)
|
||||||
"Apply macro to each line."
|
"Apply macro to each line."
|
||||||
|
|
|
@ -7,7 +7,8 @@
|
||||||
|
|
||||||
;;;###autoload (autoload '+evil:defun-txtobj "editor/evil/autoload/textobjects" nil nil)
|
;;;###autoload (autoload '+evil:defun-txtobj "editor/evil/autoload/textobjects" nil nil)
|
||||||
(evil-define-text-object +evil:defun-txtobj (count &optional _beg _end type)
|
(evil-define-text-object +evil:defun-txtobj (count &optional _beg _end type)
|
||||||
"Text object to select the whole buffer."
|
"Text object to select the top-level Lisp form or function definition at
|
||||||
|
point."
|
||||||
(cl-destructuring-bind (beg . end)
|
(cl-destructuring-bind (beg . end)
|
||||||
(bounds-of-thing-at-point 'defun)
|
(bounds-of-thing-at-point 'defun)
|
||||||
(evil-range beg end type)))
|
(evil-range beg end type)))
|
||||||
|
|
|
@ -45,8 +45,6 @@ directives. By default, this only recognizes C directives.")
|
||||||
evil-emacs-state-cursor '(box +evil-emacs-cursor-fn)
|
evil-emacs-state-cursor '(box +evil-emacs-cursor-fn)
|
||||||
evil-insert-state-cursor 'bar
|
evil-insert-state-cursor 'bar
|
||||||
evil-visual-state-cursor 'hollow
|
evil-visual-state-cursor 'hollow
|
||||||
;; must be set before evil/evil-collection is loaded
|
|
||||||
evil-want-keybinding (not (featurep! +everywhere))
|
|
||||||
;; Only do highlighting in selected window so that Emacs has less work
|
;; Only do highlighting in selected window so that Emacs has less work
|
||||||
;; to do highlighting them all.
|
;; to do highlighting them all.
|
||||||
evil-ex-interactive-search-highlight 'selected-window)
|
evil-ex-interactive-search-highlight 'selected-window)
|
||||||
|
@ -146,6 +144,15 @@ directives. By default, this only recognizes C directives.")
|
||||||
(when (eq major-mode 'fundamental-mode)
|
(when (eq major-mode 'fundamental-mode)
|
||||||
(hack-local-variables)))
|
(hack-local-variables)))
|
||||||
|
|
||||||
|
;; HACK Invoking helpful from evil-ex throws a "No recursive edit is in
|
||||||
|
;; progress" error because, between evil-ex and helpful,
|
||||||
|
;; `abort-recursive-edit' gets called one time too many.
|
||||||
|
(defadvice! +evil--fix-helpful-key-in-evil-ex-a (key-sequence)
|
||||||
|
:before #'helpful-key
|
||||||
|
(when (evil-ex-p)
|
||||||
|
(run-at-time 0.1 nil #'helpful-key key-sequence)
|
||||||
|
(abort-recursive-edit)))
|
||||||
|
|
||||||
;; Make ESC (from normal mode) the universal escaper. See `doom-escape-hook'.
|
;; Make ESC (from normal mode) the universal escaper. See `doom-escape-hook'.
|
||||||
(advice-add #'evil-force-normal-state :after #'+evil-escape-a)
|
(advice-add #'evil-force-normal-state :after #'+evil-escape-a)
|
||||||
|
|
||||||
|
@ -165,17 +172,6 @@ directives. By default, this only recognizes C directives.")
|
||||||
(advice-add #'evil-open-above :around #'+evil--insert-newline-above-and-respect-comments-a)
|
(advice-add #'evil-open-above :around #'+evil--insert-newline-above-and-respect-comments-a)
|
||||||
(advice-add #'evil-open-below :around #'+evil--insert-newline-below-and-respect-comments-a)
|
(advice-add #'evil-open-below :around #'+evil--insert-newline-below-and-respect-comments-a)
|
||||||
|
|
||||||
;; Recenter screen after most searches
|
|
||||||
(dolist (fn '(evil-visualstar/begin-search-forward
|
|
||||||
evil-visualstar/begin-search-backward
|
|
||||||
evil-ex-search-word-forward
|
|
||||||
evil-ex-search-word-backward
|
|
||||||
evil-ex-search-next
|
|
||||||
evil-ex-search-previous
|
|
||||||
evil-ex-search-forward
|
|
||||||
evil-ex-search-backward))
|
|
||||||
(advice-add fn :around #'doom-preserve-window-position-a))
|
|
||||||
|
|
||||||
;; --- custom interactive codes -----------
|
;; --- custom interactive codes -----------
|
||||||
;; These arg types will highlight matches in the current buffer
|
;; These arg types will highlight matches in the current buffer
|
||||||
(evil-ex-define-argument-type regexp-match
|
(evil-ex-define-argument-type regexp-match
|
||||||
|
@ -214,6 +210,7 @@ directives. By default, this only recognizes C directives.")
|
||||||
;;; Packages
|
;;; Packages
|
||||||
|
|
||||||
(use-package! evil-easymotion
|
(use-package! evil-easymotion
|
||||||
|
:after-call pre-command-hook
|
||||||
:commands evilem-create evilem-default-keybindings
|
:commands evilem-create evilem-default-keybindings
|
||||||
:config
|
:config
|
||||||
;; Use evil-search backend, instead of isearch
|
;; Use evil-search backend, instead of isearch
|
||||||
|
@ -221,7 +218,6 @@ directives. By default, this only recognizes C directives.")
|
||||||
:bind ((evil-ex-search-highlight-all nil)))
|
:bind ((evil-ex-search-highlight-all nil)))
|
||||||
(evilem-make-motion evilem-motion-search-previous #'evil-ex-search-previous
|
(evilem-make-motion evilem-motion-search-previous #'evil-ex-search-previous
|
||||||
:bind ((evil-ex-search-highlight-all nil)))
|
:bind ((evil-ex-search-highlight-all nil)))
|
||||||
|
|
||||||
(evilem-make-motion evilem-motion-search-word-forward #'evil-ex-search-word-forward
|
(evilem-make-motion evilem-motion-search-word-forward #'evil-ex-search-word-forward
|
||||||
:bind ((evil-ex-search-highlight-all nil)))
|
:bind ((evil-ex-search-highlight-all nil)))
|
||||||
(evilem-make-motion evilem-motion-search-word-backward #'evil-ex-search-word-backward
|
(evilem-make-motion evilem-motion-search-word-backward #'evil-ex-search-word-backward
|
||||||
|
@ -403,26 +399,6 @@ To change these keys see `+evil-repeat-keys'."
|
||||||
evil-ex-search-previous evil-ex-search-next)
|
evil-ex-search-previous evil-ex-search-next)
|
||||||
|
|
||||||
|
|
||||||
;; `evil-collection'
|
|
||||||
(when (featurep! +everywhere)
|
|
||||||
(setq evil-collection-company-use-tng (featurep! :completion company +tng))
|
|
||||||
|
|
||||||
(unless doom-reloading-p
|
|
||||||
(load! "+everywhere"))
|
|
||||||
|
|
||||||
;; Don't let evil-collection interfere with certain keys
|
|
||||||
(appendq! evil-collection-key-blacklist
|
|
||||||
(append (when (featurep! :tools lookup)
|
|
||||||
'("gd" "gf" "K"))
|
|
||||||
(when (featurep! :tools eval)
|
|
||||||
'("gr" "gR"))
|
|
||||||
'("[" "]" "gz" "<escape>")))
|
|
||||||
|
|
||||||
(defadvice! +evil-collection-disable-blacklist-a (orig-fn)
|
|
||||||
:around #'evil-collection-vterm-toggle-send-escape ; allow binding to ESC
|
|
||||||
(let (evil-collection-key-blacklist)
|
|
||||||
(funcall-interactively orig-fn))))
|
|
||||||
|
|
||||||
;; Keybinds that have no Emacs+evil analogues (i.e. don't exist):
|
;; Keybinds that have no Emacs+evil analogues (i.e. don't exist):
|
||||||
;; zq - mark word at point as good word
|
;; zq - mark word at point as good word
|
||||||
;; zw - mark word at point as bad
|
;; zw - mark word at point as bad
|
||||||
|
@ -567,6 +543,7 @@ To change these keys see `+evil-repeat-keys'."
|
||||||
|
|
||||||
;; evil-easymotion (see `+evil/easymotion')
|
;; evil-easymotion (see `+evil/easymotion')
|
||||||
(:after evil-easymotion
|
(:after evil-easymotion
|
||||||
|
:m "gs" evilem-map
|
||||||
(:map evilem-map
|
(:map evilem-map
|
||||||
"a" (evilem-create #'evil-forward-arg)
|
"a" (evilem-create #'evil-forward-arg)
|
||||||
"A" (evilem-create #'evil-backward-arg)
|
"A" (evilem-create #'evil-backward-arg)
|
||||||
|
|
269
modules/editor/evil/init.el
Normal file
269
modules/editor/evil/init.el
Normal file
|
@ -0,0 +1,269 @@
|
||||||
|
;;; editor/evil/init.el -*- lexical-binding: t; -*-
|
||||||
|
|
||||||
|
;; We load evil-collection ourselves for these reasons:
|
||||||
|
;;
|
||||||
|
;; 1. To truly lazy load it. Some of its modules, like
|
||||||
|
;; evil-collection-{elisp-mode,buff-menu} are loaded immediately, because
|
||||||
|
;; Emacs loads their packages immediately, which pulls in all of
|
||||||
|
;; evil-collection (and other packages with it, sometimes).
|
||||||
|
;; 2. This ensures a predictable load order, versus lazy loading using :defer or
|
||||||
|
;; :after-call. This means users can use (after! org ...) and be sure that
|
||||||
|
;; their changes will override evil-collection's.
|
||||||
|
;; 3. Ideally, we'd do away with evil-collection entirely. It changes too often,
|
||||||
|
;; introduces breaking bugs too frequently, and I don't agree with all their
|
||||||
|
;; design choices. Regardless, it does more good than trouble, so it may be
|
||||||
|
;; here to stay.
|
||||||
|
;; 4. Adds `+evil-collection-disabled-list', to make it easier for users to
|
||||||
|
;; disable modules, and to reduce the effort required to maintain our copy of
|
||||||
|
;; `evil-collection-list' (now I can just copy it from time to time).
|
||||||
|
|
||||||
|
(when (and doom-interactive-mode
|
||||||
|
(not doom-reloading-p)
|
||||||
|
(featurep! +everywhere))
|
||||||
|
|
||||||
|
(setq evil-collection-company-use-tng (featurep! :completion company +tng)
|
||||||
|
;; must be set before evil/evil-collection is loaded
|
||||||
|
evil-want-keybinding nil)
|
||||||
|
|
||||||
|
(defvar +evil-collection-disabled-list
|
||||||
|
'(anaconda-mode
|
||||||
|
buff-menu
|
||||||
|
comint
|
||||||
|
company
|
||||||
|
custom
|
||||||
|
eldoc
|
||||||
|
elisp-mode
|
||||||
|
ert
|
||||||
|
free-keys
|
||||||
|
help
|
||||||
|
helm
|
||||||
|
image
|
||||||
|
kotlin-mode
|
||||||
|
occur
|
||||||
|
package-menu
|
||||||
|
ruby-mode
|
||||||
|
simple
|
||||||
|
slime
|
||||||
|
lispy)
|
||||||
|
"A list of `evil-collection' modules to ignore. See the definition of this
|
||||||
|
variable for an explanation of the defaults (in comments). See
|
||||||
|
`evil-collection-mode-list' for a list of available options.")
|
||||||
|
|
||||||
|
(defvar evil-collection-setup-minibuffer nil)
|
||||||
|
|
||||||
|
;; We do this ourselves, and better.
|
||||||
|
(defvar evil-collection-want-unimpaired-p nil)
|
||||||
|
|
||||||
|
;; We handle loading evil-collection ourselves
|
||||||
|
(defvar evil-collection--supported-modes nil)
|
||||||
|
|
||||||
|
;; This has to be defined here since evil-collection doesn't autoload its own.
|
||||||
|
;; It must be updated whenever evil-collection updates theirs. Here's an easy
|
||||||
|
;; way to update it:
|
||||||
|
;;
|
||||||
|
;; (with-current-buffer
|
||||||
|
;; (url-retrieve-synchronously "https://raw.githubusercontent.com/emacs-evil/evil-collection/master/evil-collection.el" t t)
|
||||||
|
;; (goto-char (point-min))
|
||||||
|
;; (when (re-search-forward "^(defvar evil-collection--supported-modes\n[^(]+")
|
||||||
|
;; (let ((list (sexp-at-point)))
|
||||||
|
;; ;; Fixes
|
||||||
|
;; (when (assq 'pdf list)
|
||||||
|
;; (setf (alist-get 'pdf list) '(pdf-tools)))
|
||||||
|
;; (let ((diff (cl-set-difference evil-collection-mode-list list :test #'equal)))
|
||||||
|
;; (list (- (length list) (length evil-collection-mode-list))
|
||||||
|
;; diff)
|
||||||
|
;; (message "diff: %s" diff)
|
||||||
|
;; (kill-new (prin1-to-string list))))))
|
||||||
|
|
||||||
|
(defvar evil-collection-mode-list
|
||||||
|
`(2048-game
|
||||||
|
ag
|
||||||
|
alchemist
|
||||||
|
anaconda-mode
|
||||||
|
apropos
|
||||||
|
arc-mode
|
||||||
|
bookmark
|
||||||
|
(buff-menu "buff-menu")
|
||||||
|
calc
|
||||||
|
calendar
|
||||||
|
cider
|
||||||
|
cmake-mode
|
||||||
|
comint
|
||||||
|
company
|
||||||
|
compile
|
||||||
|
(custom cus-edit)
|
||||||
|
cus-theme
|
||||||
|
daemons
|
||||||
|
dashboard
|
||||||
|
deadgrep
|
||||||
|
debbugs
|
||||||
|
debug
|
||||||
|
diff-mode
|
||||||
|
dired
|
||||||
|
dired-sidebar
|
||||||
|
disk-usage
|
||||||
|
doc-view
|
||||||
|
docker
|
||||||
|
ebib
|
||||||
|
edbi
|
||||||
|
edebug
|
||||||
|
ediff
|
||||||
|
eglot
|
||||||
|
elfeed
|
||||||
|
elisp-mode
|
||||||
|
elisp-refs
|
||||||
|
elisp-slime-nav
|
||||||
|
emms
|
||||||
|
epa
|
||||||
|
ert
|
||||||
|
eshell
|
||||||
|
eval-sexp-fu
|
||||||
|
evil-mc
|
||||||
|
eww
|
||||||
|
flycheck
|
||||||
|
flymake
|
||||||
|
free-keys
|
||||||
|
geiser
|
||||||
|
ggtags
|
||||||
|
git-timemachine
|
||||||
|
gnus
|
||||||
|
go-mode
|
||||||
|
grep
|
||||||
|
guix
|
||||||
|
hackernews
|
||||||
|
helm
|
||||||
|
help
|
||||||
|
helpful
|
||||||
|
hg-histedit
|
||||||
|
hungry-delete
|
||||||
|
ibuffer
|
||||||
|
image
|
||||||
|
image-dired
|
||||||
|
image+
|
||||||
|
imenu-list
|
||||||
|
indium
|
||||||
|
info
|
||||||
|
ivy
|
||||||
|
js2-mode
|
||||||
|
leetcode
|
||||||
|
lispy
|
||||||
|
log-edit
|
||||||
|
log-view
|
||||||
|
lsp-ui-imenu
|
||||||
|
lua-mode
|
||||||
|
kotlin-mode
|
||||||
|
macrostep
|
||||||
|
man
|
||||||
|
magit
|
||||||
|
magit-todos
|
||||||
|
,@(if evil-collection-setup-minibuffer '(minibuffer))
|
||||||
|
monky
|
||||||
|
mu4e
|
||||||
|
mu4e-conversation
|
||||||
|
neotree
|
||||||
|
notmuch
|
||||||
|
nov
|
||||||
|
(occur replace)
|
||||||
|
omnisharp
|
||||||
|
outline
|
||||||
|
p4
|
||||||
|
(package-menu package)
|
||||||
|
pass
|
||||||
|
(pdf pdf-tools)
|
||||||
|
popup
|
||||||
|
proced
|
||||||
|
process-menu
|
||||||
|
prodigy
|
||||||
|
profiler
|
||||||
|
python
|
||||||
|
quickrun
|
||||||
|
racer
|
||||||
|
realgud
|
||||||
|
reftex
|
||||||
|
restclient
|
||||||
|
rjsx-mode
|
||||||
|
robe
|
||||||
|
rtags
|
||||||
|
ruby-mode
|
||||||
|
simple
|
||||||
|
slime
|
||||||
|
sly
|
||||||
|
tablist
|
||||||
|
tar-mode
|
||||||
|
(term term ansi-term multi-term)
|
||||||
|
tetris
|
||||||
|
tide
|
||||||
|
transmission
|
||||||
|
typescript-mode
|
||||||
|
vc-annotate
|
||||||
|
vc-dir
|
||||||
|
vc-git
|
||||||
|
vdiff
|
||||||
|
view
|
||||||
|
vlf
|
||||||
|
vterm
|
||||||
|
w3m
|
||||||
|
wdired
|
||||||
|
wgrep
|
||||||
|
which-key
|
||||||
|
woman
|
||||||
|
xref
|
||||||
|
xwidget
|
||||||
|
youtube-dl
|
||||||
|
(ztree ztree-diff)))
|
||||||
|
|
||||||
|
(defun +evil-collection-init (module &optional disabled-list)
|
||||||
|
"Initialize evil-collection-MODULE.
|
||||||
|
|
||||||
|
Unlike `evil-collection-init', this respects `+evil-collection-disabled-list',
|
||||||
|
and complains if a module is loaded too early (during startup)."
|
||||||
|
(unless (memq (or (car-safe module) module) disabled-list)
|
||||||
|
(doom-log "Initialized evil-collection-%s %s"
|
||||||
|
(or (car-safe module) module)
|
||||||
|
(if doom-init-time "" "(too early!)"))
|
||||||
|
(with-demoted-errors "evil-collection error: %s"
|
||||||
|
(evil-collection-init (list module)))))
|
||||||
|
|
||||||
|
;; These modes belong to packages that Emacs always loads at startup, causing
|
||||||
|
;; evil-collection to load immediately. We avoid this by loading them after
|
||||||
|
;; evil-collection has first loaded...
|
||||||
|
(with-eval-after-load 'evil-collection
|
||||||
|
;; Don't let evil-collection interfere with certain keys
|
||||||
|
(setq evil-collection-key-blacklist
|
||||||
|
(append (list doom-leader-key doom-localleader-key
|
||||||
|
doom-leader-alt-key)
|
||||||
|
(when (featurep! :tools lookup)
|
||||||
|
'("gd" "gf" "K"))
|
||||||
|
(when (featurep! :tools eval)
|
||||||
|
'("gr" "gR"))
|
||||||
|
'("[" "]" "gz" "<escape>")))
|
||||||
|
|
||||||
|
(evil-define-key* 'normal process-menu-mode-map
|
||||||
|
"q" #'kill-current-buffer
|
||||||
|
"d" #'process-menu-delete-process)
|
||||||
|
|
||||||
|
(mapc #'+evil-collection-init '(comint custom help)))
|
||||||
|
|
||||||
|
(defadvice! +evil-collection-disable-blacklist-a (orig-fn)
|
||||||
|
:around #'evil-collection-vterm-toggle-send-escape ; allow binding to ESC
|
||||||
|
(let (evil-collection-key-blacklist)
|
||||||
|
(funcall-interactively orig-fn)))
|
||||||
|
|
||||||
|
;; ...or on first invokation of their associated major/minor modes.
|
||||||
|
(add-transient-hook! 'Buffer-menu-mode
|
||||||
|
(+evil-collection-init '(buff-menu "buff-menu")))
|
||||||
|
(add-transient-hook! 'image-mode
|
||||||
|
(+evil-collection-init 'image))
|
||||||
|
(add-transient-hook! 'emacs-lisp-mode
|
||||||
|
(+evil-collection-init 'elisp-mode))
|
||||||
|
(add-transient-hook! 'occur-mode
|
||||||
|
(+evil-collection-init '(occur replace)))
|
||||||
|
|
||||||
|
;; HACK Do this ourselves because evil-collection break's `eval-after-load'
|
||||||
|
;; load order by loading their target plugin before applying keys. This
|
||||||
|
;; makes it hard for end-users to overwrite these keybinds with a
|
||||||
|
;; simple `after!' or `with-eval-after-load'.
|
||||||
|
(dolist (mode evil-collection-mode-list)
|
||||||
|
(dolist (req (or (cdr-safe mode) (list mode)))
|
||||||
|
(with-eval-after-load req
|
||||||
|
(+evil-collection-init mode +evil-collection-disabled-list)))))
|
|
@ -1,7 +1,7 @@
|
||||||
;; -*- no-byte-compile: t; -*-
|
;; -*- no-byte-compile: t; -*-
|
||||||
;;; editor/evil/packages.el
|
;;; editor/evil/packages.el
|
||||||
|
|
||||||
(package! evil :pin "7c42ba4de0")
|
(package! evil :pin "8aa6337fa8")
|
||||||
(package! evil-args :pin "758ad5ae54")
|
(package! evil-args :pin "758ad5ae54")
|
||||||
(package! evil-easymotion :pin "79c13ed3bc")
|
(package! evil-easymotion :pin "79c13ed3bc")
|
||||||
(package! evil-embrace :pin "4379adea03")
|
(package! evil-embrace :pin "4379adea03")
|
||||||
|
@ -9,16 +9,16 @@
|
||||||
(package! evil-exchange :pin "3030e21ee1")
|
(package! evil-exchange :pin "3030e21ee1")
|
||||||
(package! evil-indent-plus :pin "0c7501e6ef")
|
(package! evil-indent-plus :pin "0c7501e6ef")
|
||||||
(package! evil-lion :pin "6b03593f5d")
|
(package! evil-lion :pin "6b03593f5d")
|
||||||
(package! evil-nerd-commenter :pin "fa40dab8d2")
|
(package! evil-nerd-commenter :pin "747e346f11")
|
||||||
(package! evil-numbers
|
(package! evil-numbers
|
||||||
:recipe (:host github :repo "janpath/evil-numbers")
|
:recipe (:host github :repo "janpath/evil-numbers")
|
||||||
:pin "d988041c1f")
|
:pin "c2cfdd1eb1")
|
||||||
(package! evil-snipe :pin "3ec8adfd49")
|
(package! evil-snipe :pin "3ec8adfd49")
|
||||||
(package! evil-surround :pin "9b0b17f06c")
|
(package! evil-surround :pin "9b0b17f06c")
|
||||||
(package! evil-textobj-anyblock :pin "ff00980f06")
|
(package! evil-textobj-anyblock :pin "ff00980f06")
|
||||||
(package! evil-traces :pin "bc25cae9fa")
|
(package! evil-traces :pin "bc25cae9fa")
|
||||||
(package! evil-visualstar :pin "06c053d8f7")
|
(package! evil-visualstar :pin "06c053d8f7")
|
||||||
(package! exato :pin "88266fa7fc")
|
(package! exato :pin "d5daea3017")
|
||||||
(package! evil-quick-diff
|
(package! evil-quick-diff
|
||||||
:recipe (:host github :repo "rgrinberg/evil-quick-diff")
|
:recipe (:host github :repo "rgrinberg/evil-quick-diff")
|
||||||
:pin "69c883720b")
|
:pin "69c883720b")
|
||||||
|
@ -31,4 +31,4 @@
|
||||||
(package! neotree)
|
(package! neotree)
|
||||||
(autoload 'neotree-make-executor "neotree" nil nil 'macro))
|
(autoload 'neotree-make-executor "neotree" nil nil 'macro))
|
||||||
|
|
||||||
(package! evil-collection :pin "e6a4ba695e"))
|
(package! evil-collection :pin "493d523c9b"))
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
;; -*- no-byte-compile: t; -*-
|
;; -*- no-byte-compile: t; -*-
|
||||||
;;; editor/file-templates/packages.el
|
;;; editor/file-templates/packages.el
|
||||||
|
|
||||||
(package! yasnippet :pin "3bf9a3b1af")
|
(package! yasnippet :pin "ac03c2f192")
|
||||||
|
|
|
@ -1,3 +1,4 @@
|
||||||
#!/usr/bin/env `(if (equal (file-name-extension buffer-file-name) "zsh") "zsh" "bash")`
|
#!/usr/bin/env `(if (equal (file-name-extension buffer-file-name) "zsh") "zsh" "bash")`
|
||||||
|
set -euo pipefail
|
||||||
|
|
||||||
$0
|
$0
|
||||||
|
|
|
@ -53,7 +53,19 @@
|
||||||
nil (lambda (_arg) (matlab-forward-sexp)))
|
nil (lambda (_arg) (matlab-forward-sexp)))
|
||||||
(nxml-mode "<!--\\|<[^/>]*[^/]>"
|
(nxml-mode "<!--\\|<[^/>]*[^/]>"
|
||||||
"-->\\|</[^/>]*[^/]>"
|
"-->\\|</[^/>]*[^/]>"
|
||||||
"<!--" sgml-skip-tag-forward nil))
|
"<!--" sgml-skip-tag-forward nil)
|
||||||
|
(latex-mode
|
||||||
|
;; LaTeX-find-matching-end needs to be inside the env
|
||||||
|
("\\\\begin{[a-zA-Z*]+}\\(\\)" 1)
|
||||||
|
"\\\\end{[a-zA-Z*]+}"
|
||||||
|
"%"
|
||||||
|
(lambda (_arg)
|
||||||
|
;; Don't fold whole document, that's useless
|
||||||
|
(unless (save-excursion
|
||||||
|
(search-backward "\\begin{document}"
|
||||||
|
(line-beginning-position) t))
|
||||||
|
(LaTeX-find-matching-end)))
|
||||||
|
nil))
|
||||||
hs-special-modes-alist
|
hs-special-modes-alist
|
||||||
'((t))))))
|
'((t))))))
|
||||||
|
|
||||||
|
|
|
@ -201,7 +201,7 @@ See `+format/buffer' for the interactive version of this function, and
|
||||||
(defalias '+format/buffer #'format-all-buffer)
|
(defalias '+format/buffer #'format-all-buffer)
|
||||||
|
|
||||||
;;;###autoload
|
;;;###autoload
|
||||||
(defun +format/region (beg end &optional arg)
|
(defun +format/region (beg end)
|
||||||
"Runs the active formatter on the lines within BEG and END.
|
"Runs the active formatter on the lines within BEG and END.
|
||||||
|
|
||||||
WARNING: this may not work everywhere. It will throw errors if the region
|
WARNING: this may not work everywhere. It will throw errors if the region
|
||||||
|
@ -211,7 +211,7 @@ snippets or single lines."
|
||||||
(save-restriction
|
(save-restriction
|
||||||
(narrow-to-region beg end)
|
(narrow-to-region beg end)
|
||||||
(let ((+format-region-p t))
|
(let ((+format-region-p t))
|
||||||
(+format/buffer arg))))
|
(+format/buffer))))
|
||||||
|
|
||||||
;;;###autoload
|
;;;###autoload
|
||||||
(defun +format/region-or-buffer ()
|
(defun +format/region-or-buffer ()
|
||||||
|
|
|
@ -3,26 +3,5 @@
|
||||||
(use-package! god-mode
|
(use-package! god-mode
|
||||||
:hook (doom-after-init-modules . god-mode-all)
|
:hook (doom-after-init-modules . god-mode-all)
|
||||||
:config
|
:config
|
||||||
(pushnew! god-exempt-major-modes
|
|
||||||
'Custom-mode
|
|
||||||
'Info-mode
|
|
||||||
'ag-mode
|
|
||||||
'calculator-mode
|
|
||||||
'calendar-mode
|
|
||||||
'cider-test-report-mode
|
|
||||||
'compilation-mode
|
|
||||||
'debugger-mode
|
|
||||||
'edebug-mode
|
|
||||||
'ediff-mode
|
|
||||||
'eww-mode
|
|
||||||
'geben-breakpoint-list-mode
|
|
||||||
'ibuffer-mode
|
|
||||||
'org-agenda-mode
|
|
||||||
'pdf-outline-buffer-mode
|
|
||||||
'recentf-dialog-mode
|
|
||||||
'sldb-mode
|
|
||||||
'sly-db-mode
|
|
||||||
'wdired-mode)
|
|
||||||
|
|
||||||
(add-hook 'post-command-hook #'+god--configure-cursor-and-modeline-h)
|
(add-hook 'post-command-hook #'+god--configure-cursor-and-modeline-h)
|
||||||
(add-hook 'overwrite-mode-hook #'+god--toggle-on-overwrite-h))
|
(add-hook 'overwrite-mode-hook #'+god--toggle-on-overwrite-h))
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
;; -*- no-byte-compile: t; -*-
|
;; -*- no-byte-compile: t; -*-
|
||||||
;;; editor/god/packages.el
|
;;; editor/god/packages.el
|
||||||
|
|
||||||
(package! god-mode :pin "344167ed9b")
|
(package! god-mode :pin "1eb6ef3a4f")
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
;;; editor/lispy/config.el -*- lexical-binding: t; -*-
|
;;; editor/lispy/config.el -*- lexical-binding: t; -*-
|
||||||
|
|
||||||
(use-package! lispy
|
(use-package! lispy
|
||||||
:hook ((common-lisp-mode . lispy-mode)
|
:hook ((lisp-mode . lispy-mode)
|
||||||
(emacs-lisp-mode . lispy-mode)
|
(emacs-lisp-mode . lispy-mode)
|
||||||
(scheme-mode . lispy-mode)
|
(scheme-mode . lispy-mode)
|
||||||
(racket-mode . lispy-mode)
|
(racket-mode . lispy-mode)
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
;; -*- no-byte-compile: t; -*-
|
;; -*- no-byte-compile: t; -*-
|
||||||
;;; editor/lispyville/packages.el
|
;;; editor/lispyville/packages.el
|
||||||
|
|
||||||
(package! lispy :pin "d6b19fe2c3")
|
(package! lispy :pin "c7e282ae06")
|
||||||
(when (featurep! :editor evil)
|
(when (featurep! :editor evil)
|
||||||
(package! lispyville :pin "56198f1c44"))
|
(package! lispyville :pin "25a70126ea"))
|
||||||
|
|
|
@ -82,6 +82,22 @@
|
||||||
:test #'eq
|
:test #'eq
|
||||||
:key #'car))
|
:key #'car))
|
||||||
|
|
||||||
|
;; HACK Allow these commands to be repeated by prefixing them with a numerical
|
||||||
|
;; argument. See gabesoft/evil-mc#110
|
||||||
|
(defadvice! +multiple-cursors--make-repeatable-a (orig-fn)
|
||||||
|
:around '(evil-mc-make-and-goto-first-cursor
|
||||||
|
evil-mc-make-and-goto-last-cursor
|
||||||
|
evil-mc-make-and-goto-prev-cursor
|
||||||
|
evil-mc-make-and-goto-next-cursor
|
||||||
|
evil-mc-skip-and-goto-prev-cursor
|
||||||
|
evil-mc-skip-and-goto-next-cursor
|
||||||
|
evil-mc-make-and-goto-prev-match
|
||||||
|
evil-mc-make-and-goto-next-match
|
||||||
|
evil-mc-skip-and-goto-prev-match
|
||||||
|
evil-mc-skip-and-goto-next-match)
|
||||||
|
(dotimes (i (if (integerp current-prefix-arg) current-prefix-arg 1))
|
||||||
|
(funcall orig-fn)))
|
||||||
|
|
||||||
;; If we're entering insert mode, it's a good bet that we want to start using
|
;; If we're entering insert mode, it's a good bet that we want to start using
|
||||||
;; our multiple cursors
|
;; our multiple cursors
|
||||||
(add-hook 'evil-insert-state-entry-hook #'evil-mc-resume-cursors)
|
(add-hook 'evil-insert-state-entry-hook #'evil-mc-resume-cursors)
|
||||||
|
|
|
@ -4,9 +4,7 @@
|
||||||
:after-call pre-command-hook
|
:after-call pre-command-hook
|
||||||
:config
|
:config
|
||||||
;; Prevent undo actions from exiting edit state
|
;; Prevent undo actions from exiting edit state
|
||||||
(add-to-list 'objed-keeper-commands 'undo-tree-undo)
|
(pushnew! objed-keeper-commands 'undo-fu-only-undo 'undo-fu-only-redo)
|
||||||
(add-to-list 'objed-keeper-commands 'undo-tree-redo)
|
|
||||||
(add-to-list 'objed-keeper-commands 'undo-tree-visualize)
|
|
||||||
|
|
||||||
(defvar +objed--extra-face-remaps nil)
|
(defvar +objed--extra-face-remaps nil)
|
||||||
|
|
||||||
|
|
|
@ -5,9 +5,10 @@
|
||||||
|
|
||||||
|
|
||||||
;;
|
;;
|
||||||
;; Packages
|
;;; Packages
|
||||||
|
|
||||||
(use-package! yasnippet
|
(use-package! yasnippet
|
||||||
|
:defer-incrementally eldoc easymenu help-mode
|
||||||
:commands (yas-minor-mode-on
|
:commands (yas-minor-mode-on
|
||||||
yas-expand
|
yas-expand
|
||||||
yas-expand-snippet
|
yas-expand-snippet
|
||||||
|
@ -19,9 +20,11 @@
|
||||||
;; Remove default ~/.emacs.d/snippets
|
;; Remove default ~/.emacs.d/snippets
|
||||||
(defvar yas-snippet-dirs nil)
|
(defvar yas-snippet-dirs nil)
|
||||||
|
|
||||||
;; Ensure `yas-reload-all' is called as late as possible. Other modules could
|
(unless (daemonp)
|
||||||
;; have additional configuration for yasnippet. For example, file-templates.
|
;; Ensure `yas-reload-all' is called as late as possible. Other modules
|
||||||
(add-transient-hook! 'yas-minor-mode-hook (yas-reload-all))
|
;; could have additional configuration for yasnippet. For example,
|
||||||
|
;; file-templates.
|
||||||
|
(add-transient-hook! 'yas-minor-mode-hook (yas-reload-all)))
|
||||||
|
|
||||||
(add-hook! '(text-mode-hook
|
(add-hook! '(text-mode-hook
|
||||||
prog-mode-hook
|
prog-mode-hook
|
||||||
|
@ -30,24 +33,28 @@
|
||||||
#'yas-minor-mode-on)
|
#'yas-minor-mode-on)
|
||||||
|
|
||||||
:config
|
:config
|
||||||
(setq yas-verbosity (if doom-debug-mode 3 0)
|
|
||||||
yas-also-auto-indent-first-line t)
|
|
||||||
|
|
||||||
(add-to-list 'load-path +snippets-dir)
|
|
||||||
;; default snippets library, if available
|
|
||||||
(require 'doom-snippets nil t)
|
|
||||||
|
|
||||||
;; Allow private snippets in DOOMDIR/snippets
|
;; Allow private snippets in DOOMDIR/snippets
|
||||||
(add-to-list 'yas-snippet-dirs '+snippets-dir)
|
(add-to-list 'yas-snippet-dirs '+snippets-dir)
|
||||||
|
|
||||||
;; In case `+snippets-dir' and `doom-snippets-dir' are the same
|
;; Reduce verbosity. 3 is too chatty about initializing yasnippet. 2 is just
|
||||||
|
;; right (only shows errors).
|
||||||
|
(setq yas-verbosity (if doom-debug-mode 3 0))
|
||||||
|
;; Ensure the snippet is properly indented
|
||||||
|
(setq yas-also-auto-indent-first-line t)
|
||||||
|
|
||||||
|
;; default snippets library, if available
|
||||||
|
(add-to-list 'load-path +snippets-dir)
|
||||||
|
(require 'doom-snippets nil t)
|
||||||
|
|
||||||
|
;; HACK In case `+snippets-dir' and `doom-snippets-dir' are the same, or
|
||||||
|
;; duplicates exist in `yas-snippet-dirs'.
|
||||||
(advice-add #'yas-snippet-dirs :filter-return #'delete-dups)
|
(advice-add #'yas-snippet-dirs :filter-return #'delete-dups)
|
||||||
|
|
||||||
;; Remove GUI dropdown prompt (prefer ivy/helm)
|
;; Remove GUI dropdown prompt (prefer ivy/helm)
|
||||||
(delq! 'yas-dropdown-prompt yas-prompt-functions)
|
(delq! 'yas-dropdown-prompt yas-prompt-functions)
|
||||||
;; Prioritize private snippets in `+snippets-dir' over built-in ones if there
|
;; Prioritize private snippets in `+snippets-dir' over built-in ones if there
|
||||||
;; are multiple choices.
|
;; are multiple choices.
|
||||||
(add-to-list 'yas-prompt-functions #'+snippets-prompt-private nil #'eq)
|
(add-to-list 'yas-prompt-functions #'+snippets-prompt-private)
|
||||||
|
|
||||||
;; Register `def-project-mode!' modes with yasnippet. This enables project
|
;; Register `def-project-mode!' modes with yasnippet. This enables project
|
||||||
;; specific snippet libraries (e.g. for Laravel, React or Jekyll projects).
|
;; specific snippet libraries (e.g. for Laravel, React or Jekyll projects).
|
||||||
|
@ -60,22 +67,14 @@
|
||||||
;; tell smartparens overlays not to interfere with yasnippet keybinds
|
;; tell smartparens overlays not to interfere with yasnippet keybinds
|
||||||
(advice-add #'yas-expand :before #'sp-remove-active-pair-overlay))
|
(advice-add #'yas-expand :before #'sp-remove-active-pair-overlay))
|
||||||
|
|
||||||
;; Enable `read-only-mode' for built-in snippets (in `doom-local-dir')
|
|
||||||
(add-hook 'snippet-mode-hook #'+snippets-read-only-maybe-h)
|
|
||||||
|
|
||||||
;; (Evil only) fix off-by-one issue with line-wise visual selections in
|
;; (Evil only) fix off-by-one issue with line-wise visual selections in
|
||||||
;; `yas-insert-snippet', and switches to insert mode afterwards.
|
;; `yas-insert-snippet', and switches to insert mode afterwards.
|
||||||
(advice-add #'yas-insert-snippet :around #'+snippets-expand-on-region-a)
|
(advice-add #'yas-insert-snippet :around #'+snippets-expand-on-region-a)
|
||||||
|
|
||||||
(define-key! snippet-mode-map
|
;; Show keybind hints in snippet header-line
|
||||||
"C-c C-k" #'+snippet--abort
|
|
||||||
"C-c C-e" #'+snippet--edit)
|
|
||||||
(add-hook 'snippet-mode-hook #'+snippets-show-hints-in-header-line-h)
|
(add-hook 'snippet-mode-hook #'+snippets-show-hints-in-header-line-h)
|
||||||
|
;; Enable `read-only-mode' for built-in snippets (in `doom-local-dir')
|
||||||
;; Replace commands with superior alternatives
|
(add-hook 'snippet-mode-hook #'+snippets-read-only-maybe-h)
|
||||||
(define-key! yas-minor-mode-map
|
|
||||||
[remap yas-new-snippet] #'+snippets/new
|
|
||||||
[remap yas-visit-snippet-file] #'+snippets/edit)
|
|
||||||
|
|
||||||
(map! :map yas-keymap
|
(map! :map yas-keymap
|
||||||
"C-e" #'+snippets/goto-end-of-field
|
"C-e" #'+snippets/goto-end-of-field
|
||||||
|
@ -84,7 +83,14 @@
|
||||||
[M-left] #'+snippets/goto-start-of-field
|
[M-left] #'+snippets/goto-start-of-field
|
||||||
[M-backspace] #'+snippets/delete-to-start-of-field
|
[M-backspace] #'+snippets/delete-to-start-of-field
|
||||||
[backspace] #'+snippets/delete-backward-char
|
[backspace] #'+snippets/delete-backward-char
|
||||||
[delete] #'+snippets/delete-forward-char-or-field))
|
[delete] #'+snippets/delete-forward-char-or-field
|
||||||
|
;; Replace commands with superior alternatives
|
||||||
|
:map yas-minor-mode-map
|
||||||
|
[remap yas-new-snippet] #'+snippets/new
|
||||||
|
[remap yas-visit-snippet-file] #'+snippets/edit)
|
||||||
|
|
||||||
|
;; If in a daemon session, front-load this expensive work:
|
||||||
|
(if (daemonp) (yas-reload-all)))
|
||||||
|
|
||||||
|
|
||||||
(use-package! auto-yasnippet
|
(use-package! auto-yasnippet
|
||||||
|
|
|
@ -1,10 +1,10 @@
|
||||||
;; -*- no-byte-compile: t; -*-
|
;; -*- no-byte-compile: t; -*-
|
||||||
;;; editor/snippets/packages.el
|
;;; editor/snippets/packages.el
|
||||||
|
|
||||||
(package! yasnippet :pin "3bf9a3b1af")
|
(package! yasnippet :pin "5b1217ab08")
|
||||||
(package! auto-yasnippet :pin "db9e0dd433")
|
(package! auto-yasnippet :pin "db9e0dd433")
|
||||||
(package! doom-snippets
|
(package! doom-snippets
|
||||||
:recipe (:host github
|
:recipe (:host github
|
||||||
:repo "hlissner/doom-snippets"
|
:repo "hlissner/doom-snippets"
|
||||||
:files ("*.el" "*"))
|
:files ("*.el" "*"))
|
||||||
:pin "2781b782a3")
|
:pin "feaedeb550")
|
||||||
|
|
|
@ -3,10 +3,10 @@
|
||||||
|
|
||||||
(package! diredfl :pin "83567d00af")
|
(package! diredfl :pin "83567d00af")
|
||||||
(package! dired-git-info :pin "b47f2b0c3a")
|
(package! dired-git-info :pin "b47f2b0c3a")
|
||||||
(package! diff-hl :pin "fb9eb1cd3c")
|
(package! diff-hl :pin "2cf8b489f3")
|
||||||
(package! dired-rsync :pin "698294cbd4")
|
(package! dired-rsync :pin "bfd5c155be")
|
||||||
(when (featurep! +ranger)
|
(when (featurep! +ranger)
|
||||||
(package! ranger :pin "af6f781a60"))
|
(package! ranger :pin "af6f781a60"))
|
||||||
(when (featurep! +icons)
|
(when (featurep! +icons)
|
||||||
(package! all-the-icons-dired :pin "980b7747d6"))
|
(package! all-the-icons-dired :pin "816987d339"))
|
||||||
(package! fd-dired :pin "fd4c3f490b")
|
(package! fd-dired :pin "fd4c3f490b")
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
;; -*- no-byte-compile: t; -*-
|
;; -*- no-byte-compile: t; -*-
|
||||||
;;; emacs/ibuffer/packages.el
|
;;; emacs/ibuffer/packages.el
|
||||||
|
|
||||||
(package! ibuffer-projectile :pin "7649621414")
|
(package! ibuffer-projectile :pin "504b0edaa0")
|
||||||
(package! ibuffer-vc :pin "64cb03887b")
|
(package! ibuffer-vc :pin "1249c1e30c")
|
||||||
|
|
54
modules/emacs/undo/README.org
Normal file
54
modules/emacs/undo/README.org
Normal file
|
@ -0,0 +1,54 @@
|
||||||
|
#+TITLE: emacs/undo
|
||||||
|
#+DATE: April 13, 2020
|
||||||
|
#+SINCE: v3.0.0
|
||||||
|
#+STARTUP: inlineimages nofold
|
||||||
|
|
||||||
|
* Table of Contents :TOC_3:noexport:
|
||||||
|
- [[#description][Description]]
|
||||||
|
- [[#maintainers][Maintainers]]
|
||||||
|
- [[#module-flags][Module Flags]]
|
||||||
|
- [[#plugins][Plugins]]
|
||||||
|
- [[#hacks][Hacks]]
|
||||||
|
- [[#prerequisites][Prerequisites]]
|
||||||
|
- [[#features][Features]]
|
||||||
|
- [[#configuration][Configuration]]
|
||||||
|
- [[#troubleshooting][Troubleshooting]]
|
||||||
|
|
||||||
|
* Description
|
||||||
|
This module augments Emacs' built-in undo system to be more intuitive.
|
||||||
|
|
||||||
|
** Maintainers
|
||||||
|
This module has no dedicated maintainers.
|
||||||
|
|
||||||
|
** Module Flags
|
||||||
|
+ =+tree= Uses ~undo-tree~ instead of ~undo-fu~, which is a little less stable,
|
||||||
|
but offers branching undo history and a visualizer for navigating it.
|
||||||
|
|
||||||
|
** Plugins
|
||||||
|
+ [[https://gitlab.com/ideasman42/emacs-undo-fu][undo-fu]]
|
||||||
|
+ [[https://gitlab.com/ideasman42/emacs-undo-fu-session][undo-fu-session]]
|
||||||
|
+ [[https://github.com/emacsmirror/undo-tree][undo-tree]] (=+tree=)
|
||||||
|
|
||||||
|
** Hacks
|
||||||
|
+ Both undo-fu and undo-tree have been modified to use zstd to compress undo
|
||||||
|
history if it is available.
|
||||||
|
+ undo-tree only
|
||||||
|
+ Text properties are stripped from undo history to shrink it.
|
||||||
|
+ Undo-tree is too chatty about saving its history files. This has be
|
||||||
|
"silenced". i.e. It's visible in \*Messages\*, but won't appear in your
|
||||||
|
minibuffer.
|
||||||
|
+ unfo-fu only
|
||||||
|
+ Doom defines =undo-fu-mode= to make it easier to add hooks/mode-local
|
||||||
|
keybinds.
|
||||||
|
|
||||||
|
* Prerequisites
|
||||||
|
This module has no prereqisites.
|
||||||
|
|
||||||
|
* TODO Features
|
||||||
|
# An in-depth list of features, how to use them, and their dependencies.
|
||||||
|
|
||||||
|
* TODO Configuration
|
||||||
|
# How to configure this module, including common problems and how to address them.
|
||||||
|
|
||||||
|
* TODO Troubleshooting
|
||||||
|
# Common issues and their solution, or places to look for help.
|
96
modules/emacs/undo/config.el
Normal file
96
modules/emacs/undo/config.el
Normal file
|
@ -0,0 +1,96 @@
|
||||||
|
;;; emacs/undo/config.el -*- lexical-binding: t; -*-
|
||||||
|
|
||||||
|
(use-package! undo-fu
|
||||||
|
:unless (featurep! +tree)
|
||||||
|
:after-call doom-switch-buffer after-find-file
|
||||||
|
:init
|
||||||
|
(after! undo-tree
|
||||||
|
(global-undo-tree-mode -1))
|
||||||
|
:config
|
||||||
|
;; Store more undo history to prevent loss of data
|
||||||
|
(setq undo-limit 400000
|
||||||
|
undo-strong-limit 3000000
|
||||||
|
undo-outer-limit 3000000)
|
||||||
|
|
||||||
|
(define-minor-mode undo-fu-mode
|
||||||
|
"Enables `undo-fu' for the current session."
|
||||||
|
:keymap (let ((map (make-sparse-keymap)))
|
||||||
|
(define-key map [remap undo] #'undo-fu-only-undo)
|
||||||
|
(define-key map [remap redo] #'undo-fu-only-redo)
|
||||||
|
(define-key map (kbd "C-_") #'undo-fu-only-undo)
|
||||||
|
(define-key map (kbd "M-_") #'undo-fu-only-redo)
|
||||||
|
(define-key map (kbd "C-M-_") #'undo-fu-only-redo-all)
|
||||||
|
(define-key map (kbd "C-x r u") #'undo-fu-session-save)
|
||||||
|
(define-key map (kbd "C-x r U") #'undo-fu-session-recover)
|
||||||
|
map)
|
||||||
|
:init-value nil
|
||||||
|
:global t)
|
||||||
|
|
||||||
|
(undo-fu-mode +1))
|
||||||
|
|
||||||
|
|
||||||
|
(use-package! undo-fu-session
|
||||||
|
:unless (featurep! +tree)
|
||||||
|
:hook (undo-fu-mode . global-undo-fu-session-mode)
|
||||||
|
:preface
|
||||||
|
(setq undo-fu-session-directory (concat doom-cache-dir "undo-fu-session/")
|
||||||
|
undo-fu-session-incompatible-files '("/COMMIT_EDITMSG\\'" "/git-rebase-todo\\'"))
|
||||||
|
|
||||||
|
;; HACK We avoid `:config' here because `use-package's `:after' complicates
|
||||||
|
;; the load order of a package's `:config' block and makes it impossible
|
||||||
|
;; for the user to override its settings with merely `after!' (or
|
||||||
|
;; `eval-after-load'). See jwiegley/use-package#829.
|
||||||
|
(after! undo-fu-session
|
||||||
|
;; HACK Use the faster zstd to compress undo files instead of gzip
|
||||||
|
(when (executable-find "zstd")
|
||||||
|
(defadvice! doom--undo-fu-session-use-zstd-a (filename)
|
||||||
|
:filter-return #'undo-fu-session--make-file-name
|
||||||
|
(if undo-fu-session-compression
|
||||||
|
(concat (file-name-sans-extension filename) ".zst")
|
||||||
|
filename)))))
|
||||||
|
|
||||||
|
|
||||||
|
(use-package! undo-tree
|
||||||
|
:when (featurep! +tree)
|
||||||
|
;; Branching & persistent undo
|
||||||
|
:after-call doom-switch-buffer-hook after-find-file
|
||||||
|
:config
|
||||||
|
(setq undo-tree-visualizer-diff t
|
||||||
|
undo-tree-auto-save-history t
|
||||||
|
undo-tree-enable-undo-in-region t
|
||||||
|
;; Increase undo-limits by a factor of ten to avoid emacs prematurely
|
||||||
|
;; truncating the undo history and corrupting the tree. See
|
||||||
|
;; https://github.com/syl20bnr/spacemacs/issues/12110
|
||||||
|
undo-limit 800000
|
||||||
|
undo-strong-limit 12000000
|
||||||
|
undo-outer-limit 120000000
|
||||||
|
undo-tree-history-directory-alist
|
||||||
|
`(("." . ,(concat doom-cache-dir "undo-tree-hist/"))))
|
||||||
|
|
||||||
|
;; Compress undo-tree history files with zstd, if available. File size isn't
|
||||||
|
;; the (only) concern here: the file IO barrier is slow for Emacs to cross;
|
||||||
|
;; reading a tiny file and piping it in-memory through zstd is *slightly*
|
||||||
|
;; faster than Emacs reading the entire undo-tree file from the get go (on
|
||||||
|
;; SSDs). Whether or not that's true in practice, we still enjoy zstd's ~80%
|
||||||
|
;; file savings (these files add up over time and zstd is so incredibly fast).
|
||||||
|
(when (executable-find "zstd")
|
||||||
|
(defadvice! doom--undo-tree-make-history-save-file-name-a (file)
|
||||||
|
:filter-return #'undo-tree-make-history-save-file-name
|
||||||
|
(concat file ".zst")))
|
||||||
|
|
||||||
|
;; Strip text properties from undo-tree data to stave off bloat. File size
|
||||||
|
;; isn't the concern here; undo cache files bloat easily, which can cause
|
||||||
|
;; freezing, crashes, GC-induced stuttering or delays when opening files.
|
||||||
|
(defadvice! doom--undo-tree-strip-text-properties-a (&rest _)
|
||||||
|
:before #'undo-list-transfer-to-tree
|
||||||
|
(dolist (item buffer-undo-list)
|
||||||
|
(and (consp item)
|
||||||
|
(stringp (car item))
|
||||||
|
(setcar item (substring-no-properties (car item))))))
|
||||||
|
|
||||||
|
;; Undo-tree is too chatty about saving its history files. This doesn't
|
||||||
|
;; totally suppress it logging to *Messages*, it only stops it from appearing
|
||||||
|
;; in the echo-area.
|
||||||
|
(advice-add #'undo-tree-save-history :around #'doom-shut-up-a)
|
||||||
|
|
||||||
|
(global-undo-tree-mode +1))
|
7
modules/emacs/undo/packages.el
Normal file
7
modules/emacs/undo/packages.el
Normal file
|
@ -0,0 +1,7 @@
|
||||||
|
;; -*- no-byte-compile: t; -*-
|
||||||
|
;;; emacs/undo/packages.el
|
||||||
|
|
||||||
|
(if (featurep! +tree)
|
||||||
|
(package! undo-tree :pin "5b6df03781")
|
||||||
|
(package! undo-fu :pin "0c34b6747e")
|
||||||
|
(package! undo-fu-session :pin "b808ef0cdc"))
|
|
@ -5,7 +5,7 @@
|
||||||
(package! vc-annotate :built-in t)
|
(package! vc-annotate :built-in t)
|
||||||
(package! smerge-mode :built-in t)
|
(package! smerge-mode :built-in t)
|
||||||
|
|
||||||
(package! browse-at-remote :pin "771a3079e2")
|
(package! browse-at-remote :pin "6aecae4b5d")
|
||||||
(package! git-timemachine :pin "391eb61050")
|
(package! git-timemachine :pin "391eb61050")
|
||||||
(package! gitconfig-mode :pin "55468314a5")
|
(package! gitconfig-mode :pin "55468314a5")
|
||||||
(package! gitignore-mode :pin "55468314a5")
|
(package! gitignore-mode :pin "55468314a5")
|
||||||
|
|
|
@ -12,10 +12,14 @@
|
||||||
- [[#arch-linux][Arch Linux]]
|
- [[#arch-linux][Arch Linux]]
|
||||||
- [[#nixos][NixOS]]
|
- [[#nixos][NixOS]]
|
||||||
- [[#opensuse][openSUSE]]
|
- [[#opensuse][openSUSE]]
|
||||||
|
- [[#debianubuntu][Debian/Ubuntu]]
|
||||||
- [[#features][Features]]
|
- [[#features][Features]]
|
||||||
- [[#configuration][Configuration]]
|
- [[#configuration][Configuration]]
|
||||||
- [[#offlineimap][offlineimap]]
|
- [[#offlineimap][offlineimap]]
|
||||||
- [[#mbsync][mbsync]]
|
- [[#mbsync][mbsync]]
|
||||||
|
- [[#troubleshooting][Troubleshooting]]
|
||||||
|
- [[#no-such-file-or-directory-mu4e][=No such file or directory, mu4e=]]
|
||||||
|
- [[#void-function-org-time-add-error-on-gentoo][~(void-function org-time-add)~ error on Gentoo]]
|
||||||
|
|
||||||
* Description
|
* Description
|
||||||
This module makes Emacs an email client, using ~mu4e~.
|
This module makes Emacs an email client, using ~mu4e~.
|
||||||
|
@ -54,6 +58,7 @@ Run one of the following commands.
|
||||||
|
|
||||||
#+BEGIN_SRC sh
|
#+BEGIN_SRC sh
|
||||||
sudo pacman -S isync # mbsync
|
sudo pacman -S isync # mbsync
|
||||||
|
# OR
|
||||||
sudo pacman -S offlineimap
|
sudo pacman -S offlineimap
|
||||||
#+END_SRC
|
#+END_SRC
|
||||||
|
|
||||||
|
@ -84,9 +89,18 @@ Remove ~#~ in ~#sync_program=offlineimap~ to choose ~offlineimap~ instead of
|
||||||
sync_program=isync # mbsync
|
sync_program=isync # mbsync
|
||||||
#sync_program=offlineimap
|
#sync_program=offlineimap
|
||||||
|
|
||||||
sudo zypper install maildir-utils $sync_programm
|
sudo zypper install maildir-utils $sync_program
|
||||||
#+END_SRC
|
#+END_SRC
|
||||||
|
|
||||||
|
** Debian/Ubuntu
|
||||||
|
Run the command corresponding to the desired backend and the last one.
|
||||||
|
#+BEGIN_SRC sh
|
||||||
|
sudo apt-get install isync # mbsync
|
||||||
|
# or
|
||||||
|
sudo apt-get install offlineimap
|
||||||
|
# then
|
||||||
|
sudo apt-get install maildir-utils # mu
|
||||||
|
#+END_SRC
|
||||||
* TODO Features
|
* TODO Features
|
||||||
|
|
||||||
* Configuration
|
* Configuration
|
||||||
|
@ -101,7 +115,8 @@ Then you must set up offlineimap and index your mail:
|
||||||
|
|
||||||
1. Write a ~\~/.offlineimaprc~. Mine can be found [[https://github.com/hlissner/dotfiles/tree/master/shell/mu][in my dotfiles repository]]. It
|
1. Write a ~\~/.offlineimaprc~. Mine can be found [[https://github.com/hlissner/dotfiles/tree/master/shell/mu][in my dotfiles repository]]. It
|
||||||
is configured to download mail to ~\~/.mail~. I use [[https://www.passwordstore.org/][unix pass]] to securely
|
is configured to download mail to ~\~/.mail~. I use [[https://www.passwordstore.org/][unix pass]] to securely
|
||||||
store my login credentials.
|
store my login credentials. You can find a *very* detailed configuration
|
||||||
|
[[https://github.com/OfflineIMAP/offlineimap/blob/master/offlineimap.conf][here]].
|
||||||
2. Download your email: ~offlineimap -o~ (may take a while)
|
2. Download your email: ~offlineimap -o~ (may take a while)
|
||||||
3. Index it with mu: ~mu index --maildir ~/.mail~
|
3. Index it with mu: ~mu index --maildir ~/.mail~
|
||||||
|
|
||||||
|
@ -121,3 +136,15 @@ Then configure Emacs to use your email address:
|
||||||
#+END_SRC
|
#+END_SRC
|
||||||
|
|
||||||
** TODO mbsync
|
** TODO mbsync
|
||||||
|
* Troubleshooting
|
||||||
|
** =No such file or directory, mu4e=
|
||||||
|
You will get =No such file or directory, mu4e= errors if you don't run ~doom
|
||||||
|
sync~ after installing =mu= through your package manager.
|
||||||
|
** ~(void-function org-time-add)~ error on Gentoo
|
||||||
|
Gentoo users will see this error because [[https://gitweb.gentoo.org/repo/gentoo.git/tree/net-mail/mu/files/70mu-gentoo.el#n2][the =net-mail/mu= package eagerly loads
|
||||||
|
=mu4e= (which pulls in =org=) much too early]]; before Emacs reads =~/.emacs.d=.
|
||||||
|
So early, that it loads the built-in version of org-mode, rather than the newer
|
||||||
|
version that Doom installs.
|
||||||
|
|
||||||
|
Later versions of the =net-mail/mu= package have [[https://gitweb.gentoo.org/repo/gentoo.git/commit/net-mail/mu?id=770e1fccb119fbce8ba6d16021a3598123f212ff][fixed this issue]], but you may
|
||||||
|
need to switch to the unstable build of =net-mail/mu= to see it.
|
||||||
|
|
|
@ -60,11 +60,7 @@
|
||||||
(setq mail-user-agent 'mu4e-user-agent)
|
(setq mail-user-agent 'mu4e-user-agent)
|
||||||
|
|
||||||
;; Use fancy icons
|
;; Use fancy icons
|
||||||
(setq mu4e-headers-has-child-prefix '("+" . "")
|
(setq mu4e-use-fancy-chars t
|
||||||
mu4e-headers-empty-parent-prefix '("-" . "")
|
|
||||||
mu4e-headers-first-child-prefix '("\\" . "")
|
|
||||||
mu4e-headers-duplicate-prefix '("=" . "")
|
|
||||||
mu4e-headers-default-prefix '("|" . "")
|
|
||||||
mu4e-headers-draft-mark '("D" . "")
|
mu4e-headers-draft-mark '("D" . "")
|
||||||
mu4e-headers-flagged-mark '("F" . "")
|
mu4e-headers-flagged-mark '("F" . "")
|
||||||
mu4e-headers-new-mark '("N" . "")
|
mu4e-headers-new-mark '("N" . "")
|
||||||
|
|
|
@ -2,9 +2,10 @@
|
||||||
|
|
||||||
(use-package! pyim
|
(use-package! pyim
|
||||||
:after-call after-find-file pre-command-hook
|
:after-call after-find-file pre-command-hook
|
||||||
|
:init
|
||||||
|
(setq pyim-dcache-directory (concat doom-cache-dir "pyim/"))
|
||||||
:config
|
:config
|
||||||
(setq pyim-dcache-directory (concat doom-cache-dir "pyim/")
|
(setq pyim-page-tooltip t
|
||||||
pyim-page-tooltip t
|
|
||||||
default-input-method "pyim"))
|
default-input-method "pyim"))
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -1,8 +1,7 @@
|
||||||
;; -*- no-byte-compile: t; -*-
|
;; -*- no-byte-compile: t; -*-
|
||||||
;;; input/chinese/packages.el
|
;;; input/chinese/packages.el
|
||||||
|
|
||||||
(package! pyim :pin "bbeb68605e")
|
(package! pyim :pin "77170724fa")
|
||||||
(package! fcitx :pin "12dc2638dd")
|
(package! fcitx :pin "12dc2638dd")
|
||||||
(package! ace-pinyin :pin "8b2e9335b0")
|
(package! ace-pinyin :pin "8b2e9335b0")
|
||||||
(package! pangu-spacing :pin "f92898949b")
|
(package! pangu-spacing :pin "f92898949b")
|
||||||
(package! pyim :pin "bbeb68605e")
|
|
||||||
|
|
|
@ -3,5 +3,5 @@
|
||||||
|
|
||||||
(package! migemo :pin "f42832c8ac")
|
(package! migemo :pin "f42832c8ac")
|
||||||
(package! avy-migemo :pin "922a6dd82c")
|
(package! avy-migemo :pin "922a6dd82c")
|
||||||
(package! ddskk :pin "51747f7afb")
|
(package! ddskk :pin "f9a2333ec3")
|
||||||
(package! pangu-spacing :pin "f92898949b")
|
(package! pangu-spacing :pin "f92898949b")
|
||||||
|
|
|
@ -6,11 +6,11 @@
|
||||||
:recipe (:host github :repo "agda/agda"
|
:recipe (:host github :repo "agda/agda"
|
||||||
:files ("src/data/emacs-mode/agda-input.el")
|
:files ("src/data/emacs-mode/agda-input.el")
|
||||||
:nonrecursive t)
|
:nonrecursive t)
|
||||||
:pin "74d9fd53cd")
|
:pin "ff9173e14e")
|
||||||
|
|
||||||
(package! agda2-mode
|
(package! agda2-mode
|
||||||
:recipe (:host github :repo "agda/agda"
|
:recipe (:host github :repo "agda/agda"
|
||||||
:files ("src/data/emacs-mode/*.el"
|
:files ("src/data/emacs-mode/*.el"
|
||||||
(:exclude "agda-input.el"))
|
(:exclude "agda-input.el"))
|
||||||
:nonrecursive t)
|
:nonrecursive t)
|
||||||
:pin "74d9fd53cd"))
|
:pin "ff9173e14e"))
|
||||||
|
|
|
@ -1,4 +0,0 @@
|
||||||
;;; lang/assembly/autoload.el -*- lexical-binding: t; -*-
|
|
||||||
|
|
||||||
;;;###autoload
|
|
||||||
(add-to-list 'auto-mode-alist '("\\.hax\\'" . haxor-mode))
|
|
|
@ -1,6 +0,0 @@
|
||||||
;; -*- no-byte-compile: t; -*-
|
|
||||||
;;; lang/assembly/packages.el
|
|
||||||
|
|
||||||
(package! mips-mode :pin "75152fc78b")
|
|
||||||
(package! haxor-mode :pin "6fa25a8e6b")
|
|
||||||
(package! nasm-mode :pin "65ca6546fc")
|
|
|
@ -33,28 +33,24 @@ This is ignored by ccls.")
|
||||||
;;; Packages
|
;;; Packages
|
||||||
|
|
||||||
(use-package! cc-mode
|
(use-package! cc-mode
|
||||||
:commands (c-mode c++-mode objc-mode java-mode)
|
|
||||||
:mode ("\\.mm\\'" . objc-mode)
|
:mode ("\\.mm\\'" . objc-mode)
|
||||||
:init
|
;; Use `c-mode'/`c++-mode'/`objc-mode' depending on heuristics
|
||||||
;; Activate `c-mode', `c++-mode' or `objc-mode' depending on heuristics
|
:mode ("\\.h\\'" . +cc-c-c++-objc-mode)
|
||||||
(add-to-list 'auto-mode-alist '("\\.h\\'" . +cc-c-c++-objc-mode))
|
;; Ensure find-file-at-point recognize system libraries in C modes. It must be
|
||||||
|
;; set up before the likes of irony/lsp are initialized. Also, we use
|
||||||
;; Ensure find-file-at-point works in C modes, must be added before irony
|
;; local-vars hooks to ensure these only run in their respective major modes,
|
||||||
;; and/or lsp hooks are run.
|
;; and not their derived modes.
|
||||||
(add-hook! '(c-mode-local-vars-hook
|
:hook ((c-mode-local-vars c++-mode-local-vars objc-mode-local-vars) . +cc-init-ffap-integration-h)
|
||||||
c++-mode-local-vars-hook
|
;;; Improve fontification in C/C++ (also see `modern-cpp-font-lock')
|
||||||
objc-mode-local-vars-hook)
|
:hook (c-mode-common . rainbow-delimiters-mode)
|
||||||
#'+cc-init-ffap-integration-h)
|
:hook ((c-mode c++-mode) . +cc-fontify-constants-h)
|
||||||
|
|
||||||
:config
|
:config
|
||||||
(set-electric! '(c-mode c++-mode objc-mode java-mode) :chars '(?\n ?\} ?\{))
|
|
||||||
(set-docsets! 'c-mode "C")
|
(set-docsets! 'c-mode "C")
|
||||||
(set-docsets! 'c++-mode "C++" "Boost")
|
(set-docsets! 'c++-mode "C++" "Boost")
|
||||||
|
(set-electric! '(c-mode c++-mode objc-mode java-mode) :chars '(?\n ?\} ?\{))
|
||||||
(set-rotate-patterns! 'c++-mode
|
(set-rotate-patterns! 'c++-mode
|
||||||
:symbols '(("public" "protected" "private")
|
:symbols '(("public" "protected" "private")
|
||||||
("class" "struct")))
|
("class" "struct")))
|
||||||
|
|
||||||
(set-pretty-symbols! '(c-mode c++-mode)
|
(set-pretty-symbols! '(c-mode c++-mode)
|
||||||
;; Functional
|
;; Functional
|
||||||
;; :def "void "
|
;; :def "void "
|
||||||
|
@ -71,9 +67,12 @@ This is ignored by ccls.")
|
||||||
:return "return"
|
:return "return"
|
||||||
:yield "#require")
|
:yield "#require")
|
||||||
|
|
||||||
;;; Better fontification (also see `modern-cpp-font-lock')
|
;; HACK Suppress 'Args out of range' error in when multiple modifications are
|
||||||
(add-hook 'c-mode-common-hook #'rainbow-delimiters-mode)
|
;; performed at once in a `c++-mode' buffer, e.g. with `iedit' or
|
||||||
(add-hook! '(c-mode-hook c++-mode-hook) #'+cc-fontify-constants-h)
|
;; multiple cursors.
|
||||||
|
(undefadvice! +cc--suppress-silly-errors-a (orig-fn &rest args)
|
||||||
|
:around #'c-after-change-mark-abnormal-strings
|
||||||
|
(ignore-errors (apply orig-fn args)))
|
||||||
|
|
||||||
;; Custom style, based off of linux
|
;; Custom style, based off of linux
|
||||||
(setq c-basic-offset tab-width
|
(setq c-basic-offset tab-width
|
||||||
|
@ -122,23 +121,21 @@ This is ignored by ccls.")
|
||||||
|
|
||||||
(use-package! irony
|
(use-package! irony
|
||||||
:unless (featurep! +lsp)
|
:unless (featurep! +lsp)
|
||||||
:commands (irony-install-server irony-mode)
|
:commands irony-install-server
|
||||||
:preface
|
|
||||||
(setq irony-server-install-prefix (concat doom-etc-dir "irony-server/"))
|
|
||||||
:init
|
|
||||||
(add-hook! '(c-mode-local-vars-hook
|
|
||||||
c++-mode-local-vars-hook
|
|
||||||
objc-mode-local-vars-hook)
|
|
||||||
(defun +cc-init-irony-mode-h ()
|
|
||||||
(if (file-directory-p irony-server-install-prefix)
|
|
||||||
(irony-mode +1)
|
|
||||||
(message "Irony server isn't installed"))))
|
|
||||||
:config
|
|
||||||
(setq irony-cdb-search-directory-list '("." "build" "build-conda"))
|
|
||||||
|
|
||||||
;; Initialize compilation database, if present. Otherwise, fall back on
|
;; Initialize compilation database, if present. Otherwise, fall back on
|
||||||
;; `+cc-default-compiler-options'.
|
;; `+cc-default-compiler-options'.
|
||||||
(add-hook 'irony-mode-hook #'+cc-init-irony-compile-options-h)
|
:hook (irony-mode . +cc-init-irony-compile-options-h)
|
||||||
|
;; Only initialize `irony-mode' if the server is available. Otherwise fail
|
||||||
|
;; quietly and gracefully.
|
||||||
|
:hook ((c-mode-local-vars c++-mode-local-vars objc-mode-local-vars) . +cc-init-irony-mode-maybe-h)
|
||||||
|
:preface (setq irony-server-install-prefix (concat doom-etc-dir "irony-server/"))
|
||||||
|
:config
|
||||||
|
(defun +cc-init-irony-mode-maybe-h ()
|
||||||
|
(if (file-directory-p irony-server-install-prefix)
|
||||||
|
(irony-mode +1)
|
||||||
|
(message "Irony server isn't installed")))
|
||||||
|
|
||||||
|
(setq irony-cdb-search-directory-list '("." "build" "build-conda"))
|
||||||
|
|
||||||
(use-package! irony-eldoc
|
(use-package! irony-eldoc
|
||||||
:hook (irony-mode . irony-eldoc))
|
:hook (irony-mode . irony-eldoc))
|
||||||
|
@ -149,19 +146,15 @@ This is ignored by ccls.")
|
||||||
|
|
||||||
(use-package! company-irony
|
(use-package! company-irony
|
||||||
:when (featurep! :completion company)
|
:when (featurep! :completion company)
|
||||||
:init
|
:init (set-company-backend! 'irony-mode '(:separate company-irony-c-headers company-irony))
|
||||||
(set-company-backend! 'irony-mode
|
:config (require 'company-irony-c-headers)))
|
||||||
'(:separate company-irony-c-headers company-irony))
|
|
||||||
:config
|
|
||||||
(require 'company-irony-c-headers)))
|
|
||||||
|
|
||||||
|
|
||||||
;;
|
;;
|
||||||
;; Major modes
|
;; Major modes
|
||||||
|
|
||||||
(use-package! cmake-mode
|
(after! cmake-mode
|
||||||
:defer t
|
(set-docsets! 'cmake-mode "CMake"))
|
||||||
:config (set-docsets! 'cmake-mode "CMake"))
|
|
||||||
|
|
||||||
(use-package! company-cmake ; for `cmake-mode'
|
(use-package! company-cmake ; for `cmake-mode'
|
||||||
:when (featurep! :completion company)
|
:when (featurep! :completion company)
|
||||||
|
@ -184,19 +177,17 @@ This is ignored by ccls.")
|
||||||
|
|
||||||
(use-package! rtags
|
(use-package! rtags
|
||||||
:unless (featurep! +lsp)
|
:unless (featurep! +lsp)
|
||||||
:commands rtags-executable-find
|
;; Only initialize rtags-mode if rtags and rdm are available.
|
||||||
:preface
|
:hook ((c-mode-local-vars c++-mode-local-vars objc-mode-local-vars) . +cc-init-rtags-maybe-h)
|
||||||
(setq rtags-install-path (concat doom-etc-dir "rtags/"))
|
:preface (setq rtags-install-path (concat doom-etc-dir "rtags/"))
|
||||||
:init
|
|
||||||
(add-hook! '(c-mode-local-vars-hook
|
|
||||||
c++-mode-local-vars-hook
|
|
||||||
objc-mode-local-vars-hook)
|
|
||||||
(defun +cc-init-rtags-h ()
|
|
||||||
"Start an rtags server in c-mode and c++-mode buffers."
|
|
||||||
(when (and (require 'rtags nil t)
|
|
||||||
(rtags-executable-find rtags-rdm-binary-name))
|
|
||||||
(rtags-start-process-unless-running))))
|
|
||||||
:config
|
:config
|
||||||
|
(defun +cc-init-rtags-maybe-h ()
|
||||||
|
"Start an rtags server in c-mode and c++-mode buffers.
|
||||||
|
If rtags or rdm aren't available, fail silently instead of throwing a breaking error."
|
||||||
|
(and (require 'rtags nil t)
|
||||||
|
(rtags-executable-find rtags-rdm-binary-name)
|
||||||
|
(rtags-start-process-unless-running)))
|
||||||
|
|
||||||
(setq rtags-autostart-diagnostics t
|
(setq rtags-autostart-diagnostics t
|
||||||
rtags-use-bookmarks nil
|
rtags-use-bookmarks nil
|
||||||
rtags-completions-enabled nil
|
rtags-completions-enabled nil
|
||||||
|
@ -221,11 +212,13 @@ This is ignored by ccls.")
|
||||||
:definition #'rtags-find-symbol-at-point
|
:definition #'rtags-find-symbol-at-point
|
||||||
:references #'rtags-find-references-at-point)
|
:references #'rtags-find-references-at-point)
|
||||||
|
|
||||||
(add-hook! 'kill-emacs-hook (ignore-errors (rtags-cancel-process)))
|
|
||||||
|
|
||||||
;; Use rtags-imenu instead of imenu/counsel-imenu
|
;; Use rtags-imenu instead of imenu/counsel-imenu
|
||||||
(define-key! (c-mode-map c++-mode-map) [remap imenu] #'+cc/imenu)
|
(define-key! (c-mode-map c++-mode-map) [remap imenu] #'+cc/imenu)
|
||||||
|
|
||||||
|
;; Ensure rtags cleans up after itself properly when exiting Emacs, rather
|
||||||
|
;; than display a jarring confirmation prompt for killing it.
|
||||||
|
(add-hook! 'kill-emacs-hook (ignore-errors (rtags-cancel-process)))
|
||||||
|
|
||||||
(add-hook 'rtags-jump-hook #'better-jumper-set-jump)
|
(add-hook 'rtags-jump-hook #'better-jumper-set-jump)
|
||||||
(add-hook 'rtags-after-find-file-hook #'recenter))
|
(add-hook 'rtags-after-find-file-hook #'recenter))
|
||||||
|
|
||||||
|
|
|
@ -17,16 +17,16 @@
|
||||||
:pin "404cd0694a")))
|
:pin "404cd0694a")))
|
||||||
|
|
||||||
(if (featurep! +lsp)
|
(if (featurep! +lsp)
|
||||||
(package! ccls :pin "e5cc4c3e6f")
|
(package! ccls :pin "17ec7bb4cf")
|
||||||
(when (package! irony :pin "8387098286")
|
(when (package! irony :pin "5f75fc0c92")
|
||||||
(package! irony-eldoc :pin "0df5831eaa")
|
(package! irony-eldoc :pin "0df5831eaa")
|
||||||
(when (featurep! :checkers syntax)
|
(when (featurep! :checkers syntax)
|
||||||
(package! flycheck-irony :pin "42dbecd4a8"))
|
(package! flycheck-irony :pin "42dbecd4a8"))
|
||||||
(when (featurep! :completion company)
|
(when (featurep! :completion company)
|
||||||
(package! company-irony :pin "b44711dfce")
|
(package! company-irony :pin "b44711dfce")
|
||||||
(package! company-irony-c-headers :pin "72c386aeb0")))
|
(package! company-irony-c-headers :pin "72c386aeb0")))
|
||||||
(when (package! rtags :pin "31f7842015")
|
(when (package! rtags :pin "d370c09007")
|
||||||
(when (featurep! :completion ivy)
|
(when (featurep! :completion ivy)
|
||||||
(package! ivy-rtags :pin "31f7842015"))
|
(package! ivy-rtags))
|
||||||
(when (featurep! :completion helm)
|
(when (featurep! :completion helm)
|
||||||
(package! helm-rtags :pin "31f7842015"))))
|
(package! helm-rtags))))
|
||||||
|
|
|
@ -15,11 +15,14 @@
|
||||||
- [[#troubleshooting][Troubleshooting]]
|
- [[#troubleshooting][Troubleshooting]]
|
||||||
|
|
||||||
* Description
|
* Description
|
||||||
# A summary of what this module does.
|
This module adds support for the Clojure(Script) language.
|
||||||
|
|
||||||
+ If possible, include a brief list of feature highlights here
|
+ Interactive development environment (~cider~): REPL, compilation, debugging,
|
||||||
+ Like code completion, syntax checking or available snippets
|
running tests, definitions & documentation lookup, code completion, and many
|
||||||
+ Include links to packages & external things where possible
|
more
|
||||||
|
+ Refactoring (~clj-refactor~)
|
||||||
|
+ Linting (~clj-kondo~), requires ~:checkers syntax~
|
||||||
|
+ LSP support
|
||||||
|
|
||||||
** Maintainers
|
** Maintainers
|
||||||
This module has no dedicated maintainers.
|
This module has no dedicated maintainers.
|
||||||
|
@ -30,7 +33,7 @@ This module has no dedicated maintainers.
|
||||||
** Plugins
|
** Plugins
|
||||||
+ [[https://github.com/clojure-emacs/cider][cider]]
|
+ [[https://github.com/clojure-emacs/cider][cider]]
|
||||||
+ [[https://github.com/clojure-emacs/clj-refactor.el][clj-refactor]]
|
+ [[https://github.com/clojure-emacs/clj-refactor.el][clj-refactor]]
|
||||||
+ [[https://github.com/candid82/flycheck-joker][flycheck-joker]]
|
+ [[https://github.com/borkdude/flycheck-clj-kondo][flycheck-clj-kondo]]
|
||||||
|
|
||||||
** Hacks
|
** Hacks
|
||||||
+ Error messages emitted from CIDER are piped into the REPL buffer when it is
|
+ Error messages emitted from CIDER are piped into the REPL buffer when it is
|
||||||
|
@ -44,8 +47,8 @@ This module requires:
|
||||||
+ With =+lsp=
|
+ With =+lsp=
|
||||||
+ clojure-lsp
|
+ clojure-lsp
|
||||||
+ Without =+lsp=
|
+ Without =+lsp=
|
||||||
+ leiningen (REPL)
|
+ [[https://leiningen.org/][leiningen]] (REPL)
|
||||||
+ joker (linter)
|
+ [[https://github.com/borkdude/clj-kondo][clj-kondo]] (linter)
|
||||||
|
|
||||||
* TODO Features
|
* TODO Features
|
||||||
# An in-depth list of features, how to use them, and their dependencies.
|
# An in-depth list of features, how to use them, and their dependencies.
|
||||||
|
|
|
@ -11,21 +11,22 @@
|
||||||
;;
|
;;
|
||||||
;;; Packages
|
;;; Packages
|
||||||
|
|
||||||
;;;###package clojure-mode
|
(use-package! clojure-mode
|
||||||
(add-hook 'clojure-mode-hook #'rainbow-delimiters-mode)
|
:hook (clojure-mode . rainbow-delimiters-mode)
|
||||||
(when (featurep! +lsp)
|
:config
|
||||||
(add-hook! '(clojure-mode-local-vars-hook
|
(when (featurep! +lsp)
|
||||||
clojurec-mode-local-vars-hook
|
(add-hook! '(clojure-mode-local-vars-hook
|
||||||
clojurescript-mode-local-vars-hook)
|
clojurec-mode-local-vars-hook
|
||||||
(defun +clojure-disable-lsp-indentation-h ()
|
clojurescript-mode-local-vars-hook)
|
||||||
(setq-local lsp-enable-indentation nil))
|
(defun +clojure-disable-lsp-indentation-h ()
|
||||||
#'lsp!)
|
(setq-local lsp-enable-indentation nil))
|
||||||
(after! lsp-clojure
|
#'lsp!)
|
||||||
(dolist (m '(clojure-mode
|
(after! lsp-clojure
|
||||||
clojurec-mode
|
(dolist (m '(clojure-mode
|
||||||
clojurescript-mode
|
clojurec-mode
|
||||||
clojurex-mode))
|
clojurescript-mode
|
||||||
(add-to-list 'lsp-language-id-configuration (cons m "clojure")))))
|
clojurex-mode))
|
||||||
|
(add-to-list 'lsp-language-id-configuration (cons m "clojure"))))))
|
||||||
|
|
||||||
|
|
||||||
(use-package! cider
|
(use-package! cider
|
||||||
|
@ -58,13 +59,18 @@
|
||||||
cider-repl-history-quit-action 'delete-and-restore
|
cider-repl-history-quit-action 'delete-and-restore
|
||||||
cider-repl-history-highlight-inserted-item t
|
cider-repl-history-highlight-inserted-item t
|
||||||
cider-repl-history-size 1000
|
cider-repl-history-size 1000
|
||||||
cider-repl-pop-to-buffer-on-connect 'display-only
|
|
||||||
cider-repl-result-prefix ";; => "
|
cider-repl-result-prefix ";; => "
|
||||||
cider-repl-print-length 100
|
cider-repl-print-length 100
|
||||||
cider-repl-use-clojure-font-lock t
|
cider-repl-use-clojure-font-lock t
|
||||||
cider-repl-use-pretty-printing t
|
cider-repl-use-pretty-printing t
|
||||||
cider-repl-wrap-history nil
|
cider-repl-wrap-history nil
|
||||||
cider-stacktrace-default-filters '(tooling dup))
|
cider-stacktrace-default-filters '(tooling dup)
|
||||||
|
|
||||||
|
;; Don't focus the CIDER REPL when it starts. Since it can take so long
|
||||||
|
;; to start up, you either wait for a minute doing nothing or be
|
||||||
|
;; prepared for your cursor to suddenly change buffers without warning.
|
||||||
|
;; See https://github.com/clojure-emacs/cider/issues/1872
|
||||||
|
cider-repl-pop-to-buffer-on-connect 'display-only)
|
||||||
|
|
||||||
;; Error messages emitted from CIDER is silently funneled into *nrepl-server*
|
;; Error messages emitted from CIDER is silently funneled into *nrepl-server*
|
||||||
;; rather than the *cider-repl* buffer. How silly. We might want to see that
|
;; rather than the *cider-repl* buffer. How silly. We might want to see that
|
||||||
|
@ -90,6 +96,8 @@
|
||||||
"\"" #'cider-jack-in-cljs
|
"\"" #'cider-jack-in-cljs
|
||||||
"c" #'cider-connect-clj
|
"c" #'cider-connect-clj
|
||||||
"C" #'cider-connect-cljs
|
"C" #'cider-connect-cljs
|
||||||
|
"m" #'cider-macroexpand-1
|
||||||
|
"M" #'cider-macroexpand-all
|
||||||
(:prefix ("e" . "eval")
|
(:prefix ("e" . "eval")
|
||||||
"b" #'cider-eval-buffer
|
"b" #'cider-eval-buffer
|
||||||
"d" #'cider-eval-defun-at-point
|
"d" #'cider-eval-defun-at-point
|
||||||
|
@ -114,9 +122,6 @@
|
||||||
"e" #'cider-enlighten-mode
|
"e" #'cider-enlighten-mode
|
||||||
"i" #'cider-inspect
|
"i" #'cider-inspect
|
||||||
"r" #'cider-inspect-last-result)
|
"r" #'cider-inspect-last-result)
|
||||||
(:prefix ("m" . "macro")
|
|
||||||
"e" #'cider-macroexpand-1
|
|
||||||
"E" #'cider-macroexpand-all)
|
|
||||||
(:prefix ("n" . "namespace")
|
(:prefix ("n" . "namespace")
|
||||||
"n" #'cider-browse-ns
|
"n" #'cider-browse-ns
|
||||||
"N" #'cider-browse-ns-all
|
"N" #'cider-browse-ns-all
|
||||||
|
@ -159,6 +164,25 @@
|
||||||
:i "U" #'cider-repl-history-undo-other-window)))
|
:i "U" #'cider-repl-history-undo-other-window)))
|
||||||
|
|
||||||
|
|
||||||
|
(after! cider-doc
|
||||||
|
;; Fixes raxod502/radian#446: CIDER tries to do color calculations when it's
|
||||||
|
;; loaded, sometimes too early, causing errors. Better to wait until something
|
||||||
|
;; is actually rendered.
|
||||||
|
(setq cider-docview-code-background-color nil)
|
||||||
|
|
||||||
|
(defadvice! +clojure--defer-color-calculation-a (&rest _)
|
||||||
|
"Set `cider-docview-code-background-color'.
|
||||||
|
This is needed because we have ripped out the code that would normally set it
|
||||||
|
(since that code will run during early init, which is a problem)."
|
||||||
|
:before #'cider-docview-fontify-code-blocks
|
||||||
|
(setq cider-docview-code-background-color (cider-scale-background-color)))
|
||||||
|
|
||||||
|
;; HACK Disable cider's advice on these; and hope no one else is using these
|
||||||
|
;; old-style advice.
|
||||||
|
(ad-deactivate #'enable-theme)
|
||||||
|
(ad-deactivate #'disable-theme))
|
||||||
|
|
||||||
|
|
||||||
(use-package! clj-refactor
|
(use-package! clj-refactor
|
||||||
:hook (clojure-mode . clj-refactor-mode)
|
:hook (clojure-mode . clj-refactor-mode)
|
||||||
:config
|
:config
|
||||||
|
|
|
@ -1,8 +1,9 @@
|
||||||
;; -*- no-byte-compile: t; -*-
|
;; -*- no-byte-compile: t; -*-
|
||||||
;;; lang/clojure/packages.el
|
;;; lang/clojure/packages.el
|
||||||
|
|
||||||
(package! cider :pin "7437c67f0e")
|
(package! clojure-mode :pin "c970c4605c")
|
||||||
(package! clj-refactor :pin "e24ba62843")
|
(package! cider :pin "d63e5652fd")
|
||||||
|
(package! clj-refactor :pin "8259791e05")
|
||||||
|
|
||||||
(when (featurep! :checkers syntax)
|
(when (featurep! :checkers syntax)
|
||||||
(package! flycheck-clj-kondo :pin "f652a8dc4c"))
|
(package! flycheck-clj-kondo :pin "5472c26ffd"))
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
;; -*- no-byte-compile: t; -*-
|
;; -*- no-byte-compile: t; -*-
|
||||||
;;; lang/common-lisp/packages.el
|
;;; lang/common-lisp/packages.el
|
||||||
|
|
||||||
(package! sly :pin "cfecd21410")
|
(package! sly :pin "1382bda945")
|
||||||
(package! sly-macrostep :pin "5113e4e926")
|
(package! sly-macrostep :pin "5113e4e926")
|
||||||
(package! sly-repl-ansi-color :pin "b9cd52d1cf")
|
(package! sly-repl-ansi-color :pin "b9cd52d1cf")
|
||||||
|
|
|
@ -72,11 +72,11 @@
|
||||||
(setq company-coq-disabled-features '(hello company-defaults))
|
(setq company-coq-disabled-features '(hello company-defaults))
|
||||||
|
|
||||||
(if (featurep! :completion company)
|
(if (featurep! :completion company)
|
||||||
(map! :map coq-mode-map [remap company-complete-common]
|
(define-key coq-mode-map [remap company-complete-common]
|
||||||
#'company-indent-or-complete-common)
|
#'company-indent-or-complete-common)
|
||||||
;; `company-coq''s company defaults impose idle-completion on folks, so
|
;; `company-coq''s company defaults impose idle-completion on folks, so
|
||||||
;; we'll set up company ourselves.
|
;; we'll set up company ourselves. See
|
||||||
;; See https://github.com/cpitclaudel/company-coq/issues/42
|
;; https://github.com/cpitclaudel/company-coq/issues/42
|
||||||
(add-to-list 'company-coq-disabled-features 'company))
|
(add-to-list 'company-coq-disabled-features 'company))
|
||||||
|
|
||||||
(map! :map coq-mode-map
|
(map! :map coq-mode-map
|
||||||
|
|
|
@ -1,6 +1,5 @@
|
||||||
;; -*- no-byte-compile: t; -*-
|
;; -*- no-byte-compile: t; -*-
|
||||||
;;; lang/coq/packages.el
|
;;; lang/coq/packages.el
|
||||||
|
|
||||||
(package! proof-general :pin "2a17093f6a")
|
(package! proof-general :pin "9196749d55")
|
||||||
|
(package! company-coq :pin "f9dba9ddff")
|
||||||
(package! company-coq :pin "6e8bc2e367")
|
|
||||||
|
|
|
@ -8,3 +8,8 @@
|
||||||
(sp-point-after-word-p id action context))
|
(sp-point-after-word-p id action context))
|
||||||
((eq action 'autoskip)
|
((eq action 'autoskip)
|
||||||
(/= (char-before) 32)))))
|
(/= (char-before) 32)))))
|
||||||
|
|
||||||
|
;;;###autoload
|
||||||
|
(defun +csharp-kill-omnisharp-server-h ()
|
||||||
|
(unless (doom-buffers-in-mode 'csharp-mode (buffer-list))
|
||||||
|
(omnisharp-stop-server)))
|
||||||
|
|
Some files were not shown because too many files have changed in this diff Show more
Loading…
Add table
Add a link
Reference in a new issue