Fixes: vim layer key binding of "J" in dired mode #14614https://github.com/syl20bnr/spacemacs/issues/14614
problem
The evil collection binds "J" to `dired-go-to-file`
It overrides the Spacemacs `helm` and `ivy` equivalent commands.
`spacemacs/helm-find-files' has fuzzy matching and other features
`spacemacs/counsel-find-file' has more `M-o' actions
And the `ivy` layer uses the `spacemacs/helm-find-files` command.
solution
Move the Spacemacs definitions of "J",
after the evil collection dired keys have been setup
from: `spacemacs-bootstrap/packages.el`
to: `spacemacs-evil/init-evil-collection`
And use `spacemacs/counsel-find-file` in the `ivy` layer.
- Add `dumb-jump-xref-activate` hook to `xref-backend-functions`, which
add a fallback option, i.e. `dumb-jump`, when no better alternatives
is availabe
- Removed the obsolte interface `dumb-jump-go` from the following layers:
- clojure
- latex
- vue
- The global binding `SPC j q` requires the obsolte function
`dumb-jump-quick-look` and is therfore removed
problem
The evil-collection is loaded in the spacemacs-evil layer.
The spacemacs-evil layer isn't enabled by default
on the spacemacs-base distribution.
solution
Add buff-menu to the list: spacemacs-evil-collection-allowed-list
after the evil-collection has loaded.
Problem:
With the helm layer, `SPC h SPC` shows:
and: Symbol’s value as variable is void: smartparens-mode
Cause:
The `SPC h SPC` helm buffer generates a section called: Toggles
It checks the status of every toggle mode.
But smartparens-mode has the define-minor-mode :init-value nil
Solution:
Check that the two non-global smartparens modes are bound and true:
smartparens-mode
smartparens-strict-mode
Note:
The smartparens global (strict) mode toggles don't need to be checked,
because they enable smartparens-(strict-)mode.
emacs-lisp and common-lisp-layer had both their own
logic to work with smartparens including manually
requiring it.
This PR makes them use the standard functions. In
addition it replaces the manual require with proper
autoloading of smartparens.
The standard toggles were not respecting the smartparens
mode defined in the dotfile. Also the global mode toggle
was only for the non-strict version.
This PR makes sure that they toggle the correct
smartparens version.
Before layers were sometimes only activating the non strict
version of smartparens. Also some were only disabling
the non-strict version leaving some of the smartparens
advices intact.
With this PR, all layers set the right version of smartparens.
Also if the layer is trying to disable it a standard function
will now take care to disable all versions of smartparens.
Smartparens seems to cause performance issues for
a lot of users. This PR allows to disable the package
completely.
There are some functions in elisp and common-lisp mode
which dependt on this package and will manually require
it when executed though. But this should only affect
lispers which mostly will want to have some kind of
smartparent functionality anyway.
For the discussion see here #12533.
Just like: https://github.com/emacsfodder/move-texthttps://github.com/rejeep/drag-stuff.el
also drags one or more (region) lines up or down.
But it also allows for dragging left and right (across end of lines):
- a word: changing place with the next or previous word.
- a region: moving it one character at a time to the left or right.
Added a new key binding: `SPC x .`
that opens the:
```
Drag Stuff Transient State
[k/K] up [h/H] left [q] quit
[j/J] down [l/L] right
```
The `move-text` package isn't removed, even though it isn't used anymore in
Spacemacs.
Because the `evil-unimpaired` elpa directory is generated from the local
Spacemacs `evil-unimpaired.el` file.
https://github.com/syl20bnr/spacemacs/blob/develop/layers/%2Bspacemacs/spacemacs-evil/local/evil-unimpaired/evil-unimpaired.el
Therefore the `evil-unimpaired` key bindings `[e` and `]e` still call the
`move-text` commands.
Until the `evil-unimpaired` elpa directory has been removed and regenerated by
restarting Spacemacs.
Then they will call the new `drag-stuff` commands.
I don't know if/when the `move-text` package can be removed in the future.
This names the SPC F which-key entry.
before: +prefix
after: Frames
And adds "..." to the end of the descriptions,
for the keys that require additional user interactions.
problem:
trying to open a magit buffer after
reloading the configuration: `SPC f e R`
shows the message:
>Lisp nesting exceeds ‘max-lisp-eval-depth’
cause:
purpose-x-magit-multi-on can't be called twice,
without turning it off first: purpose-x-magit-off
Spacemacs, purpose-x-magit-multi-on, Lisp nesting exceeds ‘max-lisp-eval-depth’
https://github.com/bmag/emacs-purpose/issues/178
solution:
in this case we'll only call: purpose-x-magit-multi-on
once per Emacs session.
notes:
this also removes the call to: with-eval-after-load 'magit
because it's handled upstream:
c85dd3c9f7/window-purpose-x.el (L243)
problem:
Trying to describe a key: `C-h k` `j`
shows:
Symbol’s value as variable is void: string-edit-mode
solution
Don't defer the string-edit package.
This restores the previous Spacemacs
Info-mode and help-mode buffer bindings.
for example:
before:
The square bracket keys are prefixes for one key:
"[u" 'evil-collection-unimpaired-url-encode
"]u" 'evil-collection-unimpaired-url-decode
after:
] ;; Info-forward-node
[ ;; Info-backward-node
] ;; help-go-forward
[ ;; help-go-back
Fixes: Evil keybindings for navigation no longer behave as expected in Info buffers #14375
With purpose and the new layer verification algorithm in place
it looks like the default load order changed causing
`purpose-x-magit-multi-on` to access `magit-display-buffer-function`
before is has been loaded.
Pressing o `(spacemacs/ace-buffer-links)`
on the Spacemacs home buffer `SPC b h`.
Adds an ace link (one or more highlighted letters),
at the menu buttons, and the startup list entries.
problem:
The text: `[S P A C E M A C S]` gets an ace link,
but it isn't a button.
When the [?] button has been pressed, and the Quick Help
is open, then ace links appear on the open square brackets
for each key binding, but they aren't buttons.
In the lists: recent files, projects, etc.
The ace links appear before the first / (slash).
This means that in windows they appear after `c:`.
solution:
Add the ace links at the beginning of each widget-button.
problem:
the attempt to hide the dired buffer, which-key entry:
r -> evil-mc
caused a void dired-mode-map message to appear on startup,
in the spacemacs-base distribution.
solution:
hide the which-key entry after dired loads.
problem:
pressing g shows the which-key entry:
r -> evil-mc
but it calls the expected commands:
revert-buffer (in dired)
magit-refresh
s -> evil-easymotion
but it calls the expected command:
magit-jump-to-staged
solution:
removing the gr and gs which-key entries,
shows the expected commands.
It is impossible to ignore `evil-collection` anymore. `evil-magit` has been
deprecated recently and moved to `evil-collection`.
It will save time and effort for both Spacemacs and Evil to share and contribute
to `evil-collection` imo.
However I strongly prefer Spacemacs binding scheme over evil-collection's one.
We should only pick what we need from `evil-collection`.
This PR add mechanism to embrace `evil-collection` and apply it to shell layer (`vterm`)
and git layer.
Moved the function definitions for:
spacemacs//trailing-whitespace
spacemacs//set-whitespace-style-for-diff
from: spacemacs-default/packages.el
to: spacemacs-default/funcs.el
problem:
key bindings that use the winum package,
don't work in the spacemacs-base distribution.
for example in the buffer transient state: SPC b .
{number}, C-{number} or M-{number}
shows messages like these:
Wrong type argument: commandp, winum-select-window-1
Symbol’s function definition is void: winum-get-window-by-number
cause:
the winum package is loaded in the spacemacs-navigation layer,
but the layer isn't used in the spacemacs-base distribution.
solution:
show the message:
This command requires the winum package,
winum is part of the spacemacs-navigation layer.
problem:
Reloading the configuration: SPC f e R
after changing the variable: dotspacemacs-fullscreen-at-startup
to: t
changes Emacs into fullscreen mode.
solution:
Only check the variable and change to fullscreen mode on startup,
before Spacemacs has been initialized.
Fixes: Reloading config with fullscreen-at-startup t (in macOS) toggles fullscreen mode #13073
Spacemacs lacks a keybinding alternative to the most natural way of scrolling
Info pages (i.e. SPC) in vanilla emacs.
Anyway, this commit adds J/K to scroll most naturally through info pages.
Currently, in Info-mode, a keybinding for J is not defined while K is bound to
evil-lookup.
Issue #2828 already adresses the inconsistent experience, and in my opinion this
can and should be improved as navigating Info pages is a very crucial part of
using Emacs.
Personally I have bound J/K to scroll page up/down in buffers/pdf/djvu/doc-view,
which I inherited from using the zathura pdf reader, and I think this is a better
default than the default vim alternatives.
The newly added bindings had side effects for
magit. This was caused by which-keys replacement
working on bindings which are identical between
various modes.
To fix this I have changed the api to use the newly
added keymap based replacements which avoid these
issues.
As a side effect they are a ton faster as which
key does not have to compare all available bindings
everytime it opens its help window.
I have also fixed some more missing which-key
description in magit status buffer.
This layer helps quickly sorting Dired buffers in various ways, such as
time, size, etc.
I think the underlying package is useful and worth a place in spacemacs.
It has also been promoted by Pragmatic Emacs before (albeit long time
ago): http://pragmaticemacs.com/emacs/speedy-sorting-in-dired-with-dired-quick-sort/
Disclaimer: I'm the author of dired-quick-sort package
This avoids more problems found by @duianto.
Also:
* Use more descriptive variable names
* Print message explaining lack of narrowing in visual block mode
* Apply @duianto's fix to only activate visual selection it if it was active
previous to the creation of the indirect buffer
* Block use of visual block mode because of continuing problems in that mode,
and its questionable usefulness in this case
* Extract commonalities out of the narrowing functions
* Make the new keybindings into a list in the changelog for readability, per
@duianto
"SPC d" was used for documentation related keybindings, such as in `dash`
layer.
But it's now used for `dap` layer exclusively.
Removing this won't cause any issue as `dap` layer would correctly set
the keybindings once it's loaded.
This enables navigating up in the `ivy-reverse-i-search` list with `C-k`.
The same rebinding from `C-k` to `C-M-k` to kill a list entry,
is also done in the `ivy-switch-buffer`.
* Group `line-number` funcs under SPC t n
* Better name: absolute-line-numbers
Keep the old symbols around for backwards compatibility
Co-authored-by: Rostislav Svoboda <Rostislav.Svoboda@gmail.com>
problem:
The following error messages are shown.
When trying to move, select or swap the current buffer,
to a window nr greater than the total number of open windows.
For example:
With only one window open.
`SPC b 2`
>ad-Advice-select-window: Wrong type argument: window-live-p, nil
In the Buffer Transient State (`SPC b .`):
- `C-2` (`spacemacs/buffer-transient-state/winum-select-window-2`)
>Wrong type argument: window-valid-p, #<window 12>
- `2` (`spacemacs/buffer-transient-state/move-buffer-window-no-follow-2`)
>Wrong type argument: window-live-p, #<window 14>
- `M-2` (`spacemacs/buffer-transient-state/swap-buffer-window-no-follow-2`)
>Wrong type argument: stringp, nil
Solution:
Show a descriptive message, if the target window nr is greater than the number
of open windows. And ignore the LV buffer (hydra).
* [core] Fix evil keybindings when a link is selected in Custom-mode
This uses a separate keymap bound directly to the widget and circumvents the
existing evil keybindings.
This fixes the bug found by @duianto, which he posted
[here](https://github.com/syl20bnr/spacemacs/pull/13949#issuecomment-694685304).
* [core] Fix q and u to work everywhere in a Custom-mode buffer
When Spacemacs' fancy logic works well, it is breathtaking. Sometimes, however,
you may need a way to reach in for something a little more raw: in this case,
going straight to `next-error` rather than `spacemacs/next-error`.
I chose `cn`/`cN` because:
* They seem to be unused thus far
* It makes sense to put these keybinding under compile, since they are
associated with Emac's base functionality for compilation.
* The analogous Ex commands are `:cn` and `:cN`. They work this way even in
Spacemacs (but I am trying to wean myself off Ex mode, since I see the
Spacemacs keybindings as far superior most scenarios).
* `cp` was already taken, so `cN` had to be used for going back.
Fixes#13815.
After the latest change the list of bindings
has been changed to a dynamic form which
is not only slow but very hard to maintain.
I have replaced the list with the original one
and replaced the fixed line with backquote notation
to keep it static.
* Issue
* It could not correctly bind a prefix.
* where `dotspacemacs-emacs-command-key` is modified,
* it continuously binds a `M-x` prefix to `SPC`
* `SPC` always looks as `M-x`
* Solution
* `SPC`, hard coded `string`, was modified to `dotspacemacs-emacs-command-key`
* Expectation
* When a `SPC` prefix is bound, it should be displayed as the registered name.
Some modes have compilation-mode as parent mode but the ansi coloring
scheme is breaking their highlighting.
i.e. https://github.com/Wilfred/ag.el/issues/124
Fix this by applying ansi-colors only when the major mode is
compilation-mode.
Signed-off-by: Loys Ollivier <loys.ollivier@gmail.com>
refactor key bindings for applications to provide additional room for
applications and use lower case characters.
Move calc-dispatch to `SPC a *`
Relates to #13503
User purposes are exclusively for user configs.
Layers shall set purpose extensions instead to allow
reconfiguration.
The existing layers have been refactored to use
extensions now. So this kind of hack is not longer
needed.
spacemacs//fixup-window-configs is added as an `:around` advice for
`rename-buffer`. It should preserve `rename-buffer`'s return value,
which is the new name of the buffer.
Helm v3.3 no longer uses ido to get buffer list. So the change perp-mode makes
to ido won't affect helm anymore. Hence helm buffer list commands such as
helm-mini and helm-buffer-list will shows all buffers regardless of current
layout. Also `SPC l l` crashes with new helm.
This PR fixes them. We use the new helm variable helm-buffer-list-reorder-fn
to filter buffers. Because we compose this value users are still able to
customize this variable.
- added the same bindings you normally have under `SPC m d` under `SPC d`
similar to what Debug layer does. Most of the dap-bindings are not content
sensitive(e. g. rerun last debug session) and it doesn't make sense to restrict
them only to particular major modes.
- Moved `spacemacs/browse-docs-online-at-point` from `SPC d b` to `SPC h b d` to
avoid collisions.
- reuse the botom window for all windows that are in compilation mode and in
dap-server-log-mode. Without this change you will get two windows on top of each
other when you do `SPC c c` and then `SPC m d d d`
Add layer variable documentation for persp-autokill-buffer-on-remove
Set to kill-weak, then buffers are deleted when the layout is deleted.
https://github.com/Bad-ptr/persp-mode.el#suggested-configuration
Add usage section
- describe the core usage of layouts
Add keybindings section
- include all keybindings for the layer
Fix formatting
- = instead of ~ and vice versa
Resolve#11698
Add keybindings for the built in Emacs application called Easy PG, that provides
tools to encrypt/decrypt/sign/verify files and regions using PGP encryption.
Keybindings are defined using spacebind.
Resolve#13319
This is a squash commit including below commits
Add dotspacemacs--pretty-ignore-subdirs
Within the specified subdirs of `dotspacemacs-start-dir`,
spacemacs/prettify-org-buffer (and hence space-doc-mode) will not be called.
Without this variable, using spacemacs/open-junk-file to create an Org file will
result in prettification, which is not necessarily the desired behavior.
Call make-directory in spacemacs/open-junk-file
This imitates the behavior of open-junk-file.
Prevent spacemacs/open-junk-file from getting confused by Dired
If we're in a dired buffer, counsel-find-file will ignore
current-directory (i.e. junk-dir) and use (dired-current-directory) instead. We
fool Counsel by shadowing major-mode to nil.
Update CHANGELOG.develop re spacemacs/open-junk-file
Ivy-hydra is autoloaded so the require statement here is unnecessary. Because this require (commented out) statement was here before I uncommented it in the last PR (#13377), I leave it here (commented out) as it was before that PR.
Theme transient state key-binding `t` is broken if `ivy` completion framework is
used. The binding unconditionally invokes `helm-themes`.
This change adds a new function which takes care of invoking correct
theme-loader function based on completion framework currently in use.
The old binding used `helm-themes` but the new function uses already defined
`spacemacs/helm-themes` which removes the number of candidates limit.
There have been complains about issues with `clean-aindent-mode` from
multiple users. For some of these deactivating the mode in their user-init
did not work as intended. Therefore I have added a setting for it in the
dotfile.
Before this, `evil-ex-search-direction` would be left set to 'backward after:
- entering symbol highlight transient state mode (SPC s h)
- exiting the transient state
That means that pressing 'n' would go to the previous result instead of the next one.