Commit Graph

371 Commits

Author SHA1 Message Date
Tim Ruffing 9e3fc598ad
Don't set :foreground/background to nil to avoid font warnings in emacs29 (#15877)
Fixes https://github.com/syl20bnr/spacemacs/issues/15862
2023-01-13 06:28:55 +00:00
Maxi Wolff b28d65b7aa Load use-package extensions before usual layer loading 2022-12-14 13:37:27 +01:00
rommeswi b9a52ccad3
Create visual selection from transient paste (#15745)
* create visual selection from transient paste

Improve "Pasting Transient State" by adding a shortcut C-v to generate a visual selection from pasted test.

* Remove unnecessary lambda expression
2022-10-19 20:49:08 +02:00
Thanh c49e80d794 Revert "[spacemacs-bootstrap] Remove whitespace from kill ring. (#15634)"
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.
2022-07-21 08:57:45 +02:00
Ben 91af298090
[spacemacs-bootstrap] Remove whitespace from kill ring. (#15634)
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>
2022-07-15 20:22:19 +00:00
Ben aee4fa85d5
Undo-region: more ergonomic keybindings (#15631) 2022-07-15 19:26:28 +00:00
Arif Er 00f9ab19ac chore: update copyright headers to 2022
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.
2022-06-03 17:32:20 +02:00
Thanh Vuong b8f471dc1c
[core] new recipe :fetcher local
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
2022-05-29 15:58:19 +02:00
Daniel Nicolai f4b04bcf22 Add obsoletion notification evilified-state-evilify 2022-05-29 14:05:07 +02:00
Pieter Swinkels 0d5247f231
Only bind TAB when evil setting allows it (#15473)
* 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.
2022-05-11 19:28:33 +02:00
Dan Kessler 83d687534c tidy read syntax for anonymous functions
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
2022-05-11 19:24:54 +02:00
Aaron Zeng 056c7264ad
[spacemacs-bootstrap] Fix :pre-bindings evaluation in evilified-state-evilify-map (#15490) 2022-04-26 18:52:30 -04:00
Lucius Hu fd652fae0c
update spacemacs/declare-prefix usages (#15278)
Co-authored-by: Lucius Hu <lebensterben@users.noreply.github.com>
2022-02-04 05:36:11 +00:00
Daniel Nicolai bbd40f113f
Add C-o and C-i keybindings to evil-evilified-state-map (and remove from pdf-view-mode-map)
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).
2022-01-08 03:54:30 +00:00
Daniel Nicolai b1fe17d370 Open special-mode buffer in motion-state (not evilified)
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.
2021-11-02 22:15:13 +01:00
Lucius Hu 696cfd47c1 Revert "Fix evil search prompt on mouse leave (#15002)"
This reverts commit d9c3dc678c.
2021-09-04 15:09:55 +02:00
Daniel Nicolai 8c931b9c86 Evilify special-mode by default
As special-mode is a read-only mode, it could be evilified by default.
I am not aware of any case where this is not desired.
2021-08-22 20:26:32 +02:00
duianto d9c3dc678c
Fix evil search prompt on mouse leave (#15002) 2021-08-21 01:49:40 -04:00
Moritz 95b683c0a5
Fixed bugs and refactor in new EXWM layer
Co-authored-by: Lucius Hu <lebensterben@users.noreply.github.com>

Closes #14802
2021-06-05 15:02:57 +00:00
Markus Bertheau 4acdf7733e
Fix one diminish pattern in a list in :spacediminish (#14810)
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
2021-05-31 04:39:16 +00:00
Lucius Hu d9132f8bc0
spacedminish: fixed bug
fixes https://github.com/syl20bnr/spacemacs/issues/14726
2021-05-28 02:10:15 +00:00
duianto 95280d15a8 [dired] Add ivy command and replace evil collection key
Fixes: vim layer key binding of "J" in dired mode #14614
https://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.
2021-04-15 22:07:30 +02:00
Maximilian Wolff 38f582d785 [bootstrap] Fix depreciation warning for pcase `t case
and add first usage for reference
2021-04-08 19:43:30 +00:00
Lucius Hu 4836a2569b bootstrap: new :spacediminish keyword to use-package
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")))
```
2021-04-08 19:08:13 +00:00
Lucius Hu 215b634981 spacemacs-bootstrap: refactor
- Replaced `(set (make-local-variable 'foo) bar)` with `(setq-local foo bar)`
- Replaced `(when (not foo) bar)` with `(unless foo bar)`
- Replaced unnecessary backquote construct with simple quotation
2021-04-04 12:48:21 +02:00
syl20bnr 97cd83e169 Apply GPLv3 terms explicitly to all elisp files 2021-03-25 22:59:32 -04:00
syl20bnr d55a9e2e67 Update header for year 2021 2021-03-25 22:59:32 -04:00
duianto 07f31743e7 [evilified] Visual state text objects, exchange point/mark
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)
2021-03-15 19:56:33 +01:00
duianto de1425628c Revert "[evilified] Add evilified normal keys: yank, navigate"
This reverts commit 898e509273.

It broke org-agenda:
Evilified normal keys breaks "t" keabinding in agenda
https://github.com/syl20bnr/spacemacs/issues/14484
2021-03-14 12:12:18 +01:00
duianto 898e509273 [evilified] Add evilified normal keys: yank, navigate
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.
2021-03-14 00:32:34 +01:00
duianto 94585331ce Replace move-text with drag-stuff
Just like: https://github.com/emacsfodder/move-text

https://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.
2021-03-14 00:29:46 +01:00
duianto 15decbc67d [evilified] Restore evil-surround
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.
2021-03-14 00:05:40 +01:00
duianto f853124578 Improve editing-style toggles
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)
2021-03-13 23:10:24 +01:00
duianto f4999e8242 Restore evil-visual-state-map on edebug exit
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
2021-02-20 07:49:43 +01:00
duianto b93bdbd4ad Handle when evil-set-undo-system is missing
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.
2021-02-13 12:01:31 +01:00
Thanh Vuong ae65f3cedd
Fix #14213 remove dash and ht from core libs
- delete dash and ht in core
- reimplemented all ht functions we need in `spacemacs-ht.el` and use them
- add dash to spacemacs-bootstrap
2021-02-07 22:22:39 +01:00
Thanh Vuong a6d364e0f2 [spacemacs-evil] add evil-collection
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.
2021-01-30 01:11:07 +00:00
Daniel Nicolai c23a190a72 Add toggles for specific persistent which-key keymaps
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.
2021-01-10 20:32:04 +01:00
duianto f62934620d [base] Fix evil undo
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.
2020-12-30 20:46:20 +01:00
Keith Pinson af078784b8
[core] add z$ as Evil keybinding for set-selective-display (#14146)
* [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
2020-11-21 07:25:22 +01:00
nanashi0x74 76849892e1 Fix three typos in various files
This commit fixes typos in doc/layers.org and the readme.org files of bootstrap and
java layers.
2020-10-19 11:48:51 +02:00
khjcph dad4406f70 Only set undo system if fun. exists.
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.
2020-10-14 18:44:40 +02:00
duianto e096d6dd1e Set evil-undo-system to undo-tree 2020-10-10 21:55:06 +02:00
Robert O'Connor 9ada738efd update copyright year to 2020 2020-10-05 20:48:10 +02:00
Robert O'Connor 82ba73a1c0
update copyright to 2020 2020-09-23 21:25:01 +02:00
duianto 1e677bb532 Revert "[spacemacs-bootstrap] Fix mode-line evil state foreground"
This reverts commit 4562da2b56.

Revert reason:
emacsclient broken on develop branch by commit 4562da2b5
https://github.com/syl20bnr/spacemacs/issues/13766
2020-07-13 22:20:37 +02:00
duianto 4562da2b56 [spacemacs-bootstrap] Fix mode-line evil state foreground
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.
2020-07-12 20:53:51 +02:00
JAremko 6145a566e8 Remove docker distribution
This days there are better ways.
2020-06-25 14:30:55 +03:00
duianto 78b45b4167 Fix typo in holy-mode latin function name
Noticed by phoe:
Typos in holy-mode.el · Issue #13576
https://github.com/syl20bnr/spacemacs/issues/13576
2020-06-18 13:02:06 +02:00
Steve Lorimer 464fed8757 [which-key] fixup for change to help text for "buffer-to-window-N" so which-key-replacement-alist works again 2020-06-11 00:52:08 +02:00