[sublimetext2] 숭고한 텍스트 2에서 파일 검색 범위 제한

Sublime Text에서는 종종 Cmd+ P/ Ctrl+ P를 사용 하여 파일을 검색하고 이동합니다.

종종 .scssc 또는 / tmp 폴더에있는 것들과 같은 임시 또는 캐시 된 파일을 선택합니다.

검색 결과에 표시되는 내용을 제한 할 수있는 방법이 있습니까?



답변

~/Library/Application Support/Sublime Text 2/Packages/User/Preferences.sublime-settings파일 에서 이것을 추가하고 편집 하십시오.

// These files will still show up in the side bar, but won't be included in
// Goto Anything or Find in Files
"binary_file_patterns": ["*.jpg", "*.jpeg", "*.png", "*.gif", "*.ttf", "*.tga", "*.dds", "*.ico", "*.eot", "*.pdf", "*.swf", "*.jar", "*.zip"],

"folder_exclude_patterns": [".svn", ".git", ".hg", "CVS"],


답변

숭고한 텍스트 3의 경우 : 사이드 바에서 제거하지 않고 검색 및 이동 결과에서 제외하려면 "binary_file_patterns"설정을 변경하십시오 . 파일 및 폴더와 일치합니다.

예를 들어 GoTo 색인에서 “dist”및 “node_modules”의 파일을 제외하려면 사용자 설정 파일에 추가하십시오.

"binary_file_patterns": ["dist/*", "node_modules/*", "*.jpg", "*.jpeg", "*.png", "*.gif", "*.ttf", "*.tga", "*.dds", "*.ico", "*.eot", "*.pdf", "*.swf", "*.jar", "*.zip"]

프로젝트별로 이것을 구현하는 방법을 알 수 없습니다 :(. 대부분의 설정은 project.sublime-project파일 로 이동할 수 있습니다 . “프로젝트> 다른 이름으로 프로젝트 저장”, 프로젝트의 루트를 저장 "settings": {...}하고 json에 추가 하십시오. 생성 된 파일 ( 소스 에서 ST3 빌드 3095에서 작동)이지만 “binary_file_patterns”에서는 작동하지 않습니다.


답변

다음 과 같이 프로젝트 설정수정하여 프로젝트 에서 특정 파일 패턴 및 폴더를 제외 할 수 있습니다 .

{
    "folders":
    [
        {
            "path": "src",
            "folder_exclude_patterns": ["backup"]
        },
        {
            "path": "docs",
            "file_exclude_patterns": ["*.css"]
        }
    ]
}

이것은 프로젝트 문서에 설명되어 있습니다 .


답변

필드 의 -*/foldername/*구문 을 사용하여 모두 찾기 창에서 폴더를 제외 할 수도 있습니다 Where. 예 :

-*/node_modules/*

http://www.sublimetext.com/forum/viewtopic.php?f=2&t=3847&start=10


답변

숭고한 텍스트 3 (BLD 3059 Windows)에서 “폴더 찾기”기능을 특정 파일 / 폴더 및 단일 파일로 제한해야했습니다.

다음은 나를 위해 작동합니다.

/C/path/2/project/folder,*.c,*.h,-*/path/not/to/look/in,/C/path/2/specific/file/file.h

절대 경로없이 더 나아가서 위의 다음 기호 위치를 결합 할 수 있습니다

<open folders>, <open files>, <current file>

<open folders>,*.c,*.h,-*/never_this_in_folder/*,<open files>


답변

SublimeText 2의 경우이 기능이 훌륭합니다.

당신이 선택하면 파일에서 찾기 에서 폴더 제외 지정할 경우 입력;

-bower_components/**/*, -dist/**/*, -node_modules/**/*, -tmp/**/*

따라서 검색하지 않으려는 폴더 의 하이픈 과 제외 패턴이 뒤 따릅니다.

-folder1/**/*, -folder2/**/*

검색 범위가 제한됩니다.

이것 좀 봐


답변

나는이 답변 중 일부가 Sublime Text의 몇 가지 다른 버전에 걸쳐 있다고 생각합니다. 여기에서 Mac의 Sublime Text 3 로이 작업을 수행하는 방법이 있습니다.

  1. 열기 사용자 – 숭고한 텍스트> 환경 설정> 설정 메뉴를
  2. 편집 file_exclude_patternsfolder_exclude_patterns찾기 도구 에서 파일 및 / 또는 폴더를 무시 값을

"file_exclude_patterns":
[
    ".svn",
    ".git",
    ".hg",
    ".md",
    ".txt",
    ".DS_Store"
],
"folder_exclude_patterns":
[
    "node_modules",
    "bower_components",
    ".svn",
    ".git",
    ".hg",
    "CVS",
    "deprecated",
    "cache"
],

스크린 샷

여기에 이미지 설명을 입력하십시오