Commit graph

134 commits

Author SHA1 Message Date
Henrik Lissner
54d1c0dd56
Minor, general refactors 2019-03-09 03:42:55 -05:00
Henrik Lissner
ee6e4a8b5c
Fix ivy--queue-exhibit: void-function nil error
Until Yevgnen/ivy-rich#51 is merged
2019-03-08 17:58:58 -05:00
Andrew Whatson
c7a29ca025 Add optional support for switch-buffer previews
When `+ivy-buffer-preview` is non-nil, our various switch-buffer
functions will preview the current candidate buffer, like how
`counsel-switch-buffer` works.

When `ivy-use-virtual-buffers` is non-nil, virtual buffers are *not*
previewed unless `+ivy-buffer-preview` is `'everything`.
2019-03-07 14:28:56 +10:00
Henrik Lissner
cf07bac383
Fix persisted workspace storing broken posframes #1017
Not confident this is the best solution, but it will work for now.
2019-02-28 14:19:05 -05:00
Andrew Whatson
faa4367636 Improved switch-to-buffer-other-window for ivy 2019-02-25 22:29:41 +10:00
Henrik Lissner
d7308799f6
Remove -z flag from ag/rg commands
No guarantee the user has the associated decompression libraries
installed. I'll implement feature detection for these later.
2019-02-21 19:13:35 -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
c2392039f0
counsel-describe-face -> counsel-faces
counsel-faces displays useful information alongside each face.
2018-10-29 02:31:51 -04:00
Henrik Lissner
ae99f52b99
completion/ivy: re-enable counsel-projectile
See ddf107a.
2018-10-19 17:46:30 -04:00
Henrik Lissner
c6c3054fbb
completion/ivy: update ivy-rich integration
And remove unused/defunct code. Also fixes a `file-in-directory-p: Wrong
type argument: stringp, nil` error when invoking counsel-recentf.
2018-10-17 14:34:43 -04:00
Henrik Lissner
4a9a2c00d9
Remove smex-completion-read reference
Doom no longer uses smex.
2018-09-26 12:29:55 -04:00
Henrik Lissner
b53b300657
Don't affect ivy-switch-buffer's transformer
ivy-rich already does this under the hood. This is redundant.
2018-09-23 16:30:43 -04:00
Henrik Lissner
f415762e8b
completion/ivy: fix ivy-rich integration 2018-09-19 23:34:00 -04:00
Henrik Lissner
86d51dd056
Add +doom-dashboard-mode to swiper-font-lock-exclude
It breaks the dashboard
2018-09-09 09:58:22 -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
7a578eb242
Move counsel+helpful integration to ivy module 2018-08-17 03:37:07 +02:00
Henrik Lissner
7d1246888b
Only set display function for counsel-ag
counsel-rg and counsel-pt both identify themselves as counsel-ag, so
these extra specifications were unnecessary.
2018-08-15 21:19:59 +02:00
Henrik Lissner
ddf107a507
Disable counsel-projectile temporarily #93
Until upstream resolves ericdanan/counsel-projectile#93
2018-08-11 01:59:37 +02:00
Henrik Lissner
9a3e71731c
completion/ivy: bring back flx 2018-08-04 13:47:19 +02:00
Henrik Lissner
e916a4d6fe
Remove ivy-prescient
Doesn't bring enough to the table, slows down fuzzy searches too much,
and alters the way ivy highlights.
2018-08-04 02:42:32 +02:00
Henrik Lissner
41a641f53b
Disable counsel-projectile-find-file transformer 2018-08-04 02:30:26 +02:00
Henrik Lissner
1f1f2c3ebf
completion/ivy: fix ivy--regex-fuzzy typos 2018-08-03 21:57:47 +02:00
Henrik Lissner
35b88a597b
Activate ivy-prescient-mode on ivy-mode 2018-08-03 21:40:54 +02:00
Henrik Lissner
ab4052b8dc
Refactor completion/ivy & optimize projectile-find-file
counsel-projectile-find-file fontifies visited files and sorts the
resulting file list from projectile-find-file, adding considerable
overhead. Then, ivy-prescient performs a frecency sort and filter,
adding more overhead.

