Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Toggle mark at point #2991

Closed
wants to merge 2 commits into from
Closed

Toggle mark at point #2991

wants to merge 2 commits into from

Conversation

DiogoFerrari
Copy link

(defun ivy-toggle-mark-at-point()
  (interactive)
  (if (ivy--marked-p)
      (ivy-unmark)
    (ivy-mark)
    )
  )

Maybe it can be assigned to:

(define-key ivy-minibuffer-map (kbd "C-SPC") 'ivy-toggle-mark-at-point)

Use case 1:

Suppose we want to grep for "defun.*occur", but leave out
private ("--") functions.

We can do it with:

    "defun occur ! --" C-c C-o

But now we can also do it with:

    "defun occur" C-c C-o F "--" RET

The latter approach is more flexible.

Use case 2:

Suppose we're looking for a function that starts with "vi". So use
`counsel-describe-function' "vi" C-c C-o.

- We get 89 cands.
- F "view" RET to get 30 cands.
- F "viet" RET to get 25 cands.
- F "vim" RET to get 11 cands.
- now it's easy to go through the docs of the functions that are left.
@abo-abo
Copy link
Owner

abo-abo commented Sep 12, 2022

I think the interface is already complete with ivy-mark and ivy-unmark-backward.
Further, we can't bind C-SPC because people might want to use it for cut and paste of the input string.

@abo-abo abo-abo closed this Sep 12, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants