Commit graph

151 commits

Author SHA1 Message Date
Henrik Lissner
d0188b827a
editor/evil: set evil-respect-visual-line-mode sooner
So users are able to change it in time in their init.el
2019-12-22 12:26:50 -05:00
Henrik Lissner
b53703d527
General comment revision & reformatting 2019-12-21 15:01:05 -05:00
Henrik Lissner
baae6b1711
Rename +evil/paste-preserve-register => +evil/alt-paste
Now does the invers of evil-kill-on-visual-paste
2019-12-21 03:59:46 -05:00
Henrik Lissner
8562fc0aa3
editor/evil: use <easymotion> event for custom keybinds 2019-12-21 03:51:53 -05:00
Henrik Lissner
bbd02c8fca
evil-want-C-w-delete = t & remove C-b/C-f keybinds
M-b and M-f already exist for moving by word, so I'll leave C-b and C-f
to their defaults.
2019-12-21 03:44:44 -05:00
Henrik Lissner
c1879945fd
Replace doom/backward-kill-to-bol-and-indent
WIth new evil-delete-back-to-indentation, with behaves exactly as C-u
does in vim.
2019-12-21 03:30:44 -05:00
Henrik Lissner
ebf3739cf1
Speed up evil-ex search in magit or long/large buffers 2019-12-20 14:04:15 -05:00
Henrik Lissner
287ea46133
evil-ex-interactive-search-highlight = 'selected-window 2019-12-15 23:52:17 -05:00
Henrik Lissner
04f95c65e7
editor/evil: evil-respect-visual-line-mode = t
evil 0 motion was fixed in
emacs-evil/evil#12bee185bb7b1a6012e2ae424f60055ad9eedf56
2019-12-09 18:33:26 -05:00
Henrik Lissner
bf0efe81ae
editor/evil: add :l[ine]diff ex command
Relevant to #2126
2019-12-01 15:41:14 -05:00
Rudi Grinberg
e16d6a8d7c Add evil-quick-diff
This introduces the `g o d` text object for comparing regions. It works
like evil-exchange. Select two regions in sequence with `g o d` and an
ediff buffer of the selections will pop up.

Signed-off-by: Rudi Grinberg <me@rgrinberg.com>
2019-12-01 15:44:16 +07:00
Henrik Lissner
439fac65d7
editor/evil: evil-respect-visual-line-mode = nil
To match vim's behavior.
2019-11-25 20:43:48 -05:00
Henrik Lissner
26c8f5c6ef
Bytecompiler bytecompiler, won't you shut up 2019-11-23 01:21:25 -05:00
Henrik Lissner
ad2b905330
editor/evil: fix gr/gR in notmuch & elfeed 2019-11-15 22:17:30 -05:00
Henrik Lissner
5498b17de2
Bind 'gr' to revert-buffer in dired-mode 2019-11-12 16:24:51 -05:00
Henrik Lissner
9113eab65a
No-op set-repeater! later if +evil-repeat-keys is nil 2019-11-05 14:55:53 -05:00
Henrik Lissner
8b5714bdfa
editor/evil: bind zn in visual mode too 2019-11-04 12:49:48 -05:00
Henrik Lissner
baac5dfee1
editor/evil: conform functions to naming conventions 2019-11-02 01:40:45 -04:00
Henrik Lissner
1c4a170614
Reformat vim-unimpaired-esque keybinds 2019-10-30 22:26:12 -04:00
Henrik Lissner
5f6d9eadb3
Bind '{[,]} c' to jump between comments
I know {[,]} * and {[,]} \\ are the unimpaired keys for this, but
putting it on 'c' makes much more sense and is easier to hit.
2019-10-30 22:23:28 -04:00
Henrik Lissner
496a4b1b5f
editor/evil: alphabetize text object keybinds 2019-10-29 18:20:35 -04:00
Henrik Lissner
43030c789e
editor/evil: revert focus-on-split behavior (and refactor advice)
Focus-on-split is being disabled to achieve vim parity. The advice is
still necessary to ensure splitting updates the window buffer list, so
operations like winner-undo undoes correctly.
2019-10-29 01:09:14 -04:00
Henrik Lissner
6982281404
Fix mouse-1 on buttons initiating a selection 2019-10-28 23:23:13 -04:00
Henrik Lissner
f18caa1518
evil-{,v}split-window-{below,right} = t
To match vim's behavior, when splitting windows. The
+evil-window-split-a and +evil-window-vsplit-a advice are still
necessary to preserve proper "window focus" order.
2019-10-28 23:23:13 -04:00
Henrik Lissner
3c6f48f9ec
Move evil & corrective keybinds to respective modules
Keybinds that correct behavior or provide or extend vim functionality
were moved to their respective modules, or to the :editor evil module.

