This reverts commit ec57b21a92.
A which-key change caused issues with this fix.
And the fix doesn't seem to be needed anymore.
The correct which-key entries appear without the fix.
funcs.el is loaded after packages.el so `spacemacs//support-evilified-buffer-p` is undefined at this point.
moved it inside the `defun` block and it should work.
As described in #9169, when using the emacs editing style the comment inserted at the bottom of a git rebase shows the incorrect key bindings. This is apparently due to `evil-collection` (changing the `git-rebase-mode-hook`)[3ed92cadda/modes/magit/evil-collection-magit.el (L523-L524)].
We can fix the issue by only loading `evil-collection` if we're using an evil-style editing mode.
Closes#9169
problem
In the `spacemacs-base` distribution.
When the `git-enable-magit-todos-plugin`
layer variable is enabled.
Then the following message appears on startup:
>An error occurred while pre-configuring magit-todos in layer git (error: (void-variable spacemacs-evil-collection-allowed-list))
cause
The `spacemacs-evil-collection-allowed-list` variable
is assigned in the `git` layer.
But it's defined in the `spacemacs-evil` layer.
The `spacemacs-evil` layer isn't used by default
in the `spacemacs-base` distribution.
solution
Check that the `spacemacs-evil` layer is used
before adding to the variable.
- Added `magit-todos` package, toggled by `git-enable-magit-todos-plugin`.
- Improved installation and loading of all magit-plugins:
- All magit plugins are toggled by their corresponding layer variables
PRE-INSTALLATION, instead of PRE-LOADING. That is, they are installed
only when the toggle is non nil.
- The `use-package` call is more specific now.
- Hooks goes to `:hook`.
- Removed `:defer` since it's implied by `:hook`, and it's actually not
doing anything.
- Improved the documentation.
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.
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:
The Magit w (apply patches) arguments are not remembered between sessions.
cause:
Magit reads the transient files:
history.el, levels.el, and values.el
before Spacemacs has redirected them to the .cache directory.
solution:
Redirect the files before magit reads them.
This fixes g (magit-refresh), in the hybrid editing style when the variable:
hybrid-style-enable-evilified-state
is: nil
Thanks marienz for reporting the issue and for suggesting to check if the
editing style supports evil navigation.
https://github.com/syl20bnr/spacemacs/issues/14181#issuecomment-739251438
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.
Minified hint:
Chunks: n N p P RET Commits: b r f e q
Full hint:
Chunks Commits Other
[p/P] prev /same commit [b] adding lines [c] cycle style
[n/N] next /same commit [r] removing lines [Y] copy hash
[RET] show commit [f] last commit with lines [B] magit-blame
[e] echo [Q] quit TS
[q] quit blaming
Before M-1 M-2 M-3 M-4 were bound by magit to show fixed numbers
of details. Now these bindings are available with 1 2 3 4 instead.
The M-X bindings are now used for quick switching of windows as in the
rest of spacemacs.
counsel-git find a file in the current git repository. "gff" is
currently bound to magit-find-file. While counsel-git seemingly performs the
same functionality as magit-find-file, they are substantially different:
magit-find-file is not intended to find a file, contrary to what the
name indicates. See https://github.com/magit/magit/issues/3967 for
explanation. This is why we need another key binding for counsel-git.
Delete integration code for git-link and git-timemachine, which is
superseded by upstream changes to git-link committed in August 2016:
433ba1dba7
* CHANGELOG.develop: Add an entry for this change.
* layers/+source-control/git/funcs.el (spacemacs/git-link-copy-url-only):
Replace call to spacemacs/git-link with a call to git-link.
(spacemacs/git-link-commit-copy-url-only): Replace call to
spacemacs/git-link-commit with a call to git-link-commit.
(spacemacs/git-link, spacemacs/git-link-commit): Delete functions.
* layers/+source-control/git/packages.el (git/init-git-link): Replace
binding to spacemacs/git-link with a binding to git-link.
Context:
When using org files, one normally tends to add Github code links to an
algorithm/bug explanation so that readers are able to follow along with a PR
change.
The current `<SPC> g l L` command gets us the URL to the current branch; given
the code is in flux, the link becomes non-sensical rather quickly, loosing value
when trying to build a document with explanations about the code.
This PR allows us to get the Permalink (e.g. link associated to the commit, not
the branch); using this, the URL contents will never change with new commits
submitted to the repository.
Changes:
* Add two new functions with associated keybindings:
- `<SPC> g l p` maps to `spacemacs/git-permalink`
- `<SPC> g l P` maps to `spacemacs/git-permalink-copy-url-only`
* The above changes rely on mechanisms of `git-link`, so no new code needs to
be introduced
Moved:
- ("ai" "irc") to both the `erc` and `rcirc` layers. They don't have to be
renamed until the layers are loaded.
- ("ay" "ipython notebook") to the `ipython-notebook` layer.
- ("p$" "projects/shell")
("'" "open shell")
("as" "shells")
to the `shell` layer.
- The commands with keybindings from spacemacs-bootstrap/packages.el to
spacemacs-defaults/keybindings.el.
Removed:
- ("gd" "diff") it seems to be an old group name, there's no `SPC g d` group at
the moment.
- ("Re" "elisp") and ("Rp" "pcre") because they have moved to:
("xr" "regular expressions")
("xre" "elisp")
("xrp" "pcre")
- ("xm" "move") seems to be an old move text group, the current keybindings are
`SPC x J` and `SPC x K` which opens the Move Text Transient State.
- ("b" "persp-buffers") because `SPC b` is also renamed as ("b" "buffers") which
is more general and not persp-mode specific.