سؤال

How do I search a text in all the projects in sublime text 2 with only specified extension. For example 'error message' only in files with .js extension

هل كانت مفيدة؟

المحلول 2

search for a word or regex in all files:

CMD+Shift+F on Macs to search all files Specify *.js in combination with ,-*/tests/*, -*/build/* or similar places you don't want to look


jump to a function in your codebase: quickly type the function's name or put your cursor on it, then press CMD+Optn+Down to show a small list of possibilities, then use up/down and letters to deliminate, optionally press ESC to leave the header box, or ENTER to enter the file at the function's appearance

jump to a function in the current file: use CMD+R and deliminate, using ESC to cancel

jump to a file: CMD+P or CMD+T again using ESC or ENTER with delimiters

quickly highlight all occurences of a word:CMD+D or use CMD+G / CMD+SHIFT+G to skip around

fold code for quick file overview: use CMD+A followed by CMD+KJ and CMD+K2 for example


fold code and scroll and use the aforementioned CMD+OPTN+DOWN to get a good understanding of related files. Predawn Skin looks great with neon green functions :)

Install that with Package Control using CMD+SHIFT+P

Which reminds me that you can set your file syntax using CMD+SHIFT+P "Set Syntax: JavaScript"

نصائح أخرى

Use Ctrl Shift F which will bring up the global search dialog. You can specify options from there. enter image description here

Edit: Specify '*.js' in the where. See Sublime text 2 find in folder with file extension

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top