Defines a new minor-mode `+word-wrap-mode` which configures
adaptive-wrap-prefix-mode and visual-line-mode for smart soft-wrapping
of code.
Evil users can toggle it with `SPC t w`.
Enable globally with `+global-word-wrap-mode`.
See the README for more details!
Instead of relying on the optional ":ui workspaces" feature, the
built-in evil-window-delete is used. ":ui workspaces" remaps the
evil-window-delete already, so no functionality is lost for users of
that feature.
Fixes https://github.com/hlissner/doom-emacs/issues/1640.
This commit does two things:
- Renames def-advice! to defadvice!, in the spirit of naming convenience
macros after the function/macro they enhance or replace.
- Correct the names of advice functions to indicate visibility and
intent. A public advice function like doom-set-jump-a is meant to be
used elsewhere. A private one like +dired--cleanup-header-line-a
shouldn't -- it likely won't work anywhere but the function(s) it was
made to advise.
Calling this pivotal macro "def-package!" has frequently been a source
of confusion. It is a thin wrapper around use-package, and it should be
obvious that it is so. For this reason, and to match the naming
convention used with other convenience macros/wrappers, it is now
use-package!.
Also changes def-package-hook! -> use-package-hook!
The old macros are now marked obsolete and will be removed when straight
integration is merged.
This is second of three big naming convention changes. In this commit,
we change the naming conventions for hook functions and variable
functions:
1. Replace the bar | to indicate a hook function with a -h suffix, e.g.
doom|init-ui -> doom-init-ui-h
doom|run-local-var-hooks -> doom-run-local-var-hooks-h
2. And add a -fn suffix for functions meant to be set on variables,
e.g.
(setq magit-display-buffer-function #'+magit-display-buffer-fn)
See ccf327f8 for the reasoning behind these changes.
This is first of three big naming convention updates that have been a
long time coming. With 2.1 on the horizon, all the breaking updates will
batched together in preparation for the long haul.
In this commit, we do away with the asterix to communicate that a
function is an advice function, and we replace it with the '-a' suffix.
e.g.
doom*shut-up -> doom-shut-up-a
doom*recenter -> doom-recenter-a
+evil*static-reindent -> +evil--static-reindent-a
The rationale behind this change is:
1. Elisp's own formatting/indenting tools would occasionally struggle
with | and * (particularly pp and cl-prettyprint). They have no
problem with / and :, fortunately.
2. External syntax highlighters (like pygmentize, discord markdown or
github markdown) struggle with it, sometimes refusing to highlight
code beyond these symbols.
3. * and | are less expressive than - and -- in communicating the
intended visibility, versatility and stability of a function.
4. It complicated the regexps we must use to search for them.
5. They were arbitrary and over-complicated to begin with, decided
on haphazardly way back when Doom was simply "my private config".
Anyhow, like how predicate functions have the -p suffix, we'll adopt the
-a suffix for advice functions, -h for hook functions and -fn for
variable functions.
Other noteable changes:
- Replaces advice-{add,remove}! macro with new def-advice!
macro. The old pair weren't as useful. The new def-advice! saves on a
lot of space.
- Removed "stage" assertions to make sure you were using the right
macros in the right place. Turned out to not be necessary, we'll
employ better checks later.
- Introduces the +snippets/new (SPC s n) command for creating a new
private snippet
- Introduces the +snippets/new-lias (SPC s N) command for creating a new
private snippet alias, which will invoke another snippet (you will be
prompted to select one). This will only work with the emacs-snippets
library bundled with Doom Emacs, however, as it depends on its API.
- Introduces +snippets/edit (SPC s c) for modifying existing snippets.
How this differs from yas-visit-snippet-file is it will copy the
contents of built-in snippets into a buffer primed for your private
snippets (in DOOMDIR/snippets), while yas-visit-snippet-file will
simply open the originating snippet.
- Introduces the +snippets/find (SPC s ?),
+snippets/find-for-current-mode (SPC s /) and
+snippets/find-private (SPC s f) commands for, respectively, finding a
snippet file among *all* directories in yas-snippet-dirs, finding a
snippet for the current major mode (plus parents), and finding a
snippet from among your private library. This opens built-in snippets
in read-only mode, but you can press C-c C-e to open it in
+snippets/edit.
The former searches the current window/buffer, the latter searches all
windows in the frame.
Removes g s ? (deemed not as useful as avy-goto-char-timer)
They are:
]m, [m
Jump to next/previous beginning of method/function.
]M, [M
Jump to next/previous end of method/function
]#, [#
Jump to next/previous preprocessor directive (only supports C-style
directives for now)
]*, [* (or ]\, [\)
Jump to next/previous comment
Adds these keys, inspired by tpope/vim-unimpaired:
[ SPC, ] SPC (or [o, ]o)
Add COUNT blank lines above/below the cursor
[f, ]f
Visit previous/next file in current folder, alphabetically
[u, ]u
Url encode/decode operators
[y, ]y
C-string-style escaping/unescaping operators (escapes quotes,
backslashes and control characters)
[x, ]x
XML entity encoding/decoding operators (only if :lang web is enabled)
[F, ]F
Focus previous/next frame (decided this is better than ]t/[t which is
being used by hl-todo-{next,previous})
We already had gp and ]b/[b (buffers).
We're not going to port ]e/[e because it is redundant with ddp/ddP or gx
(evil-exchange). I also think these keybinds are better suited to
{next,previous}-error.
The semantics of SPC o t and SPC o T (or SPC o e and SPC o E in eshell's
case) have been reversed.
The lowercase keybind toggles the popup (and the prefix arg forciby
recreates the popup), and the uppercase keybind switches to that
terminal in the current buffer (whose prefix arg will open the terminal
in default-directory, rather than the project root).
- +{term,vterm,eshell}/open have been replaced with +X/here commands and
are bound to SPC o T (and SPC o E in eshell's case).
- +{term,vterm,eshell}/popup* have been replaced with +x/toggle commands
and are bound to SPC o t (and SPC o e in eshell's case).
The "toggle" behavior will do as the name implies, except will select
the popup if it is visible but unfocused.
Setting the flag `+manual` of the `objed` module makes the user
responsible for calling `objed-activate` when needed. The binding
`M-SPC` is set in the default Emacs bindings.
And rebind its keys from C-a/C-S-a to g= and g-. This is because the old
narrow/widen commands aren't nearly as useful (and have a number of
alternative keybinds).
As much as I'd like to us C-a/C-x (as it is in Vim), C-x is an essential
keybind for Emacs.
Also, in visual mode, each number will be affected incrementally (ala g
C-a and g C-x in vim).
Moved scratch buffer to C-c p x and X. This overrides projectile's term
commands, but users should be using the term, vterm and eshell modules'
commands instead.
For non-evil users:
<leader> x doom/open-scratch-buffer
<leader> X doom/switch-to-scratch-buffer
<leader> p s doom/open-project-scratch-buffer
<leader> p S doom/switch-to-project-scratch-buffer
For evil users:
<leader> x doom/open-scratch-buffer
<leader> b s doom/open-scratch-buffer
<leader> b S doom/switch-to-scratch-buffer
<leader> p s doom/open-project-scratch-buffer
<leader> p S doom/switch-to-project-scratch-buffer
Adds the following keybinds:
SPC n . Browses org-directory
SPC n / Text search in org-directory
SPC n * Text search in org-directory with symbol at point
SPC n h Jump to org headline in org-agenda-files
They were throwing 'cannot find docset' errors.
- Adds new +lookup/in-all-docsets command.
- If a prefix arg is passed to +lookup/in-docsets, it will search all
docsets in dash-docs-common-docsets.
Each prefix now defines a doom-leader-DESC-map keymap, where DESC is the
which-key description for that prefix key. This should make it easier
for users to move leader prefixes. e.g.
To move SPC TAB (workspaces) to SPC l:
(map! :leader
"TAB" nil
"l" doom-leader-workspaces-map)
- Renamed doom/open-vanilla-sandbox to doom/sandbox (because it's not
just for vanilla testing anymore)
- Renamed doom/open-bug-report to doom/report-bug (for consistency with
`report-emacs-bug`; makes it easier to discover)
- Add SPC h d b for doom/report-bug
- Add SPC h d s for doom/sandbox
Adds the following commands:
- doom/help (opens the Doom manual)
- doom/help-search (for searching through org headlines in Doom's
documentation)
- doom/help-faq (for searching the FAQ)
- doom/help-news (for browsing the Doom newsletters)
- doom/help-autodefs (renamed from doom/describe-autodef -- for looking
up documentation on autodef function/macros, like
`set-lookup-handler!`)
- doom/help-modules (renamed from doom/describe-module, for jumping to a
Doom module's documentation)
- doom/help-packages (renamed from doom/describe-package and recently
fixed -- looks up information about installed packages, including what
Doom module(s) install it and where it is configured)
- doom/help-package-config (for searching and jumping to any block where
a package is configured in Doom Emacs)
Also adds the SPC h d (or C-h d) prefix for Doom-specific help commands.
SPC h D will invoke doom/help.
However, the documentation itself hasn't been committed yet, so some of
these commands may be useless atm. Sorry!
Macro was renamed to be consistent with other autodefs
- Make these repeaters buffer-local
- Don't bind repeater if motion failed
- Defer evil-snipe repeaters until evil-snipe is loaded
:feature was a "catch-all" category. Many of its modules fit better in
other categories, so they've been moved:
- feature/debugger -> tools/debugger
- feature/evil -> editor/evil
- feature/eval -> tools/eval
- feature/lookup -> tools/lookup
- feature/snippets -> editor/snippets
- feature/file-templates -> editor/file-templates
- feature/workspaces -> ui/workspaces
More potential changes in the future:
- A new :term category for terminal emulation modules (eshell, term and
vterm).
- A new :os category for modules dedicated to os-specific functionality.
The :tools macos module would fit here, but so would modules for nixos
and arch.
- A new :services category for web-service integration, like wakatime,
twitter, elfeed, gist and pastebin services.
Changes
- SPC f . -> Browse files from here
- SPC f / -> Find file from here (recursive)
Moves
- SPC f > -> SPC p > (Find file in another project)
- SPC f ? -> SPC p ? (Browse files in another project w/ find-file)
- Adds doom/open-project-scratch-buffer (persistent project scratch
buffers)
- Prefix arg = open scratch buffer in current window, for both
doom/open-scratch-buffer and doom/open-project-scratch-buffer.
- Rename doom/delete-scratch-files ->
doom/delete-persistent-scratch-file
- Remove doom-scratch-buffer-display-fn
- Rename doom-scratch-files-dir -> doom-scratch-dir
- Add SPC p s keybind to open project scratch buffer
- Moved SPC p x to SPC p i (invalidate cache)
- Add SPC x prefix for opening terminals/ielm at project root
- Add SPC a and SPC d for adding/removing known projects
- Add SPC f for finding a file in other projects
- Add SPC b for switching project buffer (TODO improve ivy/helm support)
- Add SPC k for killing project buffers
- Remove ]s/[s keybinds in org-mode (rebound to ]c/[c); they overwrote
next/prev flyspell error commands (which are vim defaults)
- Remove ]S/[S because z= already exists
- Remove redundant ]s/[s global keybinds (already bound by evil)
- Mention missing and evil's flyspell keybinds in a comment
- Removes +gist/kill-cache (gist-list and gist-list-user with a
universal argument already does this).
- Removes +gist/open-current. No longer necessary when gists aren't
opened in popups.
- Makes keybinds more consistent with other "porcelains", like elfeed's
or magit.
+ Fixes config.org buffer being killed when tangled
+ Tangle files in same session if ob-tangle is loaded (and in
noninteractive sessions). i.e. only tangle quietly when starting up
interactive Emacs.
org-babel-tangle-file has reportedly killed config.org buffers, despite
them being visited. Since we're not doing anything with the return
value, may as well keep it in a separate process.
+ Now recompiles literate config if you modify org files in DOOMDIR
+ Replaced +literate/compile with +literate/reload
+ Calls org-babel-tangle-file directly if org package is loaded
+ Change mtime check mechanism for literate tangling at startup
IMPORTANT: This is a breaking update for Mac users, as your shell
environment will no longer be inherited correctly (with the removal of
exec-path-from-shell). The quick fix is: 'bin/doom env refresh'. Also,
the set-env! autodef now does nothing (and is deprecated), be sure to
remove calls to it in your config.
Smaller changes:
+ This update also adds --no-* switches to doom quickstart
+ Includes general improvements to the documentation of several bin/doom
commands.
+ Moves doom/reload* commands to core/autoload/config.el
+ doom/reload-project has been removed (it didn't actually do anything)
The breaking change:
This update adds an "envvar file" to Doom Emacs. This file is generated
by `doom env refresh`, populated with variables scraped from your shell
environment (from both non-interactive and interactive sessions). This
file is then (inexpensively) loaded at startup, if it exists.
+ The file is manually generated with `doom env refresh`.
+ It can be regenerated automatically whenever `doom refresh` is run by
running `doom env enable` (`doom env clear` will reverse this and
delete the env file).
+ `doom quickstart` will ask if you want to auto-generate this envvar
file. You won't need it if you're confident Emacs will always be
started from the correct environment, however.
+ Your env file can be reloaded from a running Emacs session with `M-x
doom/reload-env`. Note: this won't work if the Emacs session you're
running it in doesn't have a correct SHELL set. i.e. don't use this to
create your first env file!
The idea isn't mine -- it's borrowed from Spacemacs -- and was
introduced to me in #1053 by @yurimx. I was impressed with it. Prior to
this, I was unhappy with exec-path-from-shell (no hate to the dev, I
understand its necessity), and 'doom patch-macos' wasn't ideal for mac
users (needed to be reapplied every time you update Emacs). What's more,
many users (even Linux users) had to install exec-path-from-shell
anyway.
This solution suffers from none of their shortcomings. More reliable
than patch-macos, more performant and complete than
exec-path-from-shell, and easily handled by bin/doom.
- Some buffer-local commands were removed from leader binds
- Some more commands were added to org's localleader
- Reformatted some leader keys so that lower/upper case keys are grouped
together, rather than apart.
- Add SPC-s-c and SPC-s-e for creating/using temporary snippets (with
auto-yasnippet).
- Move profiler from 't' to 'T' (as not to override
`help-with-tutorial', esp for non-evil users)
- Replace C-c (describe-copying) with describe-coding-system
- Bind doom/describe-symbol to 'h'
- Bind `describe-key-briefly' to 'C-k'
Patch the apropos button types so they call helpful instead of the
built-in describe functions. Also add some bindings to apropos-mode-map
so it behaves like other help modes.
Add `doom/describe-symbol` function, which shows documentation for
callable and variable symbols. If a symbol is both a variable and a
callable, it dispatches to apropos. This gives a better workflow than
`helpful-symbol`, which annoyingly prompts the user.
Remap `describe-symbol` to `doom/describe-symbol`, and update
`+emacs-lisp-lookup-documentation` to call it also.
Done to better facilitate a non-evil config.
- Adds winum (and enables support for it in doom-modeline)
- Adds expand-region (#1231)
- Uses default smartparens config for non-evil users (WIP)
The leader keys have been redesigned a) for consistency, b) to reduce
collisions with packages, and c) to improve command coverage. However,
much of it still comes from a vim user, so it needs more testing.
SPC h now maps to help-map to reduce redundancy. Some adjustments and
additions were made to this map so all users (evil and vanilla) can
benefit from Doom's extra help commands.
- Code reduction and refactor across the board (cull unneeded minor
advise, hooks and hacks or update them)
- Revise outdated comments and docstrings
- Reorganize core autoload libraries
- Remove large file check (Emacs already has a built-in one, which we
augment to be even more performant when it does kick in)
- helpful.el can now be disabled completely through package!
They've been removed from feature/workspaces and moved into
core/autoload/sessions, which falls back to desktop.el if persp-mode
isn't present. This also offers a substantial speed up to
restart+restoring and restoring sessions in general.
Also fixes#1210, where the newly spawned frame after doom/restart
wasn't focused.
Introduces the following commands:
- doom/restart
- doom/restart-and-restore
- doom/quickload-session
- doom/quicksave-session
- doom/load-session
- doom/save-session
- +workspace/restore-last-session (alias for doom/quickload-session)
And removes
- +workspace/load-session
- +workspace/save-session
- +workspace/load-last-session (renamed to +workspace/restore-last-session)
- +workspace/restart-emacs-then-restore (replaced by doom/restart-and-restore)
- :ss (ex command)
- :sl (ex command)
This makes text insertion behave more like traditional editors.
Delete-selection-mode allows selections to be replaced when yanking or
inserting. This enables it by default for non-evil users and in insert
mode for evil users. Also enables selecting text with shift.
These commands aren't used by config/default anyway, and
+default:multi-{next,previous}-line were moved to my private config.
Also fixes#1208 (:cd without args will now CD to $HOME).
- SPC f . -> counsel-file-jump or find-file
- SPC f > -> doom/browse-in-other-projects
- SPC f / -> projectile-find-file
- SPC f ? -> doom/find-file-in-other-project
- Moved doom/sudo-find-file to SPC f S
This change was made to accommodate the new
doom/browse-in-other-projects and doom/find-file-in-other-project
commands, which make it easy to jump to files in other known projects.
- SPC o r now prompts for a REPL to open when none was found for the
current buffer.
- REPL handlers must now follow the naming convention "*/open*-repl".
e.g. +python/open-ipython-repl, +emacs-lisp/open-repl, etc.
- +eval/open-repl has been split in two:
- +eval/open-repl-other-window
- +eval/open-repl-same-window
Should also fix void-function/void-variable errors caused by evil-magit
depending on the newer version of magit (#1174).
Also introduces a redesign of the SPC g prefix.