Commit Graph

77 Commits

Author SHA1 Message Date
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
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 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
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
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 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 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 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
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 82ba73a1c0
update copyright to 2020 2020-09-23 21:25:01 +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
syl20bnr ab3511cfb5 [which-key] Improve readibility
* add column padding
* group prefixes together
* display a minimum of 6 lines
2020-03-05 21:04:51 -05:00
syl20bnr 9685095454 Use spacebind for keybaord macro key bindings 2020-03-05 21:04:51 -05:00
jaremko b83521edbb Add spacebind macro and tests for it 2020-02-27 21:48:40 -05:00
syl20bnr 978be09f6b [base] Refactor keyboard macro key bindings 2020-02-23 09:42:20 -05:00
madand 37fdd1ef87 Toggleable hint for the Scrolling Transient State (~SPC N~)
By default the full hint is shown, which is consistent with the behavior before
this commit.
2019-12-25 08:20:50 +01:00
kimr da80634370
converted cl to cl-lib 2019-12-14 20:20:51 +00:00
duianto 9e184994ad Hide spacemacs// command prefixes in which-key
spacemacs/ was already hidden, but commands starting with
spacemacs// showed a leading slash: /<command name>
2019-11-24 22:14:02 +01:00
madand 89b006b432 Fix hybrid-mode error when dumping (fixes #11923) 2019-09-13 23:25:21 +02:00
syl20bnr 08dc9567b8 [dump] Delay holy and hybrid config after dump is loaded 2019-07-26 22:46:08 -04:00
duianto b9e61e6437 Add transient state keys _, j, k
Thanks sdwolfz for the suggestion to add underscore to the transient states,
then the shift key doesn't have to be released if it was held down to press `+`.

Added key bindings:
Evil numbers:
`SPC n _` decrease number under point
in the transient state:
`j` decrease number under point
`k` increase number under point

`SPC T T _` decrease transparency
`SPC z x _` scale down font
`SPC z f _` zoom out frame

Update documentation:
Zoom frame:
`q` quit transient state

Evil numbers:
`SPC n =` increase number under point
`SPC n _` decrease number under point
`0..9` add a number prefix argument
`q` quit transient state

Fixed a typo and made a small rewrite of the tip about using a prefix argument.

Added keys to transient states:
Font scaling:
Added `_` scale down
Reordered `k` assignment to match the order in the transient state

Frame transparency:
Added `_` decrease
Reordered `k` assignment to match the order in the transient state

Evil numbers:
Added `k` increase
Added `_` and `j` decrease

Zoom frame:
Added `_` zoom frame out
Reordered `k` assignment to match the order in the transient state

Which-key entries for Evil numbers `SPC n`:
Group together keys that call the same command:
From: + and =
To:   +,=

From: - and _
To:   -,_
2019-07-14 22:56:57 +02:00
duianto 9aaef2a22b Update Scrolling Transient State
Added new key bindings:
- In the Buffer column:
Added "g" and "G":
[</g] beg
[>/G] end
- In a new Other column:
[q] quit

Reordered the columns:
From: Large to small: buffer, full page, half page, line/column
To: Small to large: line/column, half page, full page, buffer

Reason: The most used (first listed) bindings are probably not scroll to the
"beginning" or "end" of the buffer.

Rearranged the half page columns two instances of "down/up" to one "down" and
one "up".

Reduced the TS width:
- Separated the line/column and full page keys to one "down" and one "up", and
the buffer keys to one "beginning" and one "end".
- Renamed "beginning" to "beg".

Reordered the key bindings (TS) logically: "up" above "down".

Reordered the key bindings (code):
Arranged them in the same order as the columns in the TS.
2019-06-13 00:49:43 +02:00
Dominik Schrempf 15d8a03e5b `spacemacs-theme'; no overrides.
Do not override customizable settings from `spacemacs-theme', since those should
be set on a per user basis in the configuration file.
2019-05-16 00:00:31 +02:00
duianto 3de7081950 Cleanup which-key names
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.
2019-02-18 14:35:00 -05:00
syl20bnr 3dd753945f bootstrap: refactore which key replacement list
And enable multiple replacements.
2019-02-10 10:11:38 -05:00
syl20bnr 6220ace290 core: rework environment variables and PATH management
See updated DOCUMENTATION.org and FAQ.org for more info.

* add core-env.el
* add library load-env-vars.el
* add bootstrap package dotenv-mode.el
* remove spacemacs-environment from bootstrap layer
* remove dotspacemacs variable dotspacemacs-import-env-vars-from-shell
* remove dotspacemacs variable dotspacemacs-improt-env-vars-shell-file-name
* add new key binding SPC f e e to open spacemacs.env file
* add new key binding SPC f e E to reload environment variable from env file
* add new key binding SPC f e C-e to re-initialize the env file from shell.
2018-06-25 02:55:28 -04:00
syl20bnr 9ee832955a core: async import of env.vars and add new dotfile variable
* new variable dotspacemacs-import-env-vars-from-shell
 * asynchronous import of environments variables
 * move loadenv function to funcs.el
 * update documentation
2018-06-15 01:38:07 -04:00
fiveNinePlusR 75f1d915a8 [CORE] synchronize the environment variables from the default shell 2018-06-14 20:12:26 -04:00
syl20bnr e24be2186a Truly lazy load helm based on key bindings
We will need to also support Emacs editing style.
2018-06-14 02:05:01 -04:00
syl20bnr 55d18a1a3a Move SPC s c to bootsrap layer 2018-06-14 00:21:56 -04:00
syl20bnr c12b72090c Cache PATH and env vars. fetched with exec-path-from-shell
See updated documentation in this commit.
2018-06-11 03:54:51 -04:00
syl20bnr b282e553ba Use dotspacemacs backward compatibility macro instead of aliases 2018-06-08 02:24:38 -04:00
Miciah Masters e0b751bee3 Avoid non-idempotent use of push in init code
Replace push with add-to-list in layer init functions and related code.

Modify spacemacs|add-toggle to check for and update an existing toggle in
spacemacs-toggles and only create a new toggle if none already existed.

Replace a conditional push onto erc-packages with use of :toggle.

When initializing which-key, set which-key-replacement-alist to its default
or customized setting before adding all the Spacemacs replacements.  We
want to keep the stock replacements but avoid adding duplicates of the
Spacemacs replacements.

Replace the emacs-lisp-mode-hook lambda with a named function to avoid
adding duplicate hooks (which can add duplicate definitions of the
evil-surround pair).
2018-06-05 22:17:13 -04:00
syl20bnr 3595708d5f Enable italics in spacemacs theme 2018-06-05 16:50:30 -04:00
CeleritasCelery 6905d9cafa fix bug with evil-pasted object 2018-05-24 10:38:55 -07:00
bmag 260c3d98e3 pcre2el: move ownership to bootstrap
pcre2el is used by several layers, such as ivy and helm, so it needs to be
available outside of spacemacs-editing layer.
See also https://github.com/syl20bnr/spacemacs/pull/5990#issuecomment-217400470
2018-05-10 20:26:55 +03:00
syl20bnr 0fa3658cd8 reorganize spacemacs-base distribution into +spacemacs/spacemacs-xxx
This idea is to have the spacemacs-base distribution only configure defaults for
built-in packages. Those buit-in packages are now configured in the new layer
spacemacs-defaults.
Additionally some other packages of spacemacs-base have been dispatched to
better suiting spacemacs layers.

Projectile has been moved to the new layer spacemacs-project

- Move the following packages to bootsrap distributio layer:
  - exec-path-from-shell
  - evil-evilified-state
  - holy-mode
  - hybrid-mode
  - spacemacs-theme
- ace-window has been moved to spacemacs-navigation
- centered-buffer-mode has been moved to spacemacs-editing-visual
- pcre2el has been moved to spacemacs-editing
- evil-escape and evil-visualstar have been moved to spacemacs-evil
2018-03-04 20:54:54 -05:00