redguardtoo / counsel-etags

Fast, energy-saving, and powerful code navigation solution
174 stars 15 forks source link

调用 counsel-etags-grep 时可以忽略tag文件 #90

Closed heheda123123 closed 1 year ago

heheda123123 commented 1 year ago

前面在另一个issue https://github.com/redguardtoo/counsel-etags/issues/89 提到了有同时使用counsel-etags-grepcounsel-etags-list-tag的需求 我现在这样配置的

    (evil-define-key '(normal visual motion) 'global (kbd "<leader>tt") 'counsel-etags-list-tag)
    (evil-define-key '(normal visual motion) 'global (kbd "<leader>tg") 'counsel-etags-scan-code)
    (evil-define-key '(normal visual motion) 'global (kbd "<leader>tq") 'counsel-etags-grep)

但是如果已经生成了tag,使用counsel-etags-grep的时候最前面的结果往往是从tag从找到的,希望可以默认忽略tag中的内容

redguardtoo commented 1 year ago

See counsel-etags-grep-extra-arguments

heheda123123 commented 1 year ago

这样配置后可以了

(use-package counsel-etags
  :ensure t
  :init (setq counsel-etags-grep-extra-arguments "-g !\"TAGS\"")
  :commands (counsel-etags-list-tag counsel-etags-scan-code counsel-etags-grep)
  )