Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
`counsel-git-grep' followed by `ivy-next-history-element' #409
I'm having a hard time setting
I'm using this:
(use-package swiper :ensure t :init (ivy-mode 1) :diminish ivy-mode :bind (("C-S-s" . swiper) ("C-c C-r" . ivy-resume) ("<f6>" . ivy-resume) ("M-x" . counsel-M-x) ("C-x C-f" . counsel-find-file) ("<f1> f" . counsel-describe-function) ("<f1> v" . counsel-describe-variable) ("<f1> l" . counsel-load-library) ("<f2> i" . counsel-info-lookup-symbol) ("<f2> u" . counsel-unicode-char) ("C-c g" . counsel-git) ("C-c j" . counsel-git-grep) ("C-x l" . counsel-locate)) :config (csetq ivy-use-virtual-buffers t) (use-package counsel :ensure t :config (setq-default counsel-git-grep-cmd "/home/jdahm/src/git/git --no-pager grep --full-name -n --no-color -i -e %S") (setq-default counsel-git-grep-cmd-history "/home/jdahm/src/git/git --no-pager grep --full-name -n --no-color -i -e %S")))
Looks like the
No need to set this manually. This is simply the initial history for C-u
Thanks for the quick reply. Even after a few years with Emacs I'm not an expert, and always looking to learn tips.
I got the idea from your config, but for now I'm using
(defmacro csetq (var val) "Call `customize-set-variable' to set VAR to VAL." `(funcall 'customize-set-variable ',var ,val))
The idea was something like customize-setq to use the customize interface instead of directly `set-variable'. On a related note, I'm still not sure the best way to deal with the defcustom vs defvar issues, but we should discuss that another time.
Here's what I ended up using to debug:
(defun my-counsel-git-grep () (interactive) (counsel-git-grep "/home/jdahm/src/git/git --no-pager grep --full-name -n --no-color -i -e %S"))
I tried that, and then it matches nothing in the code, even when there is a clear 'String' in the code with spaces on either side.
I can just remove them by default, or hit `M-n' again. However, I'd like to understand how this is supposed to work, and how I'm either misunderstanding it or using it incorrectly. Can you give me an example where it will definitely give a match? Is there a page somewhere that explains the regexp? Thanks again for the help.
I've made a mistake checking
The bug should be fixed now, thanks for reporting.