2017-06-08 11:47:56 +02:00
|
|
|
;;; completion/ivy/config.el -*- lexical-binding: t; -*-
|
2017-02-13 04:54:12 -05:00
|
|
|
|
2017-08-21 21:54:04 +02:00
|
|
|
(defvar +ivy-buffer-icons nil
|
|
|
|
"If non-nil, show buffer mode icons in `ivy-switch-buffer' and the like.")
|
|
|
|
|
2019-03-07 11:07:45 +10:00
|
|
|
(defvar +ivy-buffer-preview nil
|
|
|
|
"If non-nil, preview buffers while switching, à la `counsel-switch-buffer'.
|
|
|
|
|
|
|
|
When nil, don't preview anything.
|
|
|
|
When non-nil, preview non-virtual buffers.
|
|
|
|
When 'everything, also preview virtual buffers")
|
|
|
|
|
2017-06-08 11:47:56 +02:00
|
|
|
(defvar +ivy-task-tags
|
|
|
|
'(("TODO" . warning)
|
|
|
|
("FIXME" . error))
|
2017-05-10 06:13:14 +02:00
|
|
|
"An alist of tags for `+ivy/tasks' to include in its search, whose CDR is the
|
|
|
|
face to render it with.")
|
|
|
|
|
2018-07-23 00:06:47 +02:00
|
|
|
(defvar +ivy-project-search-engines '(rg ag pt)
|
|
|
|
"What search tools for `+ivy/project-search' (and `+ivy-file-search' when no
|
|
|
|
ENGINE is specified) to try, and in what order.
|
|
|
|
|
|
|
|
To disable a particular tool, remove it from this list. To prioritize a tool
|
|
|
|
over others, move it to the front of the list. Later duplicates in this list are
|
|
|
|
silently ignored.
|
|
|
|
|
|
|
|
If you want to already use git-grep or grep, set this to nil.")
|
|
|
|
|
2017-05-10 08:38:32 +02:00
|
|
|
(defmacro +ivy-do-action! (action)
|
2017-09-15 14:35:18 +02:00
|
|
|
"Returns an interactive lambda that sets the current ivy action and
|
|
|
|
immediately runs it on the current candidate (ending the ivy session)."
|
2017-05-10 05:20:54 +02:00
|
|
|
`(lambda ()
|
2017-02-13 04:54:12 -05:00
|
|
|
(interactive)
|
2017-05-10 05:20:54 +02:00
|
|
|
(ivy-set-action ,action)
|
2017-02-13 04:54:12 -05:00
|
|
|
(setq ivy-exit 'done)
|
|
|
|
(exit-minibuffer)))
|
|
|
|
|
2017-02-13 21:11:54 -05:00
|
|
|
|
|
|
|
;;
|
2019-04-06 01:31:59 -04:00
|
|
|
;;; Packages
|
2017-02-13 21:11:54 -05:00
|
|
|
|
2017-06-08 11:47:56 +02:00
|
|
|
(def-package! ivy
|
2018-05-25 00:46:11 +02:00
|
|
|
:defer 1
|
|
|
|
:after-call pre-command-hook
|
2017-02-22 04:27:23 -05:00
|
|
|
:config
|
2018-05-25 00:50:33 +02:00
|
|
|
(setq ivy-height 15
|
2017-02-13 04:54:12 -05:00
|
|
|
ivy-wrap t
|
|
|
|
ivy-fixed-height-minibuffer t
|
2017-02-22 04:27:23 -05:00
|
|
|
projectile-completion-system 'ivy
|
2017-03-08 21:34:52 -05:00
|
|
|
;; Don't use ^ as initial input
|
|
|
|
ivy-initial-inputs-alist nil
|
2017-02-22 04:27:23 -05:00
|
|
|
;; highlight til EOL
|
2017-05-19 05:45:11 -04:00
|
|
|
ivy-format-function #'ivy-format-function-line
|
|
|
|
;; disable magic slash on non-match
|
2018-01-08 14:41:41 -05:00
|
|
|
ivy-magic-slash-non-match-action nil
|
|
|
|
;; don't show recent files in switch-buffer
|
|
|
|
ivy-use-virtual-buffers nil
|
|
|
|
;; ...but if that ever changes, show their full path
|
2018-03-23 02:23:57 -04:00
|
|
|
ivy-virtual-abbreviate 'full
|
|
|
|
;; don't quit minibuffer on delete-error
|
2018-05-14 20:03:36 +02:00
|
|
|
ivy-on-del-error-function nil
|
|
|
|
;; enable ability to select prompt (alternative to `ivy-immediate-done')
|
|
|
|
ivy-use-selectable-prompt t)
|
2017-02-13 04:54:12 -05:00
|
|
|
|
2018-07-28 12:33:27 +02:00
|
|
|
(after! yasnippet
|
|
|
|
(add-to-list 'yas-prompt-functions #'+ivy-yas-prompt nil #'eq))
|
2017-02-22 04:27:23 -05:00
|
|
|
|
2019-03-07 11:07:45 +10:00
|
|
|
(map! :map ivy-mode-map
|
|
|
|
[remap switch-to-buffer] #'+ivy/switch-buffer
|
|
|
|
[remap switch-to-buffer-other-window] #'+ivy/switch-buffer-other-window
|
|
|
|
[remap persp-switch-to-buffer] #'+ivy/switch-workspace-buffer
|
|
|
|
[remap imenu-anywhere] #'ivy-imenu-anywhere)
|
2017-02-22 04:27:23 -05:00
|
|
|
|
2018-08-03 16:12:27 +02:00
|
|
|
(ivy-mode +1)
|
2017-02-13 04:54:12 -05:00
|
|
|
|
2018-08-03 16:12:27 +02:00
|
|
|
(def-package! ivy-hydra
|
|
|
|
:commands (ivy-dispatching-done-hydra ivy--matcher-desc)
|
|
|
|
:init
|
|
|
|
(define-key! ivy-minibuffer-map
|
2019-04-06 00:35:43 -04:00
|
|
|
"C-o" #'ivy-dispatching-done-hydra
|
|
|
|
"M-o" #'+ivy-coo-hydra/body)))
|
2018-01-08 14:41:41 -05:00
|
|
|
|
|
|
|
|
2018-09-19 23:34:00 -04:00
|
|
|
(def-package! ivy-rich
|
2019-04-06 01:31:59 -04:00
|
|
|
:hook (ivy-mode . ivy-rich-mode)
|
2018-09-19 23:34:00 -04:00
|
|
|
:config
|
2019-04-06 01:31:59 -04:00
|
|
|
(when +ivy-buffer-icons
|
|
|
|
(cl-pushnew '(+ivy-rich-buffer-icon (:width 2 :align right))
|
|
|
|
(cadr (plist-get ivy-rich-display-transformers-list
|
|
|
|
'ivy-switch-buffer)))
|
|
|
|
(after! counsel-projectile
|
|
|
|
(setq ivy-rich-display-transformers-list
|
|
|
|
(plist-put ivy-rich-display-transformers-list
|
|
|
|
'counsel-projectile-switch-project
|
|
|
|
'(:columns
|
|
|
|
(((lambda (_) (all-the-icons-octicon "file-directory"))
|
|
|
|
(:width 2 :align right))
|
|
|
|
(ivy-rich-candidate)))))
|
|
|
|
(setq ivy-rich-display-transformers-list
|
|
|
|
(plist-put ivy-rich-display-transformers-list
|
|
|
|
'counsel-projectile-find-file
|
|
|
|
'(:columns
|
|
|
|
((all-the-icons-icon-for-file (:width 2 :align right))
|
|
|
|
(ivy-rich-candidate)))))))
|
|
|
|
|
|
|
|
;; Highlight buffers differently based on whether they're in the same project
|
|
|
|
;; as the current project or not.
|
2019-04-05 23:52:29 -04:00
|
|
|
(let* ((plist (plist-get ivy-rich-display-transformers-list 'ivy-switch-buffer))
|
2019-04-06 01:31:59 -04:00
|
|
|
(switch-buffer-alist (assq 'ivy-rich-candidate (plist-get plist :columns))))
|
2018-10-17 14:34:43 -04:00
|
|
|
(when switch-buffer-alist
|
2019-04-06 01:31:59 -04:00
|
|
|
(setcar switch-buffer-alist '+ivy-rich-buffer-name)))
|
|
|
|
|
|
|
|
;; Allow these transformers to apply to more switch-buffer commands
|
|
|
|
(let ((ivy-switch-buffer-transformer (plist-get ivy-rich-display-transformers-list 'ivy-switch-buffer)))
|
|
|
|
(dolist (cmd '(+ivy--switch-buffer counsel-projectile-switch-to-buffer))
|
|
|
|
(setq ivy-rich-display-transformers-list
|
|
|
|
(plist-put ivy-rich-display-transformers-list
|
|
|
|
cmd ivy-switch-buffer-transformer)))))
|
2018-09-19 23:34:00 -04:00
|
|
|
|
|
|
|
|
2017-02-23 00:06:12 -05:00
|
|
|
(def-package! counsel
|
2018-05-30 13:28:22 +02:00
|
|
|
:commands counsel-describe-face
|
2018-01-27 20:57:02 -05:00
|
|
|
:init
|
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 03:30:04 -05:00
|
|
|
(map! [remap apropos] #'counsel-apropos
|
|
|
|
[remap bookmark-jump] #'counsel-bookmark
|
|
|
|
[remap describe-face] #'counsel-faces
|
|
|
|
[remap describe-function] #'counsel-describe-function
|
|
|
|
[remap describe-variable] #'counsel-describe-variable
|
2019-03-09 03:23:10 -05:00
|
|
|
[remap describe-bindings] #'counsel-descbinds
|
|
|
|
[remap set-variable] #'counsel-set-variable
|
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 03:30:04 -05:00
|
|
|
[remap execute-extended-command] #'counsel-M-x
|
|
|
|
[remap find-file] #'counsel-find-file
|
|
|
|
[remap find-library] #'counsel-find-library
|
|
|
|
[remap info-lookup-symbol] #'counsel-info-lookup-symbol
|
|
|
|
[remap imenu] #'counsel-imenu
|
|
|
|
[remap recentf-open-files] #'counsel-recentf
|
|
|
|
[remap org-capture] #'counsel-org-capture
|
|
|
|
[remap swiper] #'counsel-grep-or-swiper
|
|
|
|
[remap evil-ex-registers] #'counsel-evil-registers
|
|
|
|
[remap yank-pop] #'counsel-yank-pop)
|
2017-02-13 21:11:54 -05:00
|
|
|
:config
|
2018-06-18 02:26:05 +02:00
|
|
|
(set-popup-rule! "^\\*ivy-occur" :size 0.35 :ttl 0 :quit nil)
|
2018-01-28 22:24:45 -05:00
|
|
|
|
2018-05-17 16:59:55 +02:00
|
|
|
(setq counsel-find-file-ignore-regexp "\\(?:^[#.]\\)\\|\\(?:[#~]$\\)\\|\\(?:^Icon?\\)"
|
2018-08-17 03:37:07 +02:00
|
|
|
counsel-describe-function-function #'helpful-callable
|
|
|
|
counsel-describe-variable-function #'helpful-variable
|
2019-02-21 15:40:20 -05:00
|
|
|
;; Add smart-casing (-S) to default command arguments:
|
|
|
|
counsel-rg-base-command "rg -S --no-heading --line-number --color never %s ."
|
|
|
|
counsel-ag-base-command "ag -S --nocolor --nogroup %s"
|
|
|
|
counsel-pt-base-command "pt -S --nocolor --nogroup -e %s")
|
2017-02-13 04:54:12 -05:00
|
|
|
|
2018-09-08 18:40:11 -04:00
|
|
|
(add-to-list 'swiper-font-lock-exclude #'+doom-dashboard-mode nil #'eq)
|
|
|
|
|
2018-07-05 14:05:09 +02:00
|
|
|
;; Factories
|
|
|
|
(defun +ivy-action-reloading (cmd)
|
|
|
|
(lambda (x)
|
|
|
|
(funcall cmd x)
|
|
|
|
(ivy--reset-state ivy-last)))
|
|
|
|
|
|
|
|
(defun +ivy-action-given-file (cmd prompt)
|
|
|
|
(lambda (source)
|
|
|
|
(let* ((enable-recursive-minibuffers t)
|
|
|
|
(target (read-file-name (format "%s %s to:" prompt source))))
|
|
|
|
(funcall cmd source target 1))))
|
|
|
|
|
2018-07-04 23:59:18 +08:00
|
|
|
;; Configure `counsel-find-file'
|
|
|
|
(ivy-add-actions
|
|
|
|
'counsel-find-file
|
2018-07-05 00:38:41 +08:00
|
|
|
`(("b" counsel-find-file-cd-bookmark-action "cd bookmark")
|
|
|
|
("s" counsel-find-file-as-root "open as root")
|
|
|
|
("m" counsel-find-file-mkdir-action "mkdir")
|
2018-07-05 14:05:09 +02:00
|
|
|
("c" ,(+ivy-action-given-file #'copy-file "Copy file") "copy file")
|
|
|
|
("d" ,(+ivy-action-reloading #'+ivy-confirm-delete-file) "delete")
|
2018-07-05 00:38:41 +08:00
|
|
|
("r" (lambda (path) (rename-file path (read-string "New name: "))) "rename")
|
2018-07-05 14:05:09 +02:00
|
|
|
("R" ,(+ivy-action-reloading (+ivy-action-given-file #'rename-file "Move")) "move")
|
2018-07-04 23:59:18 +08:00
|
|
|
("f" find-file-other-window "other window")
|
2018-07-05 00:38:41 +08:00
|
|
|
("F" find-file-other-frame "other frame")
|
|
|
|
("p" (lambda (path) (with-ivy-window (insert (file-relative-name path default-directory)))) "insert relative path")
|
|
|
|
("P" (lambda (path) (with-ivy-window (insert path))) "insert absolute path")
|
2018-07-04 23:59:18 +08:00
|
|
|
("l" (lambda (path) "Insert org-link with relative path"
|
2018-07-05 00:38:41 +08:00
|
|
|
(with-ivy-window (insert (format "[[./%s]]" (file-relative-name path default-directory))))) "insert org-link (rel. path)")
|
2018-07-04 23:59:18 +08:00
|
|
|
("L" (lambda (path) "Insert org-link with absolute path"
|
2018-07-05 00:38:41 +08:00
|
|
|
(with-ivy-window (insert (format "[[%s]]" path)))) "insert org-link (abs. path)")))
|
2018-07-04 23:59:18 +08:00
|
|
|
|
2018-08-03 16:12:27 +02:00
|
|
|
(ivy-add-actions
|
|
|
|
'counsel-ag ; also applies to `counsel-rg' & `counsel-pt'
|
|
|
|
'(("O" +ivy-git-grep-other-window-action "open in other window"))))
|
2017-02-13 04:54:12 -05:00
|
|
|
|
2019-04-06 01:31:59 -04:00
|
|
|
|
2018-01-27 20:57:02 -05:00
|
|
|
(def-package! counsel-projectile
|
|
|
|
:commands (counsel-projectile-find-file counsel-projectile-find-dir counsel-projectile-switch-to-buffer
|
2019-04-06 01:31:59 -04:00
|
|
|
counsel-projectile-grep counsel-projectile-ag counsel-projectile-switch-project)
|
2018-01-27 20:57:02 -05:00
|
|
|
:init
|
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 03:30:04 -05:00
|
|
|
(map! [remap projectile-find-file] #'+ivy/projectile-find-file
|
|
|
|
[remap projectile-find-dir] #'counsel-projectile-find-dir
|
|
|
|
[remap projectile-switch-to-buffer] #'counsel-projectile-switch-to-buffer
|
|
|
|
[remap projectile-grep] #'counsel-projectile-grep
|
|
|
|
[remap projectile-ag] #'counsel-projectile-ag
|
|
|
|
[remap projectile-switch-project] #'counsel-projectile-switch-project)
|
2018-01-27 20:57:02 -05:00
|
|
|
:config
|
2018-08-04 02:30:26 +02:00
|
|
|
;; no highlighting visited files; slows down the filtering
|
2019-04-06 01:31:59 -04:00
|
|
|
(ivy-set-display-transformer #'counsel-projectile-find-file nil))
|
2018-01-27 20:57:02 -05:00
|
|
|
|
|
|
|
|
2018-01-14 02:04:30 -05:00
|
|
|
(def-package! wgrep
|
2018-05-25 00:46:11 +02:00
|
|
|
:commands wgrep-change-to-wgrep-mode
|
2018-01-14 02:04:30 -05:00
|
|
|
:config (setq wgrep-auto-save-buffer t))
|
2018-05-08 21:47:40 +02:00
|
|
|
|
|
|
|
|
|
|
|
(def-package! ivy-posframe
|
2018-05-18 01:21:09 +02:00
|
|
|
:when (and EMACS26+ (featurep! +childframe))
|
2018-05-08 21:47:40 +02:00
|
|
|
:hook (ivy-mode . ivy-posframe-enable)
|
|
|
|
:preface
|
|
|
|
;; This function searches the entire `obarray' just to populate
|
|
|
|
;; `ivy-display-functions-props'. There are 15k entries in mine! This is
|
|
|
|
;; wasteful, so...
|
|
|
|
(advice-add #'ivy-posframe-setup :override #'ignore)
|
|
|
|
:config
|
2018-06-05 11:20:39 +02:00
|
|
|
(setq ivy-fixed-height-minibuffer nil
|
2018-06-26 01:47:32 +02:00
|
|
|
ivy-posframe-parameters
|
|
|
|
`((min-width . 90)
|
|
|
|
(min-height . ,ivy-height)
|
|
|
|
(internal-border-width . 10)))
|
2018-05-18 01:21:09 +02:00
|
|
|
|
2018-06-26 01:47:32 +02:00
|
|
|
;; ... let's do it manually instead
|
2018-06-23 16:48:58 +02:00
|
|
|
(unless (assq 'ivy-posframe-display-at-frame-bottom-left ivy-display-functions-props)
|
|
|
|
(dolist (fn (list 'ivy-posframe-display-at-frame-bottom-left
|
|
|
|
'ivy-posframe-display-at-frame-center
|
|
|
|
'ivy-posframe-display-at-point
|
|
|
|
'ivy-posframe-display-at-frame-bottom-window-center
|
|
|
|
'ivy-posframe-display
|
|
|
|
'ivy-posframe-display-at-window-bottom-left
|
|
|
|
'ivy-posframe-display-at-window-center
|
|
|
|
'+ivy-display-at-frame-center-near-bottom))
|
2018-06-25 14:48:30 +02:00
|
|
|
(push (cons fn '(:cleanup ivy-posframe-cleanup)) ivy-display-functions-props)))
|
|
|
|
;; default to posframe display function
|
|
|
|
(setf (alist-get t ivy-display-functions-alist) #'+ivy-display-at-frame-center-near-bottom)
|
2018-05-08 21:47:40 +02:00
|
|
|
|
2019-02-28 14:18:12 -05:00
|
|
|
;; Fix #1017: stop session persistence from restoring a broken posframe
|
|
|
|
(defun +workspace|delete-all-posframes (&rest _) (posframe-delete-all))
|
|
|
|
(add-hook 'persp-after-load-state-functions #'+workspace|delete-all-posframes)
|
|
|
|
|
2018-05-08 21:47:40 +02:00
|
|
|
;; posframe doesn't work well with async sources
|
2018-08-15 20:39:42 +02:00
|
|
|
(dolist (fn '(swiper counsel-ag counsel-grep counsel-git-grep))
|
2019-04-06 01:31:59 -04:00
|
|
|
(setf (alist-get fn ivy-display-functions-alist) #'ivy-display-function-fallback)))
|
2018-05-30 11:25:41 +02:00
|
|
|
|
|
|
|
|
2018-08-04 13:47:19 +02:00
|
|
|
(def-package! flx
|
|
|
|
:when (featurep! +fuzzy)
|
|
|
|
:defer t ; is loaded by ivy
|
|
|
|
:init
|
|
|
|
(setq ivy-re-builders-alist
|
|
|
|
'((counsel-ag . ivy--regex-plus)
|
2019-03-30 00:07:57 -04:00
|
|
|
(counsel-rg . ivy--regex-plus)
|
2018-08-04 13:47:19 +02:00
|
|
|
(counsel-grep . ivy--regex-plus)
|
|
|
|
(swiper . ivy--regex-plus)
|
|
|
|
(t . ivy--regex-fuzzy))
|
|
|
|
ivy-initial-inputs-alist nil))
|
|
|
|
|
|
|
|
|
2018-06-20 18:37:13 +02:00
|
|
|
;; Used by `counsel-M-x'
|
2018-07-12 16:45:57 +02:00
|
|
|
(setq amx-save-file (concat doom-cache-dir "amx-items"))
|
2018-06-20 18:37:13 +02:00
|
|
|
|
|
|
|
|
2018-05-31 11:41:33 +02:00
|
|
|
;;
|
|
|
|
;; Evil key fixes
|
|
|
|
|
|
|
|
(map! :when (featurep! :feature evil +everywhere)
|
|
|
|
:after ivy
|
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 03:30:04 -05:00
|
|
|
:map (ivy-occur-mode-map ivy-occur-grep-mode-map)
|
|
|
|
:m "j" #'ivy-occur-next-line
|
|
|
|
:m "k" #'ivy-occur-previous-line
|
|
|
|
:m "h" #'evil-backward-char
|
|
|
|
:m "l" #'evil-forward-char
|
|
|
|
:m "g" nil
|
|
|
|
:m "gg" #'evil-goto-first-line
|
2018-05-31 11:41:33 +02:00
|
|
|
:map ivy-occur-mode-map
|
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 03:30:04 -05:00
|
|
|
:n [mouse-1] #'ivy-occur-click
|
|
|
|
:n [return] #'ivy-occur-press-and-switch
|
|
|
|
:n "gf" #'ivy-occur-press
|
|
|
|
:n "ga" #'ivy-occur-read-action
|
|
|
|
:n "go" #'ivy-occur-dispatch
|
|
|
|
:n "gc" #'ivy-occur-toggle-calling
|
|
|
|
:n "gr" #'ivy-occur-revert-buffer
|
|
|
|
:n "q" #'quit-window
|
2018-05-31 11:41:33 +02:00
|
|
|
:map ivy-occur-grep-mode-map
|
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 03:30:04 -05:00
|
|
|
:v "j" #'evil-next-line
|
|
|
|
:v "k" #'evil-previous-line
|
|
|
|
:n "D" #'ivy-occur-delete-candidate
|
|
|
|
:n "C-d" #'evil-scroll-down
|
|
|
|
:n "d" #'ivy-occur-delete-candidate
|
|
|
|
:n "C-x C-q" #'ivy-wgrep-change-to-wgrep-mode
|
|
|
|
:n "i" #'ivy-wgrep-change-to-wgrep-mode
|
|
|
|
:n "gd" #'ivy-occur-delete-candidate
|
|
|
|
:n [mouse-1] #'ivy-occur-click
|
|
|
|
:n [return] #'ivy-occur-press-and-switch
|
|
|
|
:n "gf" #'ivy-occur-press
|
|
|
|
:n "gr" #'ivy-occur-revert-buffer
|
|
|
|
:n "ga" #'ivy-occur-read-action
|
|
|
|
:n "go" #'ivy-occur-dispatch
|
|
|
|
:n "gc" #'ivy-occur-toggle-calling
|
|
|
|
:n "q" #'quit-window)
|