Keybinds in the global space, that are particularly opinionated but
potentially harmful or imposing as a default, or likely for users to
change (like leader keys), are kept in config/default.
2019-10-26 23:44:28 -04:00
Henrik Lissner
d87310bd55
Replace evil-commentary with evil-nerd-commenter
The latter provides a comment text object and better commenting support
across various languages.
2019-10-10 16:11:42 -04:00
Henrik Lissner
f93d3ca596
editor/evil: evil-escape-delay = 0.15 2019-09-20 23:55:25 -04:00
Henrik Lissner
887bc05478
Ensure evil-escape loads later at startup
evil-normal-state-exit-hook is fired prematurely at startup, which makes
it a poor candidate for :after-call deferral.
2019-09-09 23:04:07 -04:00
Henrik Lissner
7138d47ef4
Disable evil-want-abbrev-expand-on-insert-exit
It may be a vim default, but why would anyone want this?
2019-08-19 12:48:36 -04:00
Henrik Lissner
c8baa2b3f6
editor/evil: refactor ex commands; add evil-traces
This commit lazy loads Doom's custom ex commands. To add your own,
you'll need to wrap them in (after! evil-ex ...).
2019-08-15 14:58:41 -04:00
Henrik Lissner
09d13fd60d
Use add-hook! for inline hook defuns 2019-07-27 02:46:49 +02:00
Henrik Lissner
76cacb5bfe
💥 Rename def-package! -> use-package!
Calling this pivotal macro "def-package!" has frequently been a source
of confusion. It is a thin wrapper around use-package, and it should be
obvious that it is so. For this reason, and to match the naming
convention used with other convenience macros/wrappers, it is now
use-package!.

Also changes def-package-hook! -> use-package-hook!

The old macros are now marked obsolete and will be removed when straight
integration is merged.
2019-07-23 12:50:45 +02:00
Henrik Lissner
060ede0e2e
General, minor reformatting across the board
And an offering of blood to our great lord Byte Compiler-sama.
2019-07-22 02:37:45 +02:00
Henrik Lissner
fdcb259bcd
Major refactor of Doom core files
- Remove core-os and move many of its settings out to other core
  libraries, where they belong
- Significantly improve commenting & compartmentalization of many
  settings
- Correct some mis-named public hooks (that were named as if they were
  private)
- Move the vast majority of optimizations to "Optimizations" section in
  core.el
- Don't activate xclip-mode or osx-clipboard-mode if we're accessing
  Emacs through an SSH connection (does more bad than good there)
- Add fast-but-imprecise-scrolling = t
- Set bidi-display-reordering = 'left-to-right, at the recommendation of
  an Emacs dev. Apparently setting it to nil is undefined, as Emacs is
  designed to always assume it's set; setting it explicitly to
  left-to-right will still do what was originally intended by turning it
  off: to reduce line/text scans for bidirectional text, which gives us
  a moderate boost in general runtime snappiness
- Set inhibit-compacting-fon-caches = t on windows (where it struggles
  especially with icon fonts)
- Disables "literal" mode for very large files (because I will be
  backporting so-long.el from Emacs 27 in the next commit)
2019-07-22 02:30:38 +02:00
Henrik Lissner
149b2617b0
💥 revise hook/var fns naming convention (2/2)
This is second of three big naming convention changes. In this commit,
we change the naming conventions for hook functions and variable
functions:

1. Replace the bar | to indicate a hook function with a -h suffix, e.g.

     doom|init-ui -> doom-init-ui-h
     doom|run-local-var-hooks -> doom-run-local-var-hooks-h

