Commit Graph

66 Commits

Author SHA1 Message Date
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
Eivind Fonn 08561d8631 core: implement :depends for package declarations
This replaces the older pattern
:toggle (configuration-layer/package-usedp ..)

This implementation ensures that :disabled-for honors dependent packages, i.e.
if package a depends on package b, which is owned by layer c, and layer c is
disabled for layer d, then neither package a nor b will be configured for layer
d. Previously, this was only true for package a, but not b.

This commit also fixes:

- configuration-layer/describe-package now shows which post-init and pre-init
  functions are disabled, if any
- Does not recreate all layer objects unconditionally when calling
  configuration-layer/discover-layers. Previously, this led to all layers being
  recreated after e.g. `SPC h SPC`, without any of the dotfile information.
  Since this information is now necessary for
  configuration-layer/describe-package, it’s important that we don’t clear the
  indexed layers when invoking this function.
2017-06-22 11:53:05 +02:00
MadAnd 8fea6f134d ivy: Use new API to register additional transient state bindings
This is a follow-up commit after #8155 has been merged. It applies the same
changes to code of the `ivy` layer. It is not part of #8155 because there was
no `ivy` layer when that PR was submitted.
2017-05-24 09:12:48 +02:00
Eivind Fonn 909d23f412 Use symbols instead of strings 2017-05-23 16:04:40 +02:00
MadAnd 5eeaed75d9 transient-state: Improve handling of additional bindings
Add two new functions: `spacemacs/transient-state-register-add-bindings`
and `spacemacs/transient-state-register-remove-bindings` to prevent layer
authors and end users from dealing with the underlying variables' subtleties.
2017-05-23 16:03:03 +02:00
Muneeb Shaikh f93730b19c ivy: counsel-faces -> counsel-describe-face
Mistakenly added `counsel-faces` while the intended command that should go under
`SPC h d F` is `counsel-describe-face`.
2017-04-28 22:24:21 -04:00
Adrian Staniec 29605f57eb add perm. highlight and swoop/swiper to Symbol Highlight Transient State 2017-04-23 19:42:32 -04:00
Muneeb Shaikh 52ffc018b1 ivy: Add counsel-faces 2017-04-20 22:43:26 -04:00
ralesi 9b24a38eb9 Ivy: Multiple loading improvements and additional alternates
* Don't list imenu if it isn't loaded
* Add recentf config to :post-init function
* Add :init and :config sections for counsel and ivy for accessibility
* Add projectile alt actions to invalidate cache
* Add recentf alt actions to refresh and delete items
* Load flx since it is listed
2017-04-17 23:39:35 -04:00
duianto 94703a64be Remove "pr" 'projectile-recentf from ivy layer
problem: "pr" 'projectile-recentf is defined in both the Ivy layer
and spacemacs-base/packages.el

solution: remove it from the Ivy layer.
2017-04-17 17:43:05 -04:00
Somelauw 4361254e06 Fix #8698 2017-04-13 12:04:30 +02:00
MadAnd 33f3cf1293 ivy: add 2 missing bindings "SPC fel" and "SPC hi"
These are available with Helm and Counsel has similar counterparts.
2017-04-12 23:23:09 -04:00
Somelauw a8f68c0cca Add escape and M-SPC bindings to ivy
- escape quits the minibuffer
- M-SPC enters transient state

See conventions at
https://github.com/syl20bnr/spacemacs/blob/master/doc/CONVENTIONS.org
2017-04-12 23:21:51 -04:00
syl20bnr fb27ede558 Bump year in copyright headers
Happy New Year 2017!
2017-01-05 23:08:17 -05:00
Aron Griffis 385c12743a Add ripgrep support
* Add rg to helm completion layer
* Add rg to ivy layer
* Prepend rg to dotspacemacs-search-tools
* Add rg to documentation
2016-11-11 15:22:03 +02:00
Bryan Gilbert 7581662d7e rebind 'SPC f b' to 'counsel-bookmark' when using ivy 2016-11-05 12:27:56 +02:00
Bryan Gilbert b515253026 move helm specific layout transient state keybindings to helm layer 2016-10-23 19:44:35 +02:00
Bryan Gilbert 389d722996 close layout transient state upon entering layout buffer select when 2016-10-23 19:44:35 +02:00
bmag 0e1491c434 Make ivy restrict buffers to layout
Also create separate non-restricted-buffer-list (`SPC B b`) for helm and
ivy.
2016-10-17 13:45:43 +02:00
Bryan Gilbert 59897e2abd Fixed layout transient state not closing on layer select in ivy layer 2016-10-17 13:14:04 +02:00
Adam Sokolnicki 51c49531e3
Re-map "pp" to counsel-projectile-switch-project
Move counsel-projectile to "p SPC" as the original package suggests.
2016-09-23 10:47:13 +03:00