mileszs / ack.vim

Vim plugin for the Perl module / CLI script 'ack'
Other
3.08k stars 396 forks source link

:Ack finds results in TAGS :( #157

Closed RyuKojiro closed 9 years ago

RyuKojiro commented 9 years ago

TAGS files are normally omitted from normal ack, something in ack.vim is telling ack to search more than its normal range of filetypes.

ches commented 9 years ago

I just tested my installed version of ack (2.14), and it does not exclude a TAGS file by default. Could you please:

  1. Doubly verify that your ack on the command line indeed ignores TAGS files. According to this thread it seems like ack probably considers it a text file, and the default behavior changed from v1 of ack to v2 such that it now always searches text files by default.
  2. Check whether you have an ackrc somewhere (~/.ackrc) that is actually causing them to be ignored (the rc file options still ought to work with ack.vim, but just to be sure I'd like to have as much info on your setup as I can).
  3. Try adding a line --ignore-file=is:TAGS to your ~/.ackrc and confirm this works as you expect with ack.vim.

If none of the above provides an acceptable answer for you, please also:

  1. Tell me exactly how you're invoking ack.vim (what command exactly).
  2. Check if you have any custom value set for g:ack_default_options (:echo g:ack_default_options in Vim, the default is -s -H --nocolor --nogroup --nocolumn).

Thanks.

ches commented 9 years ago

Closing with no response, if nothing above led to satisfactory solution please follow up with a comment here.

terryx commented 7 years ago

I was having the exact problem and adding --ignore-file=is:tags solved the problem since tags is not a directory but a regular file type

you can simply do a ls -l to check. First character - represent a regular file

petdance commented 7 years ago

Default ack does not ignore tags files. OP may have they excluded in an ackrc somewhere.

To see what settings are in use and from where, use ack --dump.

$ ack --dump
Defaults
========
  --ignore-directory=is:.bzr
  --ignore-directory=is:.cabal-sandbox
  --ignore-directory=is:.cdv
  --ignore-directory=is:.git
  --ignore-directory=is:.hg
  --ignore-directory=is:.metadata
  --ignore-directory=is:.pc
  --ignore-directory=is:.svn
  --ignore-directory=is:CMakeFiles
  --ignore-directory=is:CVS
  --ignore-directory=is:RCS
  --ignore-directory=is:SCCS
  --ignore-directory=is:_MTN
  --ignore-directory=is:_build
  --ignore-directory=is:_darcs
  --ignore-directory=is:_sgbak
  --ignore-directory=is:autom4te.cache
  --ignore-directory=is:blib
  --ignore-directory=is:cover_db
  --ignore-directory=is:node_modules
  --ignore-directory=is:~.dep
  --ignore-directory=is:~.dot
  --ignore-directory=is:~.nib
  --ignore-directory=is:~.plst
  --ignore-file=ext:bak
  --ignore-file=ext:gif,jpg,jpeg,png
  --ignore-file=ext:pdf
  --ignore-file=match:/[.-]min[.]js$/
  --ignore-file=match:/[.]css[.]map$/
  --ignore-file=match:/[.]css[.]min$/
  --ignore-file=match:/[.]js[.]map$/
  --ignore-file=match:/[.]js[.]min$/
  --ignore-file=match:/[.]min[.]css$/
  --ignore-file=match:/[._].*\.swp$/
  --ignore-file=match:/^#.+#$/
  --ignore-file=match:/core\.\d+$/
  --ignore-file=match:/~$/
  --type-add=actionscript:ext:as,mxml
  --type-add=ada:ext:ada,adb,ads
  --type-add=asm:ext:asm,s
  --type-add=asp:ext:asp
  --type-add=aspx:ext:master,ascx,asmx,aspx,svc
  --type-add=batch:ext:bat,cmd
  --type-add=cc:ext:c,h,xs
  --type-add=cfmx:ext:cfc,cfm,cfml
  --type-add=clojure:ext:clj,cljs,edn,cljc
  --type-add=cmake:ext:cmake
  --type-add=cmake:is:CMakeLists.txt
  --type-add=coffeescript:ext:coffee
  --type-add=cpp:ext:cpp,cc,cxx,m,hpp,hh,h,hxx
  --type-add=csharp:ext:cs
  --type-add=css:ext:css
  --type-add=dart:ext:dart
  --type-add=delphi:ext:pas,int,dfm,nfm,dof,dpk,dproj,groupproj,bdsgroup,bdsproj
  --type-add=elisp:ext:el
  --type-add=elixir:ext:ex,exs
  --type-add=erlang:ext:erl,hrl
  --type-add=fortran:ext:f,f77,f90,f95,f03,for,ftn,fpp
  --type-add=go:ext:go
  --type-add=groovy:ext:groovy,gtmpl,gpp,grunit,gradle
  --type-add=gsp:ext:gsp
  --type-add=haskell:ext:hs,lhs
  --type-add=hh:ext:h
  --type-add=hpp:ext:hpp,hh,h,hxx
  --type-add=html:ext:htm,html,xhtml
  --type-add=jade:ext:jade
  --type-add=java:ext:java,properties
  --type-add=js:ext:js
  --type-add=json:ext:json
  --type-add=jsp:ext:jsp,jspx,jspf,jhtm,jhtml
  --type-add=less:ext:less
  --type-add=lisp:ext:lisp,lsp
  --type-add=lua:ext:lua
  --type-add=lua:firstlinematch:/^#!.*\blua(jit)?/
  --type-add=make:ext:mak
  --type-add=make:ext:mk
  --type-add=make:is:Makefile
  --type-add=make:is:Makefile.Debug
  --type-add=make:is:Makefile.Release
  --type-add=make:is:makefile
  --type-add=matlab:ext:m
  --type-add=objc:ext:m,h
  --type-add=objcpp:ext:mm,h
  --type-add=ocaml:ext:ml,mli,mll,mly
  --type-add=parrot:ext:pir,pasm,pmc,ops,pod,pg,tg
  --type-add=perl:ext:pl,pm,pod,t,psgi
  --type-add=perl:firstlinematch:/^#!.*\bperl/
  --type-add=perltest:ext:t
  --type-add=php:ext:php,phpt,php3,php4,php5,phtml
  --type-add=php:firstlinematch:/^#!.*\bphp/
  --type-add=plone:ext:pt,cpt,metadata,cpy,py
  --type-add=python:ext:py
  --type-add=python:firstlinematch:/^#!.*\bpython/
  --type-add=rake:is:Rakefile
  --type-add=rr:ext:R
  --type-add=rst:ext:rst
  --type-add=ruby:ext:rb,rhtml,rjs,rxml,erb,rake,spec
  --type-add=ruby:firstlinematch:/^#!.*\bruby/
  --type-add=ruby:is:Rakefile
  --type-add=rust:ext:rs
  --type-add=sass:ext:sass,scss
  --type-add=scala:ext:scala
  --type-add=scheme:ext:scm,ss
  --type-add=shell:ext:sh,bash,csh,tcsh,ksh,zsh,fish
  --type-add=shell:firstlinematch:/^#!.*\b(?:ba|t?c|k|z|fi)?sh\b/
  --type-add=smalltalk:ext:st
  --type-add=smarty:ext:tpl
  --type-add=sql:ext:sql,ctl
  --type-add=stylus:ext:styl
  --type-add=swift:ext:swift
  --type-add=swift:firstlinematch:/^#!.*\bswift/
  --type-add=tcl:ext:tcl,itcl,itk
  --type-add=tex:ext:tex,cls,sty
  --type-add=tt:ext:tt,tt2,ttml
  --type-add=vb:ext:bas,cls,frm,ctl,vb,resx
  --type-add=verilog:ext:v,vh,sv
  --type-add=vhdl:ext:vhd,vhdl
  --type-add=vim:ext:vim
  --type-add=xml:ext:xml,dtd,xsd,xsl,xslt,ent,wsdl
  --type-add=xml:firstlinematch:/<[?]xml/
  --type-add=yaml:ext:yaml,yml
/Users/alester/.ackrc
=====================
  --ignore-dir=nytprof
  --smart-case
  --sort-files
  --type-add=md=.md
  --type-set=md=.mkd

The last part is from my local .ackrc file, and if there was a project-level ackrc, that would show up too.

worldmind commented 5 years ago

Related ack issue.