Altogether, this makes projectile-find-file unusable for larger projects
when fuzzy search is on (and in some extreme cases, when it's off). This
change disables both features specifically for projectile-find-file.

Fixes #774, hopefully
2018-08-03 16:35:42 +02:00
Henrik Lissner
3673067736
Fix projectile-find-file locking up Emacs
This occurs when invoking it from the root of massive file trees, like
$HOME or certain non-project folders. It's better that it defer to a
different command altogether (counsel-find-file) if invoked from $HOME,
and counsel-file-jump from anywhere else, which offers approximately
what we want, but at a fraction of the performance cost in those cases.
2018-08-03 16:10:20 +02:00
Henrik Lissner
0b8f3e29d5
Remove rg/pt ivy-re-builders-alist entries
Both counsel-(rg|pt) identify themselves as counsel-ag, so these extra
entries are necessary.
2018-08-02 03:51:15 +02:00
Henrik Lissner
baf400b736
completion/ivy: add ivy-prescient #774
Better fuzzy support versus flx; hopefully faster. Also brings frecency
sorting to ivy commands.
2018-08-02 01:53:29 +02:00
Henrik Lissner
59bc7653d5
completion/ivy: remove flx #774
flx is much too slow with large lists of candidates (i.e.
counsel-projectile-find-file).
2018-08-02 00:29:26 +02:00
Henrik Lissner
c87c2bd5a6
Remove redundant magit-completing-read-function 2018-07-29 17:41:59 +02:00
Henrik Lissner
e865526c75
Add +(helm|ivy)-project-search-engines variables
This allows you to control what search engines for project-search
commands (bound to SPC / p) to try, and in what order. If you didn't
want to use ripgrep, for instance, remove 'rg from these variables, or
move it to the end of the list.
2018-07-23 00:06:47 +02:00
Henrik Lissner
4323886b1b
Use ivy fallback display function for swiper et co
As they don't work well with ivy-posframe.
2018-07-14 04:08:17 +02:00
Henrik Lissner
9f50ca01a0
Rename amx-save-file: smex-items -> amx-items 2018-07-12 16:45:57 +02:00
Henrik Lissner
2d30d996c3
Refactor counsel-find-file actions
Conform them to naming conventions & only autoload the functions that
aren't used immediately.
2018-07-05 14:05:09 +02:00
fuxialexander
0df9bae16b don't override original actions 2018-07-05 00:38:41 +08:00
fuxialexander
a906b82788 add action for counsel-find-file 2018-07-04 23:59:18 +08:00
Henrik Lissner
4a213e07f8
Fix void-function ivy--matcher-desc
When invoking +ivy-coo-hydra/body

Reported by @fuxialexander
2018-06-27 20:31:56 +02:00
Henrik Lissner
af41e17355
Minor reformatting & docstring tweak 2018-06-26 01:48:15 +02:00
Henrik Lissner
017ba8d79c
Autoload defhydras & use new naming convention
Phasing out the +module@name convention for plain old
+module-name-hydra, which is more compatible with elisp reflection tools
like describe-function and such.

Also, Emacs starts up faster now. Tee hee.
2018-06-26 01:43:54 +02:00
Henrik Lissner
2f63c5fa47
Merge pull request #723 from fuxialexander/fix-ivy-fuzzy
Fix disable ivy fuzzy search in counsel-grep and swiper
2018-06-25 15:02:41 +02:00
Henrik Lissner
106062da0d
Fix ivy posframe
The display function was being set on ivy-display-functions-props. The
correct variable for it is ivy-display-functions-alist.

Reported by randoom in discord.
2018-06-25 14:59:01 +02:00
fuxialexander
6a15db7e00 fix disable ivy fuzzy in swiper and counsel-grep 2018-06-25 14:15:00 +08: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
d7f8a9591e
completion/ivy: replace smex with amx
Faster and maintained.
2018-06-20 18:39:44 +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
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
d24807cc2c
Don't overwrite ivy-height for ivy-posframe
This would undo user's customizations to this variable.
2018-06-05 12:04:43 +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
f1bf9d1632
ivy-do-completion-in-region = t #640
Evil ex command completion is now handled by ivy, if it's enabled.
2018-06-01 12:00:57 +02:00
Henrik Lissner
4d9ddf27a9
Fix over-zealous evil-integration in ivy #636 2018-06-01 02:18:46 +02:00
Henrik Lissner
183ccbb8f1
Merge evil-collection-ivy into completion/ivy
Disables evil-collection-ivy. Another step toward the removal of
evil-collection from Doom.
2018-05-31 13:59:21 +02:00