Is it possible to exclude commented lines (either individual, or groups) from searches in Xcode?
If so, how can this be done?
No, you cannot exclude comment lines from Xcode search.
You can use "search scopes" to search more efficiently in Xcode:
Reference by Apple docs:
The refined search navigator allows all current search options and settings to be seen at a glance. The options are easily manipulated by clicking directly on them in the search navigator. You can set search scopes, including selecting multiple folders in a project, and save them by name for easy re-use. The search results display wraps to allow you to see ore results easily and quickly.
Related
In Android Studio, I could search something in certain file type using the File mask as shown below. e.g. I could search on Kotlin (*.kt) files only
In Xcode, is it possible to do so as well? E.g. I would like to search only on the Swift file (*.swift). I don't see any filter as shown below, other than Ignore/Matching Case
Below the search field, there's an icon with three dots and a line above and below. In the default case, "In Workspace" is printed next to it.
Click this icon/text and a list of scopes is shown. Click the "+ New Scopeā¦".
You can define complex rules for your scope, but in your case you would just need one: select File extension in the attribute field, is equal to in the condition field and swift in the value field.
You can give your scope a name and save it if you need it often.
But there is also a second solution: just do your search. At the very bottom of the search panel you see a circle icon with three lines, similar to the "ground" symbol used in electrics (IMHO); next to it is a text field with placeholder "Filter". Enter *.swift here to filter the search results for hits in Swift files.
An alternative way and arguably quicker way to do it is to just type the extension in the filter section below the list of matches.
It keeps bothering me that I cannot manage the Keyword for "One-click search engines". The keyword could be displayed as follows in Firefox 38.0.1
Through the help link, I found ways to add/hide/remove search engines. However, it did not give any suggestion on how to modify the search engine.
The practical motivation for me to learn how to change the keyword is that:
Firefox cannot sync "search engines" across different installations. Only bookmarks and add-ons could be synced, so far.
I am using Vimperator with Firefox, where pressing o (or t) followed by TAB, then keyword for search engine, will enable the finishing a search query sequence. Example:
:open google happy 2015
will launch a Google result page searching for "happy 2015".
So, the syntax is: ":open keyword search-pattern".
Can anyone tell me how to change the "keyword" of a search engine? Or, give instruction on how to create a search engine of my own? (either on the web or locally loaded is fine.)
To edit the keyword for a search engine, double-click on the search engine's entry, or highlight it and press F2.
Solution in short, as kindly offered by Brandon Parmenter, goes as follows:
:bmark http://example.com/search#q=%s -keyword=example
Start of the longer/older answer
Though the solution inspired by the following link does not change the entries for search engine, it does offer a fully functional keyword feature.
wikiHow:How to Add a Custom Search Engine to Firefox's Search Bar
Unlike what has been suggested in the external link, no further add-on is needed. The following steps will complete the definition of a search-keyword:
Go to the page on which one can search. (Either google.com, or github.com, or whatever)
Right click the search box (through which one can type search inquiry) and select "Add a Keyword for this search"
Define the keyword and press enter
This is not defining a search engine, but rather a search-keyword. Keywords defined in this way is stored as a Bookmarks entry.
So far, it is yet unclear how would conflicting keywords between search-engines-keywords and one we just defined should be resolved. Hopefully, since Firefox is syncing Bookmarks items, search-keyword may be synced to other installations.
Since the question to modifying the search-engine-keyword is yet unsolved, I will not accept my own answer.
Additionally, if one would be interested to look into the Bookmark entry, %s is the "place-holder" in the "Location" field of such bookmark that will be subsituted by whatever one would like to search.
To programatically change the keyword of a search engine you can do it like this:
var allEngines = Services.search.getEngines()
for (var i=0; i<allEngines.length; i++) {
var currentEngine = allEngines[i];
console.log('name of current engine:', currentEngine.name);
var currentKeyword = currentEngine.alias; // is null if no current key word
}
To change the keyword programtically just set currentEngine.alias
Here is a variable viewer in browser console of allEngines you see its an array and each entry is like this, in this image here one entry is expanded:
If you know the name you can just get the engine by name with var currentEngine = Services.search.getEngineByName('Bing')
For some reason when somebody performs a search on my site the search results do not display underneath the search box, they appear on the far left of the screen.
Any ideas of what file this would be configured in?
Let me correct myself it's not the search results but the search suggestions
I can't offer a direct solution to your problem, but turning on template hints might point you in the right direction. In the Admin, go to System > Configuration, Select your store view from the scope drop down at the top left. Unless you're running multi-store, or have changed the name of the default store it'll be called "Default Store View". Then scroll down to "Developer" and open up the "Debug" section. Turn on both Template Path Hints" and "Add Block Names to Hints". This will add a div with a red border around each template in your layout and a heading which includes the name of the template. It will liklely completely screw up your page layout, but will show you which template generated every tag on the page and help you track down the issue.
The DeveloperToolbar extension makes turning this on/off quickly much easier, but I wouldn't recommend deploying it to a production site.
Alan Storm's indispensable CommerceBug is another tool which is very handly for tracking down front end issues. CommerdeBug can show you the layout handles and the aggregate layout XML used to generate the current page. Both of which are useful for determing why a specific block was (or wasn't) included.
So in case anybody else runs into this or wants to move where their search suggestions display it is in styles.css under .searchautocomplete.
"Change an item in the navigation? Sure I can do that in 15 minutes."
So I am trying to update the navigation on a site that I inherited only to find out that the previous programmer was a college student and was using this site as a project of some sort. Needless to say there are zero comments and the code calls function after function and I just can't follow the logic.
I am looking for a roundabout way to update the navigation. I tried using Dreamweaver to search through all of the files in the site and look for any files that contain the name of the page or the url (hoping to find some sort of included file). There was none. I did file text files that control the main navigation but none for the subnavigation.
There is no database.
If it helps here is the site. http://bit.ly/jbs639
And if you want to look at the interesting text file that is parsed to create the main navigation you can find it here: http://bit.ly/m3erna
Hmmm.... Interesting indeed. You have my sympathy.
One thing that I would look at... The file that gets parsed for the main navigation appears to be a simple delimited file. Sure, the delimiter is a rather unusual +++, but that choice means it avoids conflict with things like commas that might be desirable in the link text. It looks as if the last element indicates what type of resource is being accessed (file or directory, although I don't know what - if any - effect that has on the final output). It also appears that there are similar text files (in the framework/cfg/nav/ folder... which should probably not be generally accessible BTW) for the sub-menus. (E.g. the file stores.txt appears to contain the additional navigation items associated with the stores sub-navigation).
You don't mention which sub-menu you're trying to change. I suspect it is the "About TTO" one, which I can't find an entry for... but I'd look to see if there are any similar navigation text files in the /content/about/ folder.
Good Luck!
Of course it was as simple as a function that reads all of the files in the directory and the name of the file. I guess that in this case there was no shortcut.
This question is related to this one
Tricks to Google for desired page quickly
Firefox can do some magic and bring exactly the required pages. E.g.
java 6 SimpleDateFormat
ruby doc rexml
But some times it fails giving a usual google results:
ruby rexml
And some times I whould like it to go to different a location:
javascript array slice
I see
http://www.w3schools.com/jsref/jsref_slice_array.asp
but whould like it to be
https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Array/slice
How it works, btw? Where can I find all existing mappings, and how can I add/edit them? If they can be viewed/edited as text document, it whould be cool.
You can add YubNub as a search engine, (It's my default) and then your api docs of choice as a YubNub command if it doesn't exist already. I use it for Ruby all the time, e.g. rdoc String
You have several options:
Use the right-hand side search box where a search provider is available. MDC once had such a provider, but their search engine sucks big times. For example SO has such a provider. It's denoted by a shade of blue on the arrow right there.
Navigate to a particular search engine, right click the search field and "Add a Keyword for this Search". You may add "js" for example. In the future all you have to do is to type "js array slice" in the address bar and FF will bring you to the search results page of that particular search engine.
If there's no search engine on that site, use Google Custom Search, define engines as you like and then follow steps at point 2.
If you want to modify the built-in search engine for address bar, open a new tab, go to about:config and then search for "keyword.URL".
These aren't mappings, it's a Google Lucky search, isn't it?