Commit Graph

86 Commits

Author SHA1 Message Date
Daniel Nicolai 7276970c91
Implement C-(S)-tab buffer switch in Ivy layer 2021-02-04 23:33:39 +01:00
Thanh Vuong 49a4fa072d [ivy] improve key bindings
bind c-spc to  ivy-call-and-recenter
this is the closest thing to helm follow mode in ivy world

unbin `g` key and map `U` for
for ivy-occur-mode-map and ivy-occur-grep-mode-map
2020-12-13 10:36:37 +01:00
madand 5884aa9aaa [ivy] Lazy load ivy-avy and ivy-hydra after ivy 2020-10-26 23:08:04 +01:00
duianto 331bf1b5bf [ivy] Rebind C-k to C-M-k in ivy-reverse-i-search
This enables navigating up in the `ivy-reverse-i-search` list with `C-k`.

The same rebinding from `C-k` to `C-M-k` to kill a list entry,
is also done in the `ivy-switch-buffer`.
2020-10-15 23:10:06 +02:00
Daniel Nicolai 2cdb535d04 Fix counsel find-file functions to use Spacemacs large file check
By default Ivy uses `find-file` which uses Emacs `abort-if-file-too-large`
function to check/warn before opening large files. That function however does
not take into account Spacemacs its `spacemacs-large-file-modes-list`. Instead
ivy should use `find-file-noselect` to skip Emacs it large file warning and let
it to Spacemacs its `spacemacs/check-large-file` function. Additionally [Emacs
tips on
comments](https://www.gnu.org/software/emacs/manual/html_node/elisp/Comment-Tips.html)
recommends to use 3 semicolons for comments that function as headings.
2020-10-15 23:08:05 +02:00
Wieland Hoffmann b606d82dfb [ivy] Bind `SPC s l` to ivy-resume
Helm already has spacemacs/resume-last-search-buffer bound to it and is in my
muscle memory. spacemacs/resume-last-search-buffer doesn't work with ivy, so
just use ivy-resume.
2020-10-10 06:11:12 +02:00
Daniel Nicolai 34bd5ab40d
Add C-RET keybinding for ivy-alt-done 2020-10-04 11:48:36 +02:00
Daniel Nicolai 4acea82f7b Replace spacemacs/swiper with better native swiper functions
Spacemacs uses spacemacs/swiper functions that use the less sophisticated
spacemacs//counsel-current-region-or-symbol instead of ivy's native
ivy-thing-at-point function. This commit removes those spacemacs functions and
rebinds the shortcuts to their better native equivalents.
2020-10-04 11:16:10 +02:00
Robert O'Connor 82ba73a1c0
update copyright to 2020 2020-09-23 21:25:01 +02:00
thanhvg 26a9f51dff
[ivy] add ivy-avy (#13961)
ivy-avy makes it possible to select a candidate with avy by using C-' in an ivy minibuffer.

This functionality used to come with swiper, but it was split: https://github.com/melpa/melpa/pull/6951

Copy pasta from our sister project Doom: https://github.com/hlissner/doom-emacs/pull/3414
2020-09-18 19:54:06 +02:00
madand 57e6849c68
[ivy] `SPC h m`: fallback to `woman` on Windows
`man` command displays output from the external program with the same name,
so it will generally fail to work on Windows.

`woman` is a pure elisp parser for manpages, so it will work on Windows. But
`woman` lacks colorizing of manpages, so we only use it as a fallback.
2019-12-15 15:06:26 +01:00
madand 239f60a65f [ivy][docs] Add `SPC h m`: search available man pages
This keybinding is documented in DOCUMENTATION.org, yet was missing in ivy layer.
2019-12-10 22:54:40 +01:00
madand fd184bb94f Fix spacemacs/counsel-search with ag and rg
The commit 9c613b8 introduced a regression for ivy users that use ag or rg as
the search tool. It made `C-c C-e` and `F3` keybindings unavailable, and thus
making it impossible to make multi-file edits.

Partially fixes #12838
2019-11-24 22:07:17 +01:00
duianto d125f2abd2 Fix void counsel-find-file-map
When the ivy package is installed without counsel,
and (require 'ivy) is called, then an error message
appears: void-variable counsel-find-file-map
2019-11-08 11:23:10 +01:00
Hong Xu 383da46e38 Keep ~C-h~ binding in =counsel-find-file-map= only for hjkl navigation
It has already been bound to <kbd>C-backspace</kbd> and
<kbd>C-delete</kbd>. Such an
additional binding is redundant (if hjkl navigation is not used) and
makes the original <kbd>C-h</kbd> binding
(help) unavailable.
2019-10-30 18:18:54 +01:00
Hong Xu cff6b47e6f Set counsel-find-file-at-point to t by default.
This enables better auto completion of =counsel-find-file=.
2019-10-27 05:06:02 +01:00
duianto 86c4ca2133 [ivy] Add counsel colors and faces key bindings
SPC C e calls counsel-colors-emacs
SPC C f calls counsel-faces
SPC C w calls counsel-colors-web
2019-10-19 23:13:35 +02:00
Hong Xu e37b70cfa3 Bound counsel-git to gff and move magit-find-file to gfF.
counsel-git find a file in the current git repository. "gff" is
currently bound to magit-find-file. While counsel-git seemingly performs the
same functionality as magit-find-file, they are substantially different:
magit-find-file is not intended to find a file, contrary to what the
name indicates. See https://github.com/magit/magit/issues/3967 for
explanation. This is why we need another key binding for counsel-git.
2019-10-16 22:03:42 +02:00
duianto 5894c396cb Fix C-k ivy-previous-line in ivy-switch-buffer
It applies to the editing styles:
- hybrid with the variable hybrid-style-enable-hjkl-bindings set to t
- vim

Moved the default key binding for ivy-switch-buffer-kill:
From: C-k
To:   C-M-k

Thanks for the suggestion: asok
2019-09-17 18:28:02 +02:00
madand 630781581a Fix definitions of extra actions R and D for recentf
`ivy-recentf` was renamed into `counsel-recentf` upstream.
2019-09-10 12:40:21 +02:00
bb2020 6f34185784 [ivy] Add `ivy-ret-visits-directory` variable 2019-05-21 22:47:21 +02:00
Miciah Masters 322528ca8d spacemacs-layouts: Fix adding buffers to new persp
Delete the hook that commit 9fcf8c898d added
to persp-created-functions, and change spacemacs/ivy-spacemacs-layouts,
spacemacs/helm-perspectives, spacemacs/helm-persp-switch-project, and
spacemacs/ivy-persp-switch-project to achieve the intended goal of adding
the desired buffers after creating a new perspective.

Change spacemacs/helm-persp-switch-project and
spacemacs/ivy-persp-switch-project as follows: If the user selects a
project but then quits without selecting a file or buffer, the new
perspective is now immediately killed.  Otherwise, if the perspective did
not already exist, any buffers that belong to the selected project are
added to the perspective.

Add the following actions to spacemacs/ivy-spacemacs-layouts and
spacemacs/helm-perspectives:

* Create a new perspective with the Spacemacs home buffer (default action).
* Create a new perspective with the buffers that belong to the current
  buffer's project.
* Create a new perspective with the buffers that belong to the current
  perspective (i.e., make a copy of the current perspective).

This commit resolves the problem reported in
9fcf8c898d (commitcomment-33343455).

This commit also fixes a problem with the default action for
spacemacs/ivy-spacemacs-layouts and spacemacs/helm-perspectives.  According to
commit 7b931a9f5b, the default action is supposed
to display the home buffer if the action creates a new perspective, which was
determined by checking whether the perspective was missing from the list of
perspectives _before_ switching.  However, commit
eb7ca651fe changed this logic so it was checking
whether the perspective was missing from the list of perspectives _after_
switching.  This commit restores the correct logic.

* CHANGELOG.develop: Update.
* layers/+completion/ivy/funcs.el (spacemacs/ivy-spacemacs-layouts): Add
"Copy Current Layout" and "Create Project Layout" actions to the docstring.
Use spacemacs//create-persp-with-home-buffer for the default action.
* layers/+completion/ivy/packages.el (ivy/post-init-persp-mode): Add
actions for spacemacs//create-persp-with-current-project-buffers and
persp-copy.
* layers/+spacemacs/spacemacs-layouts/funcs.el
(spacemacs||switch-layout): New macro.  Switch to the named perspective,
and initialize it using the provided forms if the perspective is new.
(spacemacs//create-persp-with-current-project-buffers): New function.
Create a new perspective with the current project's buffers.
(spacemacs||switch-project-persp): New macro.  Switch to the named
perspective, and evaluate the provided forms with
projectile-after-switch-project-hook bound with a hook that adds the
current project's buffers to the perspective.  If the user quits during the
evaluation of the forms, kill the perspective.
(spacemacs//create-persp-with-home-buffer): New function.  Switch to the
named perspective, and go to the Spacemacs home buffer if the perspective
is new.
(spacemacs/helm-perspectives): Use spacemacs//create-persp-with-home-buffer
for the default action.  Add actions for
spacemacs//create-persp-with-current-project-buffers and persp-copy.
(spacemacs//helm-persp-switch-project-action): New function.  Switch to the
named perspective and call projectile-switch-project-by-name, using the new
spacemacs||switch-project-persp macro.  Bind helm-quit-hook with a hook
that kills the new perspective if the user quits
projectile-switch-project-by-name.
(spacemacs/helm-persp-switch-project): Use
spacemacs//helm-persp-switch-project-action.
(spacemacs//ivy-persp-switch-project-action): New function.  Switch to the
named perspective and call counsel-projectile-switch-project-action with a
hook to add the project's buffers to the new perspective.
(spacemacs/ivy-persp-switch-project): Delete advice for
counsel-projectile-switch-project-action.  Use
spacemacs//ivy-persp-switch-project-action instead.
(spacemacs//add-project-buffers-to-persp): Deleted.
* layers/+spacemacs/spacemacs-layouts/packages.el
(spacemacs-layouts/init-persp-mode): Don't add a hook to
persp-created-functions.
2019-05-13 17:11:27 +02:00
yuhan0 62fea42576 fix typos in spacemacs/search-dir* bindings 2019-04-05 19:07:09 +02:00
duianto 4b195ddfc9 Ivy: Add `SPC h d a` counsel-apropos 2019-02-18 16:55:38 -05:00
Aaron Jensen 2c28c7d219 ivy: Fix counsel search
This function was renamed upstream:
58bf1b94c8
2018-12-28 15:20:29 +00:00
James Wang a226c78ea1 Ivy: Add keybinding for counsel-minibuffer-history 2018-09-03 22:15:27 +01:00
bmag e3ad8d2a5f ivy-rich: update config for upstream changes
ivy-rich-switch-buffer-align-virtual-buffer has been made obsolete and doesn't
have a replacement.
2018-08-30 12:00:10 +03:00
John Lee 9d2a1085ee Fix key bindings for wgrep
The problem was not with the existing bindings, but rather:

1. C-x C-e (spacemacs//counsel-edit -- from an ivy completion session) would
land you in an ivy-occur buffer with wgrep enabled but in motion state.  This
meant the spacemacs key bindings for wgrep were not available.  In particular,
the usual routine is:

* (enter ivy completion session, e.g. with SPC s a P)
* C-c C-e
* edit the buffer as needed
* , , (wgrep-finish-edit)
* , s wgrep-save-all-buffers

2. That last binding (, s) was not there.

One issue is that , s is available before wgrep-finish-edit is called, which is
confusing because I don't think it has any useful function at that point in
time.
2018-08-21 23:52:22 +03:00
Kalle Lindqvist dfd309a77b ivy: improve jumping in buffer 2018-07-15 08:18:35 +03:00
ivasonn d2dab66724 search highlighting (spacemacs/counsel-search) with ivy--regex-plus
spacemacs//ivy--regex-plus is a replacement for ivy--regex-plus in user
configurations.
2018-07-14 22:46:08 +03:00
Ting Zhou 9dc5ba8439 use evil normal mode as default for ivy-occur-grep-mode 2018-07-09 10:25:54 +03:00
duianto f4a3025174 Format symbol highlight transient state
Reduce the width of the listed key bindings by:
Moving the range and highlighted symbols counter to the right of the transient
state title.
Shorten some key description names.
Reduce three instances of "search" to just one.

And reorder the listed keys based on their search scope, small to large:
swoop, buffers, files, project.
2018-05-16 00:41:37 +03:00
syl20bnr ebe4c60264 Revert "Defer packages by default using use-package-always-defer"
This reverts commit 29c78ce841 and all other fixes
that have been made afterwards.

The motivation is that use-package is seen by many as a replacement for
`require`. Is use-package always defer the loading of packages then is breaks
this use case, this does not respect POLA so even if it was making Spacemacs
loading faster (up to 3s faster on some startup on my machine) we just cannot
use it, it would be irresponsible. Spacemacs should be easy to use, loading
performance will come with time but it is not a priority.
2018-03-03 23:40:10 -05:00
bmag f294d42ae5 use-package-always-defer: fix regressions in ivy layer
These changes were missed in commit 29c78ce841
2018-02-28 22:18:23 +02:00
syl20bnr 29c78ce841 Defer packages by default using use-package-always-defer
Warning now `:defer t` is implied, to force a package to load `:demand t` is
now necessary.
2018-02-27 23:32:52 -05:00
syl20bnr 2a5670e8df lsp: move helm-xref and ivy-xref ownership to helm and ivy layers 2018-02-18 22:48:12 -05:00
Muneeb Shaikh 6c476a3bd1 spacemacs-layouts: fix S/ivy-persp-switch-project
Fix #10177

counsel-projectile has updated custom actions mechanism[1] and
counsel-projectile-switch-project-actions is no more defined

Also,
 - moved counsel-projectile into spacemacs-layouts from ivy layer as
 perspective/layout based project switching depends on it instead of swiper
 - removed swiper from spacemacs-layouts

[1] a4e9a34d7f
2018-01-19 22:57:27 -05:00
syl20bnr 41e546f040 Move all use-package hook declaration to pre-init functions
Had to create dummy init functions at some places since the owner of a package
is the last layer that defines the init function of a package. And a package
can be installed only if it has an owner.
2018-01-10 23:57:18 -05:00
syl20bnr 014ed73109 ivy: change layer variable name for ivy-rich and add doc 2018-01-10 22:19:04 -05:00
Alejandro Catalina 43b35d5f05 Make ivy-rich a variable that controls whether to install it or not. 2018-01-10 22:10:26 -05:00
syl20bnr 70925f3fba ivy: sort packages 2018-01-06 21:44:58 -05:00
Alan Ferguson 3467aa8433 ivy: add ivy-rich display transformer for ivy-switch-buffer 2018-01-06 21:40:53 -05:00
syl20bnr 14b206492b ivy: use post-init to add hook for org-ctrl-c-ctrl-c 2018-01-06 11:51:19 -05:00
syl20bnr 326965d4ce Happy New Year 2018! 2018-01-04 02:00:25 -05:00
Ruslan Kamashev a7e30bfcb4 Fix typo (issue #9655) 2017-09-29 12:47:35 +03:00
syl20bnr 3bce69aba1 Fix warnings about unrecognized keys without helm or ivy layers
In perspective transient state. b and l keys in the docstring have no
corresponding functions declared whenever both helm and ivy layers are not
used.

Add two private variables to fix the issue:
- spacemacs--persp-display-buffers-func
- spacemacs--persp-display-perspectives-func

These variables are set to the correct functions by the helm and ivy layers via
a use-package hook.

Default is `ignore` function so b and l does nothing if both helm and ivy layers
are not used, TODO: we should find a better default function.
2017-09-26 00:10:00 -04:00
d12frosted c35b5b3dc3
set ivy-use-selectable-prompt to t
Following #8571.
2017-08-01 16:51:19 +03:00
bmag 9e2da0037c Ivy: add counsel-mark-ring 2017-07-09 18:19:38 +03:00
Eivind Fonn f4b53d2a4f Rename :depends to :requires 2017-07-03 09:54:53 +02:00
Eivind Fonn ebc6ba015e Implement directory search for ivy as well 2017-07-01 12:41:26 +02:00