Notepad++ find in files filter EXCLUDE

前端 未结 8 1356
时光取名叫无心
时光取名叫无心 2021-02-03 16:53

I\'m looking for a way to get n++\'s find in files dialog to exclude certain files...

the only reference I\'ve found so far is this http://sourceforge.net/project/showno

相关标签:
8条回答
  • 2021-02-03 17:07

    I got a tip from another forum that helped me solve this. Mark the folders you want to exclude as 'hidden'. By default the 'Find in Files' in N++ excludes hidden directories. You can then revert the hidden directories when you're done.

    A little tedious, but better than nothing.

    0 讨论(0)
  • 2021-02-03 17:10

    There may be a more elegant way, but you could use PowerShell to get all of the extensions in a folder, and then just remove the ones you don't want. This example gets all of the extensions in the "C:\Program Files\Internet Explorer" folder.

    NB: don't forget to surround (Get-ChildItem ... -join ";*" with parentheses.

    "*" + ((Get-ChildItem -File -recurse "C:\Users\SomeUser\Documents\Visual Studio 2013\Projects\WindowsService1" | Where {$_.Extension -ne ""}| Select-Object Extension -unique | Sort-Object Extension | Get-Unique -asString  | Select -ExpandProperty Extension | % { $_.ToLower() } | Get-Unique) -join ";*")
    

    This returns:

    *.cache;*.config;*.cs;*.csproj;*.exe;*.jmconfig;*.manifest;*.settings;*.sln;*.txt

    Then just remove what you don't want.

    0 讨论(0)
  • 2021-02-03 17:11

    not that its a GOOD answer, but, what I've found that works is this

    *.sql ; *.asp ; *.html ; *.as ; *.mxml
    

    Its definitely not an 'exclude' list, but, by including all the types I need to look at, I get the same result. In my case, I've only got those handfuls of types that I look for often. If your set was wider, this would become even less useful.

    0 讨论(0)
  • 2021-02-03 17:16

    The solution from https://notepad-plus-plus.org/community/topic/10653/exclude-directories-from-the-search/5 is to temporarily set those folders you want to exclude to be 'hidden' folders (hiding just the top level sub-dir is sufficient), and this then stops Notepad++ descending into that sub-directory.

    Worked for me just now!

    0 讨论(0)
  • 2021-02-03 17:26

    Note, as of December 5th, 2019, Notepad++ 7.8.2 now supports exclude filters.

    For example to exclude exe, zip and jar files, your 'find in files' filter will look like this;

    *.* !*.exe !*.zip !*.jar

    Relevant code change here.

    0 讨论(0)
  • 2021-02-03 17:28

    Perhaps the real answer is don't use NP++ for this. Have you looked at http://www.wingrep.com/features.htm or

    Edit: I use http://stefanstools.sourceforge.net/grepWin.html these days

    0 讨论(0)
提交回复
热议问题