This reverts commit 91af298090.
it breaks (kill-whole-line) `kill-whole-line` (C-S <backspace>)
the SO link mentioned in it got 0 point.
and hack like this can be put it to user's own config.
When `dotspacemacs-enable-paste-transient-state` is on, there exists a minor
annoyance that deleted whitespaces appear in the kill ring. This requires an
extra C-j/C-k to bypass the noise.
This commit uses a advice function to `kill-new` to prevent text with only
whitespaces from entering kill ring.
Credit: https://stackoverflow.com/questions/12102554/emacs-skip-whitespace-kills
Co-authored-by: Lucius Hu <1222865+lebensterben@users.noreply.github.com>
Co-authored-by: Lucius Hu <lebensterben@users.noreply.github.com>
The script used to identify and update the change is added into the GitHub
workflows script directory. A workflow action can be created to trigger the
script to update the headers on the first of every new year. Possibly a task for
a consequent PR.
with this curent (package :location local) can be replaced with (package
:location (recipe :fetcher local)) then quelpa will install local pacakge. We
have the benefit of bytecompile and autoload
[packages] use new fetcher for local
* Only bind TAB when evil setting allows it
In a terminal TAB and C-i generate the same key press. So to "avoid TAB being
overlapped in terminal mode", function spacemacs/init sets evil-want-C-i-jump to
nil. Unfortunately commit bbd40f1 always binds C-i to evil-jump-forward
regardless of the value of evil-want-C-i-jump. This commit fixes that.
* Always bind C-i in GUI mode
This commit always binds C-i to evil-jump-forward in GUI mode, regardless of the
value of evil-want-C-i-jump. In GUI mode C-i and TAB enerate different key
presses so this doesn't affect the behavior of TAB.
First, change read syntax for anonymous functions currently written '(lambda to
instead just be (lambda; otherwise this raises a warning.
Next, while we're at it, change all instances of #'(lambda to just (lambda,
since the two are equivalent and the latter is more concise (excepting anything
in core/libs or in /local/ subdirs of layers)
https://www.gnu.org/software/emacs/manual/html_node/elisp/Anonymous-Functions.html#index-_0023_0027-syntax
C-o and C-i are standard vim keybindings to jump back/forward between previous
locations. It is annoying and unnecessary that evilified buffers break that
flow, therefore these keybindings should be added to the
`evil-evilified-state-map` so that they are available automatically in all
evilified keymaps/modes. I assume that by just adding them to the map, all
required remappings will automatically be taken car of by the
`evilified-state-evilify-map` macro (anyway, it seems to work fine).
Special mode and its derived mode(s) buffers were made evilified in PRs #14995
and #15050. However, special-mode is too aggressive (as 'warned' for already in
#14995); it makes it hard to overwrite its keybindings (e.g. `evil-local-set-key`,
or using `evil-evilified-state-map` on a derived map have no effect).
Therefore it makes more sense to open the buffers in motion-state instead. This
state also does not hijack the `q` keybindings as defined by special-mode (see
https://www.gnu.org/software/emacs/manual/html_node/elisp/Basic-Major-Modes.html),
although it does still hijack its `g` keybinding, but evil navigation is
considered to have higher priority than revert-buffer anyway.
The code changed here wants to distinguish the cases of whether `arg` is a list
with one set of args to `spacemacs|diminish` or a list of a list of such args.
It used to look at the second element of `args` to make that distinction.
Consequently, if you want to specify a list of a list of args for
`:spacediminish`, you'd have to have at least two such lists of args in the list.
However in
38f582d785
a usage with a list of just one list of args was introduced.
This fixes changes the detection so that it looks at the first element of `arg`.
If that's a list, `arg` is assumed to be a list of lists of args to
`spacemacs|diminish`. If it's not, it's assumed to be just a list of args to
`spacemacs|diminish`. That works well because the first argument to
`spacemacs|diminish` is a symbol.
Fixes#14726
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.
Added a new keyword to `use-package`, `:spacediminish` which calls
`spacemacs|diminish`.
Supported patterns:
- nil
- SYMBOL
- STRING
- (SYMBOL STRING)
- (STRING STRING)
- (SYMBOL STRING STRING)
- List of patterns above
When `SYMBOL` is missing, it's inferred from the package name, e.g
`(use-package foo :spacediminish nil)` becomes
`(use-package foo :spacediminish foo-mode)`.
This PR aims to replace explict calls to `spacemacs|diminish` and brings more
declarative flavour to layer configuration.
For example, the following form
```elisp
(use-package highlight-indentation
:config
(progn
(spacemacs|diminish highlight-indentation-mode " ⓗi" " hi")
(spacemacs|diminish
highlight-indentation-current-column-mode " ⓗc" " hc")))
```
can be replaced by
```elisp
(use-package highlight-indentation
:spacediminish ((" ⓗi" " hi")
(highlight-indentation-current-column-mode " ⓗc" " hc")))
```
In evilified visual state.
- Add the inner: `i` and outer `a` text objects.
- Add `o` to exchange the point and mark
(jump between the start and end of the region)
evilified normal state is missing some useful keys:
y (evil-yank) and the common navigation keys:
f, F, t, T, w, W, b, B, $, ^
They are available in evilified visual state,
but it's useful to be able to copy text
without having to enter visual state first.
Adding `y` (`evil-yank`), makes the inner (`i`) and outer (`a`),
text objects available in evilified normal state.
This also adds the text objects to evilified visual state.
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.
Enable `evil-surround-mode` when exiting evilified state.
If `evil-surround-mode` was enabled.
Currently it only disables `evil-surround-mode`.
This was discovered while exiting `edebug-mode`.
This also removes the unused variable:
`evilified-state--evil-surround`
It might have been intended for this purpose.
Otherwise it can be added back when
a use case for it is introduced.
problem:
The toggle editing style prefix: SPC t E
always shows the same names:
e -> emacs (holy-mode)
h -> hybrid (hybrid-mode)
This causes some confusion about how to
switch to the vim (evil-mode) editing style,
from emacs or hybrid state.
solution:
Show which editing styles one will switch to:
In evil-mode:
e -> emacs (holy-mode)
h -> hybrid (hybrid-mode)
In holy-mode:
e -> vim (evil-mode)
h -> hybrid (hybrid-mode)
In hybrid-mode:
e -> emacs (holy-mode)
h -> vim (evil-mode)
problem:
Exiting edebug-mode, leaves the evil-visual-state-map
with only the two key bindings that are defined in:
evilified-state--setup-visual-state-keymap
y evil-yank
escape evil-exit-visual-state
solution:
Restore the evil-visual-state-map when exiting edebug-mode.
Added an alias for the new exit function:
evilified-state--evilified-state-on-exit
called: evil-evilified-state-exit
the opposite of: evil-evilified-state
problem:
updating Spacemacs without updating the evil package,
breaks Spacemacs on startup:
Symbol's function definition is void: evil-set-undo-system
solution:
make sure that evil-set-undo-system is bound.
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.
Sometimes it is handy to show keymaps persistently with which-key. For example,
to show navigation commands in Info-mode, gnus, eww etc. This PR implements
handy toggles and documentation for that.
problem:
Pressing: u
in the spacemacs-base distribution, shows:
evil-undo: Symbol’s function definition is void: undo-tree-undo
cause:
The evil undo system is setup as: undo-tree
but undo-tree is loaded in the spacemacs-editing layer,
and the layer isn't used by default in the spacemacs-base distribution.
solution:
Set the evil undo system to undo-tree when the undo-tree package is used.
Now if undo-tree isn't setup, then:
- u uses the default Emacs undo command.
- C-r says: Customize ‘evil-undo-system’ for redo functionality.
* [core] add z$ as Evil keybinding for set-selective-display
This is a feature whose equivalent I had looked for previously and not found. I
bumped into it in [this excellent
article](https://karthinks.com/software/batteries-included-with-emacs/) which is
a survey of "batteries included" parts of Emacs. He mentions Spacemacs (in a
positive light) in the article, but the article is a lot about what you can do
_without_ distributions like Spacemacs, Doom, or Prelude. As such, this seems
like an opportunity to make Spacemacs even better---i.e. by making these
relatively unknown batteries that are already present in Emacs more discoverable
in Spacemacs.
I put it in the folding menu `z` because that fits its usecase. I used `$`
because:
* the out-of-the-box Emacs keybindings is `C-x $`.
* the menu is already fairly saturated
* I didn't know what else to base the mnemonic on because
* I'm not aware of a Vim equivalent
* The name of the Emacs function itself is nondescriptive of its behavior
I couldn't find any keybinding documentation table to add it to. Please let me
know if I missed something.
* [core] DWIM in z$ as suggested by @lebensterben
The PR fixes an issue where spacemacs is in a bad state after upgrading. I
suppose what happens is that `evil-set-undo-system` is invoked before `evil` is necessarily the correct version.
The evil state foreground color on the mode-line was set to
the mode-line background color.
This caused problems with some themes.
[FEATURE REQUEST] Darker option for mode-line color codes #13731
Solution:
Set the evil state foreground color to the darker of the
mode-line face foreground or background colors.