2. And add a -fn suffix for functions meant to be set on variables,
   e.g.

     (setq magit-display-buffer-function #'+magit-display-buffer-fn)

See ccf327f8 for the reasoning behind these changes.
2019-07-22 02:30:38 +02:00
Henrik Lissner
51d3b1b424
💥 revise advice naming convention (1/2)
This is first of three big naming convention updates that have been a
long time coming. With 2.1 on the horizon, all the breaking updates will
batched together in preparation for the long haul.

In this commit, we do away with the asterix to communicate that a
function is an advice function, and we replace it with the '-a' suffix.
e.g.

  doom*shut-up -> doom-shut-up-a
  doom*recenter -> doom-recenter-a
  +evil*static-reindent -> +evil--static-reindent-a

The rationale behind this change is:

1. Elisp's own formatting/indenting tools would occasionally struggle
   with | and * (particularly pp and cl-prettyprint). They have no
   problem with / and :, fortunately.
2. External syntax highlighters (like pygmentize, discord markdown or
   github markdown) struggle with it, sometimes refusing to highlight
   code beyond these symbols.
3. * and | are less expressive than - and -- in communicating the
   intended visibility, versatility and stability of a function.
4. It complicated the regexps we must use to search for them.
5. They were arbitrary and over-complicated to begin with, decided
   on haphazardly way back when Doom was simply "my private config".

Anyhow, like how predicate functions have the -p suffix, we'll adopt the
-a suffix for advice functions, -h for hook functions and -fn for
variable functions.

Other noteable changes:
- Replaces advice-{add,remove}! macro with new def-advice!
  macro. The old pair weren't as useful. The new def-advice! saves on a
  lot of space.
- Removed "stage" assertions to make sure you were using the right
  macros in the right place. Turned out to not be necessary, we'll
  employ better checks later.
2019-07-22 02:27:45 +02:00
Henrik Lissner
feb9799f23
Add f surround key to other lisp modes
This already existed for elisp, but is now available to lisp-mode (CL),
clojure and racket.
2019-07-12 01:08:41 +02:00
Henrik Lissner
403c2e1b5d
Add < surround key
ysiw<testRET will transform

  String

To

  test<String>

In C-style major modes that use angle bracket generics/templates (e.g.
C++, rust, C#, java, swift, and typescript).
2019-07-12 01:07:23 +02:00
Henrik Lissner
168c1d5e61
Disable evil-snipe in calc-mode 2019-06-26 14:28:40 +02:00
Henrik Lissner
8434ae619d
Enable evil-escape in term-mode
It was formerly escaped because of general bugginess, particularly when
bind -v was used in zsh. It's still too buggy to enable in vterm-mode,
however.
2019-06-26 14:28:33 +02:00
Henrik Lissner
855ff34e2c
Port more next/previous motions from vim
They are:

]m, [m
  Jump to next/previous beginning of method/function.
]M, [M
  Jump to next/previous end of method/function
]#, [#
  Jump to next/previous preprocessor directive (only supports C-style
  directives for now)
]*, [* (or ]\, [\)
  Jump to next/previous comment
2019-06-17 12:37:19 +02:00
Henrik Lissner
72fd61e07b
Ensure order of after-change-major-mode-hook hooks
Reduces the likeliness of load order issues.
2019-06-16 19:16:23 +02:00
Henrik Lissner
5d94f048b6
editor/evil: remove evil-matchit
Its bugginess doesn't justify the "intelligence" it offers for block
keywords.
2019-06-10 09:38:57 +02:00
Henrik Lissner
6ea000393f
Use superior evil-numbers fork
And rebind its keys from C-a/C-S-a to g= and g-. This is because the old
narrow/widen commands aren't nearly as useful (and have a number of
alternative keybinds).

As much as I'd like to us C-a/C-x (as it is in Vim), C-x is an essential
keybind for Emacs.

Also, in visual mode, each number will be affected incrementally (ala g
C-a and g C-x in vim).
2019-05-30 13:56:06 -04:00
Henrik Lissner
f7b75a7d68
editor/evil: use evil-set-cursor-color
set-cursor-color causes an expensive redraw. Plugins like treemacs may
silently change window focus, triggering these calls and causing
freezing. We use evil-set-cursor-color instead, which avoids
set-cursor-color unless the cursor's color has changed.
2019-05-17 21:02:24 -04:00
Henrik Lissner
4c65ce4c71
Start help-with-tutorial in emacs state 2019-05-14 22:26:56 -04:00
Henrik Lissner
00f88a509f
editor/evil: evil-want-C-i-jump = t in daemon
Since we can't predict what kind of frames the user will open, we assume
they're graphical. Terminal+daemon users will have to undo this in
`~/.emacs.d/init.el`.
2019-05-12 01:43:45 -04:00
Henrik Lissner
e5d566ea2a
Prevent non-prefix key errors on doom//refresh
May also help doom/reload
2019-05-12 01:43:22 -04:00
Henrik Lissner
ba94ab09d3
editor/evil: disable C-i keybind for tty users #1367 2019-04-26 17:29:54 -04:00
Henrik Lissner
a4c5396558
Add better-jumper
Replaces evil's jumplist; makes its functionality available for non evil
users.
2019-04-24 18:16:04 -04:00