GithubHelp home page GithubHelp logo

alfred-grep's People

Contributors

ichitaro avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

alfred-grep's Issues

Can it be integrated with the default file search?

Hi ichitaro,

I searched for a while for the regex search workflow and found your repo here. It is quite marvelous.

I would like to know if it is possible to integrate "alfred-grep" into the default search of Alfred?
For example, normally I type "screenshot" in the search box and Alfred will list the files whose names contain "screenshot", what I imagine is that I type "re /screenshot.*.png$/" in the search box and Alfred will list all the files according to the regex, and I can do anything like open it with corresponding apps ( Preview.app in this case) without editing it in the text editor, or preview it in Alfred.

Many thanks.

Where is settings.json?

Hello

Thanks for a useful workflow. However, I do not use Sublime Text, but I cannot find the file settings.json that you say I can edit to use another editor.

Many thanks.

Jeremy

how to exclude directories?

This cool!

But Im having trouble excluding directories for example node_modules.. I have tried adding
"hidden_query": "--exclude-dir='/node_modules/'", in settings.json but it doesn't appear to work

{
	// Make sure the version matches
	"alfred_app_name": "Alfred 3",

	"actions": {
		// Determines what action is triggered when a directory item is selected
		"dir_action": ":grep",

		// Determines what action is triggered when a file item is selected
		"file_action": ":open",

		// Determines what action is triggered when a line item is selected
		"line_action": ":open"

		/* Valid values are:
		":grep" -> sets the search path to selected folder and performs grep
		":open" -> opens selected file using the default application for that file
		":reveal_in_finder" -> selects in the Finder instead of opening
		":browse_folder_in_alfred" -> browses selected folder in Alfred's File Navigation
		":subl" -> opens with Sublime Text
		":mate" -> opens with TextMate
		":mvim" -> opens with MacVim
		":emacs" -> opens with Emacs For Mac OS X

		Custom commands are also valid. Some examples follow

		// Reveal folder in Finder
		"dir_action": ["open", "-R", "%{file}"],

		// Open with Sublime Text
		"file_action": ["/Applications/Sublime Text.app/Contents/SharedSupport/bin/subl", "%{file}"],
		"line_action": ["/Applications/Sublime Text.app/Contents/SharedSupport/bin/subl", "%{file}:%{line}:%{column}"],

		// Open with TextMate
		"file_action": ["open", "txmt://open?url=%{escaped_url}"],
		"line_action": ["open", "txmt://open?url=%{escaped_url}&line=%{line}&column=%{column_as_bytesize}"],

		Valid placeholders are:
		%{file}
		%{line}
		%{column}
		%{column_as_bytesize}
		%{column_for_emacs}
		%{url}
		%{escaped_url}
		*/
	},

	// Set to true to make last selected item the top of the list
	"restore_cursor": true,

	// Where the workflow searches for files in
	"search_paths": [],

	// Default target flags of the pattern
	"default_targets": "pg",

	// Prefix for parsing the search options
	"opt_prefix": "--",

	// Prefix for parsing the pattern flags
	"mod_prefix": "-",

	// Additional conditions which are applied implicitly
	// For example, if you always want to search for the files with a specific extension, set as follows:
	// "hidden_query": "txt -x",
	// "hidden_query": "--exclude-dir='*/node_modules/*' --exclude-dir='dist/*'", 
	"hidden_query": "--exclude-dir='*/node_modules/*'",

	// Set to true to search subdirectories recursively
	"recursive": true,

	// Set to ":file" to select only files,
	// ":directory" to select only directories,
	// and ":entry" to select any type of files
	"file_type": ":entry",

	// Set to ":visible" to select only visible files,
	// ":hidden" to select only hidden files,
	// and ":all" to select all files
	"dotmatch": ":visible",

	// Set to true to show all lines of matching files,
	// false to show only matching lines,
	// and ":auto" to show all lines only when the search path is a single file
	"show_all_lines": ":auto",

	// Set to ":name" to sort by file name,
	// ":extname" to sort by file extension,
	// ":mtime" to sort by modification time,
	// and ":size" to sort by file size
	"sort_by": ":mtime",

	// Set to true to show direct child files of the search paths to the head of the results
	"group_direct_children": true,

	// Determines what text is shown for each matching file
	// Valid value is a Array of String which is one of the list below:
	// ":absolute_pathname",
	// ":home_relative_pathname",
	// ":pathname",
	// ":filename",
	// ":basename",
	// ":tags",
	// ":date_modified",
	// ":size"
	"file_title": [":filename"],
	"file_subtitle": null,
	"file_text_copy": null,
	"file_text_largetype": [":home_relative_pathname"],

	// Determines what text is shown for each matching line
	// Valid value is a Array of String which is one of the list below:
	// ":absolute_pathname",
	// ":home_relative_pathname",
	// ":pathname",
	// ":filename",
	// ":basename",
	// ":tags",
	// ":date_modified",
	// ":size",
	// ":trimmed_contents",
	// ":contents_without_tags",
	// ":contents",
	// ":line_number"
	"line_title": [":trimmed_contents"],
	"line_subtitle": [":pathname", ":line_number"],
	"line_text_copy": [":trimmed_contents"],
	"line_text_largetype": [":trimmed_contents"],

	// Icon of the file item
	"file_icon": null,

	// Icon of the line item
	"line_icon": null,

	// Set to ":file" to enable new file creation item
	// ":note" to enable new note creation item
	// and false to disable these features
	/* "enable_file_creation": ":file", */
	"enable_file_creation": "false",

	// Default tags for a new note
	"file_creation_args": [],

	// Icon of the file creation item
	"file_creation_icon": null,

	// Set to true to show the file creation item at the top of the list
	"show_file_creation_item_first": false,

	// Set to true to use absolute or home relative path in file creation
	"allow_absolute_path_in_file_creation": false,

	// Set to true to show the parent directory item
	"show_parent_dir": true,

	// Set to true to cache search results in "Find Next"
	"cache_search_results": false,

	// Set to true to enable wrap around in "Find Next"
	"wrap": true
}

Breaks in Alfred 4

It breaks in Alfred4 with error

STDERR: grep[Run Script] 277:278: syntax error: Expected “given”, “with”, “without”, other parameter name, etc. but found “(”. (-2741)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.