Questions tagged [counsel]
The counsel tag has no usage guidance.
70
questions
0
votes
0
answers
31
views
Why does M-x and C-x b get stuck?
Recently, I experience that M-x and C-x b gets stuck, meaning I can't move up or down in the list; only the middle item is highlighted
This is both M-x (counsel-M-x) and C-x b (ivy-switch-buffer)
This ...
0
votes
0
answers
18
views
counsel-find-file-ignore-regexp not ignoring files in search
I have the following in my config:
(setq counsel-find-file-ignore-regexp "\`[#.]\|[#~]\'")
which was taken straight from the documentation for counsel-find-file-ignore-regexp. However, they ...
0
votes
0
answers
20
views
counsel-M-x search for command names optionally beginning with my:
Goal
Use counsel-M-x to browse commands that begin with a particular character, except that they may be optionally prefixed by my:
Example
counsel-M-x >> ^org matches commands beginning with org
...
0
votes
0
answers
13
views
Make counsel-evil-marks select the candidate immediately, go to the mark in one click
I am using counsel-evil-marks in doom-emacs on Mac OS. When the mini buffer pops up, I still need to select the candidate and press enter.
How can I assign a key, so I switch immediately to the marked ...
0
votes
1
answer
29
views
Can literal prefixes be privileged in counsel-find-file ordering?
After many years of living in vanilla Emacs, I am playing with souping things up a bit, and trying out ivy/counsel.
I'm finding the experience of counsel-find-file a bit jarring, because it does not ...
1
vote
1
answer
80
views
Override counsel-yank-pop binding with use-package
I would like to use the classic emacs yank-pop instead of counsel mode's counsel-yank-pop which is linked to M-y. I've tried unbinding and rebinding it, but it does not seem to work.
I setup counsel ...
0
votes
1
answer
107
views
With Ivy/Counsel, why are some foreground colors in `M-x` a different color than others?
Please see the picture below. Why are some things colored orange? I can't figure out what Face is causing that. This is using Ivy/Counsel.
1
vote
0
answers
42
views
How can I keep the default `yank-pop` behaviour after installing swiper?
Swiper replaces the behaviour of the M-y command (yank-pop) with its own implementation, which shows the contents of the kill ring.
I like the default behaviour of M-y prior to installing this package ...
0
votes
1
answer
51
views
Ivy-dispatching-done (M-o) action list is not showing all options
I use counsel-projectile-switch-project to pop up a list of projects and M-o to bring up the action list, but the action list is like this.
and there's no way to scroll to get the top options like &...
0
votes
1
answer
76
views
Is it possible to use counsel-yank-pop (or something similar) to get the job done of pasting from the clipboard-ring in the mini-buffer?
This is my emacs init file. As you see, I use command counsel-yank-pop. And I even did a keybinding for it with:
;; =counsel-yank-pop= enhances built-in =yank-pop=.
(global-set-key (kbd "M-y"...
0
votes
3
answers
194
views
Why can't counsel-rg index an expression previously found?
I am using trying to use a command called counsel-rg. This is the associated describe-command:
counsel-rg is an autoloaded interactive compiled Lisp function in
‘counsel.el’.
(counsel-rg &...
0
votes
0
answers
40
views
counsel-git-grep: why does it ignore .gitignore paths?
Currently there is an issue (or else I can't figure it out) with counsel-git-grep-function: why does this function not ignore the files in .gitignore when searching? It would be a useful function if ...
0
votes
0
answers
42
views
Understand edebug stack tracing
so for some unknown reason, whenever I edebug-defun to counsel-jq, I get the following error
edebug-syntax-error: Invalid read syntax: "Expected one of", symbolp, lambda-expr
stack trace ...
1
vote
1
answer
180
views
Why does counsel-find-file use the current Dired directory when I specify argument INITIAL-DIRECTORY?
I am trying to use counsel-find-file to open the folder containing my Emacs configuration through a call such as the following:
(counsel-find-file 'nil "~/Documents/test-emacs/.emacs.d/")
...
0
votes
1
answer
53
views
If `counsel-git` returns `Not in a Git repository`, can we run `find-file`?
I am using counsel-git to find files in my git repo. I have overwrite into default find-file's keybinding.
(global-set-key (kbd "C-x C-f") 'counsel-git)
If I am not in a git-repo, such as ...
1
vote
1
answer
265
views
How to implement google/other search engine search of visually selected text in evil mode (counsel-search of selected text)
How can I define a command that searches the web for the evil visually selected text using google or some other search engine? counsel-search already does this if you insert a string, but how can I ...
0
votes
1
answer
33
views
With swiper counsel ivy installed I get a 4 digit number in front of M-x in the mini-buffer. What does this number relate to?
It doesn’t seem to be related either to the line I am in nor to the number of chars in the document.
1
vote
0
answers
324
views
How to exclude certain directories/files from counsel-git-grep search?
Would it be possible to exclude certain directories/files from counsel-git-grep search, such as .gitignore?
Here I don't want to see matches in .gitignore file:
I have tried adding ':(exclude)....
0
votes
3
answers
411
views
Limit counsel-locate to certain file type and directory
CentOS 7, Emacs 27.2, Ivy, Swiper, Counsel package.
In Temp folder I have different files. I want to find using counsel-locate all text files only in this folder and all subfolders.
I try this:
As ...
4
votes
1
answer
170
views
How do I jump to the previous/next modification (relative to the git HEAD) in the current file?
How do I jump to the previous/next modification (relative to the git HEAD) in the current file?
Ideally, I like sth like swiper that lets me choose to easily jump between modifications.
0
votes
0
answers
410
views
Not all counsel-find-file actions are shown
Linux Mint 20.1 , Emacs 27.2, I installed Ivy, Swiper and Counsel.
So in sources file of counsel.el I find this:
(ivy-set-actions
'counsel-find-file
'(("j" find-file-other-window "...
0
votes
1
answer
955
views
Ivy: How can I execute an action on a selection without opening the action menu?
Apologies if the question is poorly formulated, I am a beginner at understanding internals of Emacs/packages.
I am using using Doom Emacs, which provides Ivy as an interface for, for example, finding ...
0
votes
1
answer
140
views
How can disable TAB to execute selected line in `counsel-M-x`?
I am using counsel-M-x, it has little bit different behavior than smex, where TAB may execute the line.
Is it possible to use TAB only for toggling where I just want to disable feature to execute the ...
0
votes
1
answer
189
views
Follow org links in current buffer with ivy
How can I follow org links in the current buffer using ivy? This is similar functionality to m (M-x Info-menu) in info with ivy/counsel installed.
The command should list with ivy everything that ...
2
votes
1
answer
251
views
How to change counsel grep options once activated? (counsel-rg, counsel-git-grep ... etc)
I would like to have the ability to change the flags passed to grep once counsel-rg has been stated.
For example, sometimes I start counsel-rg and type in a string that needs a lot of escaping. In ...
4
votes
1
answer
951
views
How can I edit the beginning of the counsel-find-file filename whilst preserving the rest
I work on projects with deep directory structures and have several copies in different top-level directories. I sometimes find myself wanting to open the corresponding file in one of the other ...
1
vote
2
answers
495
views
How to search word under cursor using counsel-git-grep
I am using counsel-git-grep to grep for a string in the current Git repository.
When I do M-x counsel-git-grep it opens following in the mini-buffer.
2 git grep:
3 chars more
Let say if the ...
0
votes
2
answers
486
views
counsel-rg how to repeat last search?
When repeat invoking counsel-ag, counsel-rg, counsel-projectile-rg etc, how can I quickly bring back the previous search term without retyping the query?
0
votes
1
answer
274
views
How to use ivy to select email attachments with mu4e
I use the mu4e package to read my emails. However, I also use the ivy completion framework, which includes file completion.
Using both packages together is a bit of a problem though. mu4e uses its own ...
0
votes
1
answer
53
views
How to use counsel-git-grep without using back slash
I am using counsel-git-grep to grep for a string in the current Git repository.
Lets assume I am searching string " [ok] ". In order to obtain correct results I have to provide input as &...
1
vote
1
answer
187
views
How can I tell counsel's `counsel-git` to ignore certain file endings and folders
I am using counsel-git to find and open files.
Is there any way to ignore folders and files that are ending with specific pattern.
For example: ignore folders named: .idea ; and files ended with *....
0
votes
1
answer
142
views
How to change coloring in counsel
I am using counsel-buffer-or-recentf in order to toggle in files under buffer and recentf. The selected line is not clear, which has blue background highlighting.
=> Is it possible to change the ...
2
votes
1
answer
602
views
Selecting a directory like counsel-find-file
I would like to write a function that would prompt the user to select a directory, using an UI like that presented by counsel-find-file.
The starting directory should be an arbitrary directory passed ...
1
vote
3
answers
2k
views
Projectile switch between opened projects
I often have to work with multiple related projects and switching between them can become hard. I use counsel-projectile and it really makes everything easier. To be clear, I am not talking about ...
4
votes
1
answer
466
views
Don't show "." and ".." in counsel-find-file
I have a thing where I just don't like editing directories in emacs, and I never want to enter dired mode. Any time anything might want to put me into dired mode, I would prefer it not do that and ...
0
votes
1
answer
66
views
Why does `term-emulate-terminal` get executed every time `read-from-minibuffer` gets executed?
Why does term-emulate-terminal get executed every time I execute counsel-switch-buffer if and only if the *terminal* buffer is open in a window. If the *terminal* buffer is not in a window term-...
0
votes
0
answers
196
views
Some keybinding stopped working this morning with error "Wrong type argument: arrayp, nil"
I used counsel-org-goto-all to jump between headings. This morning, the command (which I have bound to C-;) stopped working with this error: Wrong type argument: arrayp, nil.
I have searched on the ...
1
vote
1
answer
96
views
Why does ivy 1.13.0 from GNU ELPA have counsel included?
MELPA has a package called counsel. Most guides on the ivy package recommend installing counsel as well. GNU ELPA doesn't have counsel. Why doesn't it?
I've installed ivy 0.13.0 from GNU ELPA. I don'...
2
votes
1
answer
338
views
ivy counsel find-file with similar name
In the directory I have mongodb.js, now I want to create a db.js file but if I type the name and press enter counsel-find-file use regex to open mongodb.js.
How can i create a db.js with counsel-find-...
4
votes
1
answer
890
views
Searching a specific project sub-directory with projectile
I recently found Projectile and I am loving it. I really like the ivy/counsel integration as well. One thing is missing though:
I am working on a huge project of hundreds of files. This is stored in ...
0
votes
0
answers
104
views
Using Counsel with write-file and insert-file
What is the simplest way to have Counsel versions of write-file (C-x C-w) and insert-file (C-x i)?
I would like these replacements to work similarly to counsel-find-file (typically bound to C-x C-f). ...
5
votes
0
answers
328
views
Sort ripgrep results based on proximity to current buffer
I use counsel-projectile-rg to search within the project I work on. But there is my sub-project inside this big repo that most of my development is in.
Is there a way to sort ripgrep results based on ...
0
votes
0
answers
109
views
C-g doesn't work within Counsel's action menu (M-o)
Let's say I'm completing a file with counsel-find-file. I then press M-o to show the menu with available actions. If within that menu, I press C-g, I get the message "C-g is not bound".
The ...
0
votes
2
answers
441
views
enable counsel-projectile by default
I want to enable counsel-projectile-mode by default.
I have added (counsel-projectile-mode) to .emacs file as per project's usage guide but it doesn't work; meaning projectile still uses ido for ...
1
vote
0
answers
22
views
Accessing login-shell variables (from counsel-find-file)
With #'counsel-find-file, I can type $ to access environment
variables, but it appears these belong to a special emacs environment
and are not login-shell-wide. Can I access the latter kind of ...
1
vote
0
answers
408
views
Use counsel/ivy to insert org-links?
I'm trying to use counsel/ivy to insert org links, but I haven't found a way to do this. I just want something to replace org-insert-link with a counsel interface. Can anyone help?
1
vote
1
answer
1k
views
Why can't Emacs find counsel and swiper, even though they (and Ivy) seem installed, and Ivy working?
Why can't Emacs find counsel and swiper, even though they (as well as ivy) seem installed, and moreover Ivy mode is enabled, and seems to be working?
This is what I get when I try the following:
(...
2
votes
0
answers
69
views
How do I cycle through file locations on counsel results?
I'm trying to look for all the occurrences of a word in my project and I'm using counsel for this. I get the list of occurrences and their locations in the minibuffer, but I'd like to cycle through ...
3
votes
1
answer
692
views
Equivalent to `ido-find-file` functionality for ivy/counsel?
I really like how ido-find-file, if it can’t find a file matching your string (and you’ve let it idle for like a second), will search your whole home directory for files matching that string, and then ...
1
vote
1
answer
171
views
counsel-ag shows no output
I try to use counsel-ag to grep through all files in a directory for a string. Basically, I thought this is what it was made for. I have ag 2.2.0 installed via macports on OS X 10.10.5 and it works ...