Commit graph

230 commits

Author SHA1 Message Date
Henrik Lissner
7d0caf3efd
New editor/fold module
Extracted from feature/evil and emacs/hideshow.
2019-02-18 00:47:46 -05:00
Henrik Lissner
02a3f815a3
Disable evil-escape in term-mode #1156
Causes unintended escape characters to be inserted into the term buffer.
2019-02-14 00:40:19 -05:00
Henrik Lissner
0e8af0e6d2
Integrate evil jumplist into xref #1161
Rather than use xref-pop-marker-stack, evil users can now use the
jumplist to jump from and to xref calls (with C-o/C-i).
2019-02-14 00:40:19 -05:00
Henrik Lissner
5baaf08246
Move evil-mc library to editor/multiple-cursors 2019-01-28 19:54:55 -05:00
Henrik Lissner
4daa9271a0
Introduce general.el & rewrite map!
+ Now uses an overriding keymap for leader keys, so that it is always
  available, even outside of normal/visual states. In insert/emacs
  states, or in sessions where evil is absent, an alternative prefix is
  used for leader/localleader keys. See these variables:
  + doom-leader-prefix
  + doom-leader-alt-prefix
  + doom-localleader-prefix
  + doom-localleader-alt-prefix
+ Keybinds now support alternative prefixes through the new :alt-prefix
  property. This is useful for non-evil users and non-normal evil
  states. By default, this is M-SPC (leader) and M-SPC m (localleader).
+ Removed +evil-commands flag from config/default (moved to
  feature/evil/+commands.el).
+ config/default/+bindings.el has been split into
  config/default/+{evil,emacs}-bindings.el, which one is loaded depends
  on whether evil is present or not. The latter is blank, but will soon
  be populated with a keybinding scheme for non-evil users (perhaps
  inspired by #641).
+ The define-key! macro has been replaced; it is now an alias for
  general-def.
+ Added unmap! as an alias for general-unbind.
+ The following modifier key conventions are now enforced for
  consistency, across all OSes:
    alt/option      = meta
    windows/command = super
  It used to be
    alt/option      = alt
    windows/command = meta
  Many of the default keybinds have been updated to reflect this switch,
  but it is likely to affect personal meta/super keybinds!

The map! macro has also been rewritten to use general-define-key. Here
is what has been changed:

+ map! no longer works with characters, e.g. (map! ?x #'do-something) is
  no longer supported. Keys must be kbd-able strings like "C-c x" or
  vectors like [?C-c ?x].
+ The :map and :map* properties are now the same thing. If specified
  keymaps aren't defined when binding keys, it is automatically
  deferred.
+ The way you bind local keybinds has changed:

    ;; Don't do this
    (map! :l "a" #'func-a
          :l "b" #'func-b)
    ;; Do this
    (map! :map 'local "a" #'func-a
                      "b" #'func-b)

+ map! now supports the following new blocks:
  + (:if COND THEN-FORM ELSE-FORM...)
  + (:alt-prefix PREFIX KEYS...) -- this prefix will be used for
    non-normal evil states. Equivalent to :non-normal-prefix in general.
+ The way you declare a which-key label for a prefix key has changed:

    ;; before
    (map! :desc "label" :prefix "a" ...)
    ;; now
    (map! :prefix ("a" . "label") ...)

+ It used to be that map! supported binding a key to a key sequence,
  like so:

    (map! "a" [?x])  ; pressing a is like pressing x

  This functionality was removed *temporarily* while I figure out the
  implementation.

Addresses: #448, #814, #860
Mentioned in: #940
2018-12-22 04:14:43 -05:00
Henrik Lissner
feabbc31da feature/evil: add +evil/fold-{next,previous}
Brings zj/zk to evil
2018-09-20 22:27:01 -04:00
Henrik Lissner
5410f1d575 feature/evil: add arbitrary code folding keybinds 2018-09-20 22:27:01 -04:00
Henrik Lissner
6fce87bd06 feature/evil: refactor folding & outline support
Code folding commands will now obey outline headers (if
outline-minor-mode is on and in outline-mode).
2018-09-20 22:26:36 -04:00
Henrik Lissner
03ce3db322
feature/evil: update for evil-collection changes
Now, evil-want-keybindings must be set to nil instead of
evil-want-integration.
2018-09-13 19:15:15 -04:00
Henrik Lissner
bd28eea778
feature/evil: remove <> opener/closers
And remove unnecessary def-package block. These commands are already
autoloaded by the package.
2018-09-09 09:58:21 -04:00
Henrik Lissner
89b83f2457
Enable evil-escape-mode
I know this is redundant with the pre-command-hook hook, but the hook
allows us to lazy load the package, and the mode allows other modes (or
the user) to interactively disable it.

For example, evil-mc disabled it while cursors are active due to
incompatibility. This isn't possible if the mode isn't enabled to begin
with.
2018-09-09 09:58:20 -04:00
Henrik Lissner
18554ca5b5
feature/evil: extract advice functions
Into its own autoloads file, for better organization.
2018-09-09 09:58:20 -04:00
Henrik Lissner
7d3ffdff06
Remove third line in section headers
This is truly important stuff. We've saved many lives with this update.
2018-09-09 09:58:19 -04:00
Henrik Lissner
c0ff5b030a
feature/evil: fix evil-change recommenting line
Due to a bug crossing over from +evil-want-o/O-continue-comments
functionality. It has also been refactored for performance. This also
fixes an issue where smartparens functions could be called before
smartparens was loaded, making o/O inoperable.
2018-09-09 09:58:19 -04:00
Henrik Lissner
e7d5da2686
feature/evil: detect frame cursor-color #851
In case set-cursor-color was used early in the config process (e.g. in
~/.doom.d/init.el), detect it before resorting to #FFFFFF as a default.
2018-09-03 03:58:44 +02:00
Henrik Lissner
895cf136d5
Ensure evil popup rules are defined later
Otherwise they fall before ui/popup's fallback rules in
display-buffer-alist
2018-08-30 13:29:56 +02:00
Henrik Lissner
068cf5f7d4
Rename +evil|save-buffer to be self-explanitory
+evil|disable-vimlike-save-message
2018-08-30 13:29:56 +02:00
Henrik Lissner
2b560a6a0e
General & minor refactoring 2018-08-28 13:36:44 +02:00
Henrik Lissner
9b84d800f3
Make numbered vim markers global
In evil, registers 2-9 are buffer-local. In vim, they're global. This
fixes that.
2018-08-27 21:25:52 +02:00
Henrik Lissner
b14bf99d4b
Fix over-reindentation when o/O continues comments
This would run indent-according-to-mode after creating a new line, which
would often throw new comment lines out of whack. Now it preserves the
indentation of the originating line.

Also fixes continuation whitespace issues with evil-open-above on
C-style block comments.
2018-08-25 19:45:23 +02:00
Henrik Lissner
e3f412abb7
Add +evil-want-o/O-to-continue-comments
Controls whether o/O continue commented lines. Since this is the default
behavior of vim, it is enabled by default.
2018-08-23 18:42:09 +02:00
Henrik Lissner
5714ff423a
Fix evil jumplist after jumping to ag match
helm-ag would formerly add multiple entries to the jump list. It now
only adds one, and recenters the window when jumping to an ag match.
2018-08-13 21:47:55 +02:00
Henrik Lissner
8d26879f99
Add :editor multiple-cursors module
Moves evil-mc/evil-multiedit out of feature/evil.
2018-08-06 00:31:23 +02:00
Henrik Lissner
933e52b886
Don't enable evil-visualstar-mode
Redundant with our manual */# keybinds.
2018-07-10 14:21:45 +02:00
Henrik Lissner
93917fd8a2
Fix gsn/gsN & gs*/gs# evil-easymotion binds 2018-07-10 14:21:30 +02:00
Henrik Lissner
8b9d4a94bb
Define evil-want-* options as defvars
To make it easier for users to customize.
2018-06-27 03:09:06 +02:00
Henrik Lissner
123df290a6
Rewrite evil +everywhere & evil-collection init
Fixes a couple issues with certain evil-collection modules not loading
and removes some redundant config for 'replace.
2018-06-27 03:05:47 +02:00
Henrik Lissner
69143b20f8
feature/evil: remove macroexpand
Snuck into a commit
2018-06-27 02:57:02 +02:00
Henrik Lissner
fe235c341d
Refactor evil-collection-init code
Make it possible to disable image-mode and elisp-mode evil-collection
modules.
2018-06-26 18:58:07 +02:00
Henrik Lissner
5966e9aa9c
Restore +evil-collection-disabled-list
Without this variable, the user can't easily prevent certain
evil-collection modules from loading without some provide voodoo.
2018-06-26 18:58:06 +02:00
Alois Janíček
778f9dea5c
feature/evil: correct feature reference
Both help-mode and help-mode-map are defined in file help-mode.el
which provides 'help-mode
2018-06-26 13:25:23 +02:00
Henrik Lissner
a1d02749e5
Rethink how evil-collection is (lazy) loaded
This fixes a keybinding precedence issue that prevented users from
customizing evil-collection's keybinds, because evil-collection would
always run last, *after* user customizations. This precedence problem
occurs because evil-collection was lazy loaded haphazardly.

This isn't the most elegant solution, but I can live with it.
2018-06-25 15:39:38 +02:00
Henrik Lissner
69fc80d7cf Revert "Fix evil-escape aborting multiedit too eagerly"
This reverts commit ba1488279b.

This hack is no longer necessary now that syl20bnr/evil-escape#83 was
merged upstream.
2018-06-24 10:34:16 +02:00
Henrik Lissner
f6dc6ac74e
Refactor out map.el usage
After some profiling, it turns out map-put and map-delete are 5-7x
slower (more on Emacs 25) than delq, setf/alist-get and add-to-list for
small lists (under 250 items), which is exactly how I've been using
them.

The only caveat is alist-get's signature is different on Emacs 25, thus
a polyfill is necessary in core-lib.
2018-06-23 19:53:54 +02:00
Henrik Lissner
13cb219e49
lang/common-lisp: improve evil+sly integration 2018-06-22 01:49:21 +02:00
Henrik Lissner
ba1488279b
Fix evil-escape aborting multiedit too eagerly
When evil-escape is invoked from multiedit-insert state, it erroneously
quits the current multiedit session entirely. No more.

This can be removed when syl20bnr/evil-escape#83 is merged.
2018-06-19 14:14:32 +02:00
Henrik Lissner
615735a404
Add exato (x/html attribute text objects for evil)
Bound to x
2018-06-18 23:46:14 +02:00
Henrik Lissner
ca2c8b5a45
Minor refactor, across the board
Do you see the board? Now look at the other side. That's how far this
refactor extends.

Yes.
2018-06-18 15:02:24 +02:00
Henrik Lissner
6808c46b58
💥 Change set-popup-rule! usage
Now accepts a flat plist of all its former parameters, including new
:parameters and :actions properties to increase your control over the
fate of your windows.

The old usage of set-popup-rule! is deprecated and may not work right!

The :ui popup module has also seen a major refactor to improve
efficiency and load times.

Sorry! This is the last "big" change before 2.1!
2018-06-18 02:34:16 +02:00
Henrik Lissner
19f1c70144
Refactor company keybinds
Also merge evil-collection-company into Doom.

Two new features to note: C-S-s will invoke your completion engine for
the remaining results.
2018-06-17 16:43:10 +02:00
Henrik Lissner
5a427b1c2b
Move custom evil arg types back to config.el
No need to autoload that.
2018-06-15 04:45:09 +02:00
Henrik Lissner
eaca8c58fa
Move unit tests from ert to buttercup
Easier to organize and write. Now I can hopefully strive for better
coverage!
2018-06-15 03:42:01 +02:00
Henrik Lissner
d8b1e469bc
Introduce autodefs to replace some settings
+ :popup -> set-popup-rule!
+ :popups -> set-popup-rules!
+ :company-backend -> set-company-backend!
+ :evil-state -> set-evil-initial-state!

I am slowly phasing out the setting system (def-setting! and set!),
starting with these.

What are autodefs? These are functions that are always defined, whether
or not their respective modules are enabled. However, when their modules
are disabled, they are replaced with macros that no-op and don't
waste time evaluating their arguments.

The old set! function will still work, for a while.
2018-06-15 03:42:01 +02:00
Henrik Lissner
f22eeff763
Add treemacs-mode to evil-escape-excluded-major-modes
Fixes an unresponsive "j" key in treemacs-mode.
2018-06-07 02:51:46 +02:00
Henrik Lissner
69a796ff60
Don't invoke doom/escape too eagerly from evil
This fixes an issue where certain evil plugins would call
evil-force-normal-state non-interactively, causing `doom-escape-hook` to
wreck havoc. Instead, this should only happen when
evil-force-normal-state is called interactively (e.g. via ESC in normal
mode).

Fixes evil-mc-make-cursor-move-next-line and
evil-mc-make-cursor-move-prev-line.
2018-06-07 02:51:45 +02:00
Henrik Lissner
c9a3c9e615
Disable evil-collection-minibuffer 2018-06-05 13:23:46 +02:00
Henrik Lissner
d5934ec8f7
feature/evil: update evil-shift-width manually (experimental) 2018-06-05 13:23:37 +02:00
Henrik Lissner
48fdc8a5b5
feature/evil: fix missing keymap in key def 2018-06-03 18:11:49 +02:00
Henrik Lissner
1e81a35461
Minimize dependence on map!
This is in preparation for general.el integration coming in 2.1.1. It is
very likely that map! will change (and even more, be split into several
macros). Not much, but change none-the-less. Specifically, the state
keywords (e.g. :nvi, :n, :i) will be removed in favor of a :state
property that takes a list, e.g. (normal visual insert).

In any case, both map! and general are also relatively expensive
compared to define-key and evil-define-key* (and the new define-key!
macro), so use that when we can.

This also means changes to either API won't affect Doom's modules in the
long term.
2018-06-03 15:46:00 +02:00
Henrik Lissner
43152d774f
Fix commented out :config causing errors
Semicolons, what have you done?
2018-06-01 16:32:38 +02:00