Commit graph

162 commits

Author SHA1 Message Date
Akhil Wali
e5288c990b Add god-mode module 2019-10-05 08:56:09 +13:00
Henrik Lissner
d8526e00a7
Use python-shell-interpreter for .py file tmeplate 2019-10-04 11:57:19 -04:00
Henrik Lissner
d297dc6934
Minor refactor & comment revision across the board 2019-10-03 23:33:59 -04:00
Henrik Lissner
f93d3ca596
editor/evil: evil-escape-delay = 0.15 2019-09-20 23:55:25 -04:00
Henrik Lissner
e10cd8cf2e
Insult byte-compiler's mom
Yeah, that shut him up.
2019-09-20 23:10:53 -04:00
Henrik Lissner
8a634bc04d
Fix evil-collection-pdf not loading #1789
And prevents evil-collection-pdf from loading pdf-tools' eval-after-load
blocks twice.
2019-09-20 01:22:25 -04:00
Henrik Lissner
fdeb1aa45d
Prevent evil-collection from loading packages twice
Triggering eval-after-load blocks (and after!/use-package!) twice.
2019-09-15 16:18:31 -04:00
Henrik Lissner
ab8b31e5bc
Change behavior of BANG for +evil:narrow-buffer
BANG = use indirect buffers, otherwise, narrow/widen the current buffer.
2019-09-14 18:32:14 -04:00
Henrik Lissner
20d15c685e
Fix :narrow ex command 2019-09-14 01:56:38 -04:00
Henrik Lissner
1c05773c39
General, minor refactors & comment revision 2019-09-11 23:41:08 -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
81ee250c09
Minor refactor & revision across the board 2019-09-03 00:59:46 -04:00
Henrik Lissner
059ede53b6
Update all unit tests
To meet changes introduced from the straight branch merge.
2019-09-03 00:59:46 -04:00
Henrik Lissner
f763bf2fd0
Change :mc to take delimited pattern
This used to take a regexp after a space: ':mc REGEXP'. It now is
delimited, like :g or :s, e.g.

  :mc/REGEXP/FLAGS
  :mc/[a-z]
  :mc/abc/g
2019-09-02 01:30:04 -04:00
Andrew Whatson
6381a5c0ae Add :editor word-wrap module
Defines a new minor-mode `+word-wrap-mode` which configures
adaptive-wrap-prefix-mode and visual-line-mode for smart soft-wrapping
of code.

Evil users can toggle it with `SPC t w`.

Enable globally with `+global-word-wrap-mode`.

See the README for more details!
2019-08-27 15:04:38 +10:00
Henrik Lissner
8f1de7c998
Fix #1694: wrong-type-arg stringp errors on some files 2019-08-21 21:17:42 -04:00
Henrik Lissner
fb619bdb0f
Only trigger file-templates for non-existent files #1682
Possibly addresses #1401 too
2019-08-19 14:18:17 -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
a3e262c7ac
💥 Refactor add-hook! macro & change arg order
This update may potentially break your usage of add-hook! if you pass
the :local or :append properties to it. This is how they used to work:

  (add-hook! :append 'some-mode-hook #'do-something)

Thsoe properties must now follow the hooks, e.g.

  (add-hook! 'some-mode-hook :append #'do-something)

Other changes:
- Various add-hook calls have been renamed to add-hook! because I
  incorrectly assumed `defun` always returned its definition's symbol,
  when in fact, its return value is "undefined" (so sayeth the
  documentation). This should fix #1597.
