Commit Graph

8099 Commits

Author SHA1 Message Date
Henrik Lissner
63a224f0e8
Fix wrong which-key labels & leader key precedence
This changes how leader keys are bound, to fix an issue where the wrong
which-key label was assigned to the wrong keys, and cases where the
leader key was being shadowed by other minor mode mappings.

Unfortunately, this new method adds 10-20% to startup times. I'll
address this in a future patch. For now, correctness is more important.

Also fixes dashboard keybind detection.
2018-12-27 00:08:47 -05:00
Henrik Lissner
6992e27884
ui/doom: use solaire-global-mode #1070 2018-12-26 17:36:52 -05:00
Henrik Lissner
e58c1ff89d
Fix TAB in modes with their own keybind
Like org-mode
2018-12-26 15:01:28 -05:00
Henrik Lissner
3befcf934e
Make +haskell-repl-buffer arg optional 2018-12-26 14:53:08 -05:00
Henrik Lissner
b7cfa90967
Update map! docstring
And remove all references to :alt-prefix
2018-12-26 00:55:39 -05:00
Henrik Lissner
b88c712715
Merge pull request #1057 from ar1a/helm-project-search-bind
Bind SPC-/-p to +helm/project-search if using helm
2018-12-25 04:37:25 -05:00
Henrik Lissner
b69d1ea620
Merge pull request #1064 from dywedir/patch-1
config/default: fix `Wrong number of arguments: define-key`
2018-12-25 04:36:41 -05:00
Henrik Lissner
649d34244a
evil-define-key -> evil-define-key* 2018-12-25 04:36:15 -05:00
Vladyslav M
62f9c9827f
config/default: fix Wrong number of arguments: define-key 2018-12-25 11:18:03 +02:00
Henrik Lissner
c0c84eb99b
Fix M-SPC error with helm #1059
The global leader keybind was conflicting with a global M-SPC keybind in
helm-map. This keybind should only be set in non-evil sessions, so we
unset it if evil is found.
2018-12-25 03:56:24 -05:00
Henrik Lissner
94b4cd3ddb
Merge pull request #1061 from NXTk/develop
Change .gitignore to exclude "modules/private" when attached as symlink
2018-12-25 03:35:33 -05:00
Henrik Lissner
9c2a1b1f61
config/default: TAB->[tab] for workspace keys 2018-12-25 02:45:10 -05:00
Henrik Lissner
448f2e55e5
lang/org: update localleader keybinds
To better suit the new map!
2018-12-25 02:32:53 -05:00
Henrik Lissner
d337e255d3
Fix :leader/:localleader and :prefix
Due to issues with preset prefixes in general definers and nested
:prefix's supplied from a map! call not cooperating, many localleader
keybinds were broken and causing errors. For :leader/:localleader keys,
we now use :infix for sub-prefixes.

However, with this change, the :alt-prefix property has been removed, as
there is no simple way to support this without some major state
gymnastics in map!.

Fixes #1059
2018-12-25 02:29:29 -05:00
Ivan Koz
99d327c210 Change .gitignore to exclude "modules/private" when attached as symlink. 2018-12-25 02:36:36 +04:00
Henrik Lissner
70a4db49d1
lang/org: fix C-S-return & S-s-return keybinds 2018-12-24 02:43:32 -05:00
Henrik Lissner
9f2dff02fa
Rethink config/default & keybindings
+ Added +smartparens flag to config/default for default smartparens
  config.
+ Fixed +tng support for completion/company.
+ Removed super keybinds (for all but MacOS)
+ Moved "keybind fixes" to config/default/config.el (these should be
  universally available).
+ Replaced both +default-repeat-forward-key and +default-repeat-backward-key
  with +default-repeat-keys. If this variable is nil, the universal
  repeat motions won't be bound.
