Ivan Sterkhov
Ivan Sterkhov

Reputation: 63

How to skip searching directory by mask in Far Manager

I have Git repository with nested submodules. All of them have .git folders. I would like to search files with ignoring these git folders, because it takes much more time than without them.

I have tried to use filters (Alt+F7), but it doesn't work or I do it wrong.

Upvotes: 6

Views: 1342

Answers (1)

Andrei Damian-Fekete
Andrei Damian-Fekete

Reputation: 1980

I had the same question ( https://forum.farmanager.com/viewtopic.php?p=150995 ).

Step by step solution:

  • Enable [x] Use filter

   ╔══════════════════════════════ Find file ═══════════════════════════════╗
   ║ A file mask or several file masks:                                     ║
   ║ *.*                                                                   ↓║
   ╟────────────────────────────────────────────────────────────────────────╢
   ║ Containing text:                                                       ║
   ║                                                                       ↓║
   ║ Using code page:                                                       ║
   ║ Automatic detection                                                   ↓║
   ╟───────────────────────────────────┬────────────────────────────────────╢
   ║ [ ] Case sensitive                │ [ ] Search in archives             ║
   ║ [ ] Whole words                   │ [x] Search for folders             ║
   ║ [ ] Search for hex                │ [x] Search in symbolic links       ║
   ║ [ ] Not containing                │ [ ] Search in alternate streams    ║
   ╟───────────────────────────────────┴────────────────────────────────────╢
   ║ Select search area:                                                    ║
   ║ From the current folder         ↓   [x] Use filter                     ║
   ╟────────────────────────────────────────────────────────────────────────╢
   ║         { Find } [ Drive ] [ Filter ] [ Advanced ] [ Cancel ]          ║
   ╚════════════════════════════════════════════════════════════════════════╝
  • Add a filter (Select Filter, press Insert)
    • Give the filter a name (e.g. Git folder)
    • As mask set .git
    • For attributes set [x] Directory

                         ╔════════ Attributes ════════╗
                         ║ [?] Read only              ║
   ╔══════════════════   ║ [?] Archive                ║   ══════════════════╗
   ║ A file mask or se   ║ [?] Hidden                 ║                     ║
                         ║ [?] System                 ║
   ╔══════════════════   ║ [?] Compressed             ║   ══════════════════╗
   ║ Name: Git folder    ║ [?] Encrypted              ║                    ↓║
   ╟──────────────────   ║ [?] Not indexed            ║   ──────────────────╢
   ║ [x] Mask: .git      ║ [x] Directory              ║                    ↓║
   ╟──────────────────   ║ [?] Sparse                 ║   ──────────────────╢
   ║ [ ] Size:           ║ [?] Temporary              ║           [ Blank ] ║
   ║   >=                ║ [?] Offline                ║   00:00:00,000+0000 ║
   ║   <=                ║ [?] Reparse point          ║   00:00:00,000+0000 ║
   ╟──────────────────   ║ [?] Virtual                ║   ──────────────────╢
   ║ [x] Attributes [    ║ [?] Integrity stream       ║    one hardlink     ║
   ╟──────────────────   ║ [?] No scrub data          ║   ──────────────────╢
   ║                     ║ [?] Pinned                 ║                     ║
   ╚══════════════════   ║ [?] Unpinned               ║   ══════════════════╝
                         ║ [?] Recall on open         ║
   ║         { Find }    ║ [?] Recall on data access  ║   Cancel ]          ║
   ╚══════════════════   ║ [?] Strictly sequential    ║   ══════════════════╝
                         ╟────────────────────────────╢
                         ║     { OK } [ Cancel ]      ║
                         ╚════════════════════════════╝
  • Click { OK } to create the filter
  • Make sure the filter is selected and press - to use the filter to exclude files/directories that match the filter. A - appears before the filter name. (F1 if you need extra info)

  ╔═══════════════════════ Filters menu ═══════════════════════╗
  ║- Git folder            │ +D          ... │ .git            ║
  ╟────────────────────────┼─────────────────┼─────────────────╢
  ║  0. Folders            │ +D          ... │                 ║
  ╚═ +,-,Space,I,X,BS,Shift+BS,Ins,Del,F4,F5,Ctrl+Up,Ctrl+Dn ══╝
  • Test the new filter
  • Make sure to save the configuration (Shift+F9)

Yegor's filters from the linked post:

╔═══════════════════════════════════ Filters menu ════════════════════════════════════╗
║- Visual Studio Build F │ ..............D+.............. ... │ obj,bin               ║
║  Temporary Files       │ ..............D-.............. ... │ <bak>                 ║
║- NuGet and NodeJs Pack │ ..............D+.............. ... │ packages,node_modules ║
║- Source Repositories   │ ..............D+.............. ... │ .svn,.hg,.git         ║
╟────────────────────────┼────────────────────────────────────┼───────────────────────╢
║  0. Folders            │ ..............D+.............. ... │                       ║
║  1. Panel file type    │ ..............D-.............. ... │ *.                    ║
║  2. Panel file type    │ ..............D-.............. ... │ *.7z                  ║
║  3. Panel file type    │ ..............D-.............. ... │ *.jpg                 ║
║  4. Panel file type    │ ..............D-.............. ... │ *.mp4                 ║
║  5. Panel file type    │ ..............D-.............. ... │ *.pdf                 ║
║  6. Panel file type    │ ..............D-.............. ... │ *.xlsx                ║
║  7. Panel file type    │ ..............D-.............. ... │ *.zip                 ║
╚══════════════ +,-,Space,I,X,BS,Shift+BS,Ins,Del,F4,F5,Ctrl+Up,Ctrl+Dn ══════════════╝

Upvotes: 10

Related Questions