- This update adds the ability to add multiple functions to hooks
  without a list:

    (add-hook! 'some-mode-hook
               #'do-something
               #'do-something-else)

- The indentation logic has been changed so that consecutive function
  symbols at indented at the same level as the first argument, but forms
  are indent like a defun.

    (add-hook! 'some-mode-hook
               #'do-something
               #'do-something-else)

    (add-hook! 'some-mode-hook
      (message "Hello"))
2019-07-26 20:17:29 +02:00
Henrik Lissner
ca295e4c79
Refactor evil-collection initialization
- Update comments
- Add code for easily refreshing evil-collection-mode-list
- Load evil-collection-term for multi-term
- Fix buffer-menu, image-mode, elisp and occur modules not loading
2019-07-26 03:12:07 +02:00
Henrik Lissner
017aa6a9f7
editor/rotate-text: conform to hook conventions
And add it<->xit and describe<->xdescribe rotate-text patterns (for
buttercup tests).
2019-07-24 22:13:19 +02:00
Henrik Lissner
82ae3a73f3
def-advice!->defadvice! & conform to new advice conventions
This commit does two things:

- Renames def-advice! to defadvice!, in the spirit of naming convenience
  macros after the function/macro they enhance or replace.
- Correct the names of advice functions to indicate visibility and
  intent. A public advice function like doom-set-jump-a is meant to be
  used elsewhere. A private one like +dired--cleanup-header-line-a
  shouldn't -- it likely won't work anywhere but the function(s) it was
  made to advise.
2019-07-23 17:24:56 +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
c795a988e6
Conform many modules to new conventions 2019-07-23 12:30:47 +02:00
Henrik Lissner
d106272574
Fix ]f/[f (next/previous file) motions 2019-07-22 23:51:12 +02:00
Henrik Lissner
88813ff196
Minor reformatting across the board
Gotta

Look

Nice
2019-07-22 22:34:08 +02:00
Henrik Lissner
ffadd1307d
Disable evil-collection-want-unimpaired-p
We have our own, better vim-unimpaired keybinds.
2019-07-22 13:31:56 +02:00
Henrik Lissner
755835a207
Change ex command from :m[sg] to :messages
The former overwrote :m[ove].
2019-07-22 13:30:42 +02:00
Henrik Lissner
33c220902e
editor/snippets: don't auto-enable yas-global-mode 2019-07-22 02:37:46 +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
b90dede1ab
💥 Replace package.el/quelpa with straight #374
There are a few kinks to iron out, but for the most part it's done. Doom
Emacs, powered by straight. Goodbye gnutls and elpa/quelpa issues.

This update doesn't come with rollback or lockfile support yet, but I
will eventually include one with Doom, and packages will be (by default,
anyway) updated in sync with Doom.

Relevant threads: #1577 #1566 #1473
2019-07-22 02:30:40 +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
81ab3dbc5d
Simplify and decouple init files
The two doom-gc-* variables in init.el couples the rest of the config to
these two files. The bulk of GC/file-handler optimization was moved into
core.el and simplified (all that idle-timer voodoo was overkill).

Also adds (setq frame-inhibit-implied-reize t) to early-init, which
speeds up startup a fair bit in some edge cases with larger fonts.

squash! Simplify and decouple init files
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
0625bf87d6
Add a nxml-mode file template 2019-07-18 03:41:47 +02:00
Henrik Lissner
d12e7b831f
editor/snippets: load doom-snippets sooner
We want +snippets-dir to be first in yas-snippet-dirs. To ensure this,
doom-snippets should be loaded immediately before it is added to it, if
possible.
2019-07-14 22:47:15 +02:00
Henrik Lissner
62af55dad0
Move emacs-snippets -> doom-snippets
The repo was renamed upstream.
2019-07-14 17:05:48 +02:00
Henrik Lissner
05eb333a0c
editor/snippets: expand on snippet commands & keybinds
- Introduces the +snippets/new (SPC s n) command for creating a new
  private snippet
- Introduces the +snippets/new-lias (SPC s N) command for creating a new
  private snippet alias, which will invoke another snippet (you will be
  prompted to select one). This will only work with the emacs-snippets
  library bundled with Doom Emacs, however, as it depends on its API.
- Introduces +snippets/edit (SPC s c) for modifying existing snippets.
  How this differs from yas-visit-snippet-file is it will copy the
  contents of built-in snippets into a buffer primed for your private
  snippets (in DOOMDIR/snippets), while yas-visit-snippet-file will
  simply open the originating snippet.
- Introduces the +snippets/find (SPC s ?),
  +snippets/find-for-current-mode (SPC s /) and
  +snippets/find-private (SPC s f) commands for, respectively, finding a
  snippet file among *all* directories in yas-snippet-dirs, finding a
  snippet for the current major mode (plus parents), and finding a
  snippet from among your private library. This opens built-in snippets
  in read-only mode, but you can press C-c C-e to open it in
  +snippets/edit.
2019-07-12 20:41:50 +02:00
Henrik Lissner
18758c3926
Fix +evil/easymotion for certain keys 2019-07-12 16:24:01 +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
a201409fdd
Minor refactors across the board 2019-07-10 21:27:12 +02:00
Henrik Lissner
9d8dc93515
Fix evil-collection-term triggering on multi-term #1554
Since multi-term loads term, this is redundant, and ends up overwriting
users' after! term or after! multi-term blocks.
2019-07-10 18:07:28 +02:00
Henrik Lissner
e8c0ac9f30
Switch to insert mode after expanding snippets 2019-07-10 12:08:39 +02:00
Henrik Lissner
c2fe951062
Add direnv-envrc-mode file template 2019-07-10 02:27:13 +02:00
Henrik Lissner
5662b2c4b3
Add shell.nix file-template 2019-07-08 14:36:38 +02:00
Henrik Lissner
d45b9348c0
Update evil-collection-mode-list #1543 2019-07-08 13:51:11 +02:00