2018-12-24 00:04:50 -05:00
Henrik Lissner
f9b72545b7
Replace def-org-file-link! with function
A macro is overkill for this.
2018-12-23 23:55:14 -05:00
Henrik Lissner
3f195614d9
Normalize :leader/:localleader keybinds
Evil states no longer apply to them. Also removes x-alt-keysym.
2018-12-23 23:54:27 -05:00
Henrik Lissner
9936532ea3
Move auth-sources & mc/list-files
...to move appropriate locations.
2018-12-23 23:16:03 -05:00
Henrik Lissner
5ad0b749a1
Refactor map! & tests
This resolves issues with :leader/:localleader keys not working when
evil states are specified. Evil states are now ignored. Also, some of
map!'s internals have been optimized to yield a ~10% improvement in
macro expansion time.
2018-12-23 23:12:10 -05:00
Henrik Lissner
29f119ad4d
Hook +javascript-npm-mode into typescript-mode
This way typescript projects will be aware of node_modules.
2018-12-23 16:01:37 -05:00
Aria
45bb7256cb Bind SPC-/-d to helm too 2018-12-23 18:43:16 +11:00
Aria
715c189608 Bind SPC-/-p to +helm/project-search if using helm 2018-12-23 16:53:45 +11:00
Henrik Lissner
451c16b8ee
Revise :after-call & :defer-incrementally comments
Now implicitly adds the current package to :defer-incrementally's list
of packages.
2018-12-23 00:25:51 -05:00
Henrik Lissner
0efa915164
Fix :leader/:localleader targeting preceding keys
This fixes an issue where even the keys preceding :leader/:localleader
were registered as leader/localleader keys.
2018-12-23 00:10:18 -05:00
Henrik Lissner
f35837755c
Disable tools/editorconfig by default 2018-12-22 20:18:29 -05:00
Henrik Lissner
695edd7a14
Merge pull request #1055 from chengyi/add-rust-keybinding-description
add rust key bingding description
2018-12-22 20:08:31 -05:00
Henrik Lissner
02624251c1
lang/rust: update keybinds for new map! 2018-12-22 20:07:18 -05:00
Henrik Lissner
032bde6aa2
Fix malformed keybind remapping 2018-12-22 19:34:56 -05:00
Henrik Lissner
91474c98ee
Fix localleader binds hijacking SPC in insert mode 2018-12-22 19:33:20 -05:00
Henrik Lissner
5447927e6a
Refactor map! tests 2018-12-22 19:30:00 -05:00
Henrik Lissner
4383531b32
Ensure gerneral-implicit-kbd=t in map!
Also updates map! tests (TODO: abstract all those cdr-caddr's!)
2018-12-22 17:11:20 -05:00
Henrik Lissner
954b0f9c5d
Minor tweaks to map! calls for correctness
+ :map arguments shouldn't be quoted
+ :localleader keys default to all states in the absence of state
  modifiers. This is preferred, rather than restricting their use to
  normal state.
+ :map* is deprecated (there is no difference between it and :map)
2018-12-22 17:01:00 -05:00
Henrik Lissner
a29163740d
GIT_ASKPASS=git-gui--askpass for GUI Emacs+Windows 2018-12-22 17:00:06 -05:00
Henrik Lissner
604a41527f
Use general custom definers rather than :definer
The former approach was the cause for a huge increase in startup
time (adding ~0.4s) when :leader and :localleader were used. This is
because general-define-key was called for every key-def pair.

This new approach batches these calls, which has decreased the
performance impact by at least 80%.
2018-12-22 16:50:01 -05:00
Henrik Lissner
d222327d24
Reformat SPC n keys
Used to be in general-define-key format, now in canonical map! format.
2018-12-22 16:48:42 -05:00
Henrik Lissner
fc24c3bff2
Fix #1056: S key in insert/emacs state
A keybind intended for operator mode was bound globally.
2018-12-22 16:40:46 -05:00
Henrik Lissner
a124497f4e
find-file-visit-truename = t 2018-12-22 14:30:29 -05:00
Henrik Lissner
4a69fb5d29
Fix non-prefix key error on MacOS
kbd is necessary for global-set-key, otherwise it reads M-` as three
keys M, - and `, and M is already bound to self-insert-command, so it
cannot be used as a prefix.
2018-12-22 14:23:11 -05:00
Henrik Lissner
43fa39eaf1
config/default: restore q, p, r, s, t leader groups 2018-12-22 05:29:57 -05:00
Henrik Lissner
4d3587c8d0
Fix void-variable list error in multi-state binds
Caused by overzealous re-setting of a variable in a loop, when it should
only be set once.
2018-12-22 05:20:43 -05:00
Henrik Lissner
5e33fefd74
Fix malformed map! yasnippet keybinds
Causing breaking errors.
2018-12-22 05:20:02 -05:00
Henrik Lissner
64e633df0d
Add feature/evil/+commands.el 2018-12-22 04:43:48 -05:00
Henrik Lissner
65290d3d2f
app/irc: re-nest keybinds
And restore missing circe-command-NAMES keybind.
2018-12-22 04:36:51 -05:00
Henrik Lissner
5331a28533
set-pretty-symbols!: fix void-variable mode error
Occurs when unsetting pretty symbols for a mode
with (set-pretty-symbols! 'some-mode nil), because of a forgotten loop
and let-var.
2018-12-22 04:25:15 -05:00
Henrik Lissner
d6cb0ec5f5
General cleanup & minor refactoring 2018-12-22 04:25:15 -05:00
Henrik Lissner
3dd34abe61
Remove hide-undefined-binds advice for which-key
Before general.el was introduced to Doom, commands were bound to keys
whether or not their containing modules were enabled. This was out of
laziness and readability. I intend to change this, as such it is no
longer necessary to hide unavailable keybinds from which-key.
2018-12-22 04:25:15 -05:00
Henrik Lissner
674ad9837d
Update after! docstring 2018-12-22 04:25:15 -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