Lost syntax highlighting in Textmate - syntax-highlighting

Using Textmate, I have somehow managed to turn off syntax highlighting for php files. After much trial and error, I have worked out that this happened when I accidentally hit SHIFT-CTRL-OPTION-D (I'm on a Mac, btw). I've looked everywhere and tried many key combinations, but I cannot figure out how to re-enable the nice syntax highlighting. Please help me, Textmate gurus, you're my only hope!

The key sequence SHIFT-CTRL-OPTION-D corresponds to an option in the language menu down at the bottom left of the Textmate window. The language menu tells Textmate what language to consider the file so it can determine the proper syntax highlighting. The key sequence I hit caused Textmate to highlight my text as though it were a diff window. Switched it back to PHP and it works great now.

I don't have enough rep to add a comment, so I'll expand on the accepted answer here.
SHIFT+CONTROL+OPTION+<LETTER> will display a menu showing all grammars beginning with <LETTER>. So if you want PHP back, just hit SHIFT+CONTRL+OPTION+P, and then a list of languages beginning with 'P' will pop up. You can choose one from the list by pressing the corresponding number (on my computer, it's 2).

Related

Turn off Visual Studio Find Default Selection

When I Ctrl+Shift+F in VS2010, it puts whatever is near my cursor in the "Find what:" box - this is very irritating and never what I want.
Is there any way to make it default instead to the last thing I searched for?
Tools -> Options -> Environment -> Find and Replace -> Automatically populate Find What with text from the editor
If you uncheck this option it will default to the last thing you searched for.
an nice. Glad i found this...
two work arounds i figured out... if you do want to search in selected text only sometimes but not all the time...
Mouse: Click back on the page and ctrl+A (its faster than having to grab the mouse and clicking the tiny drop down.)
Keyboard only: Well you cant technically do this, with any one command from http://visualstudioshortcuts.com/14/ but you can do this.
while find is active, hit
alt+F6
to get out of find and then hit
esc
to activate the document then
ctrl+A
to search the whole document
I am glad to find how to turn this off, but i am used to this keyboard commands now. So maybe i will leave it on.
if you don't learn to use the escape key in VS, especially for intellisense you are going to seriously drive yourself crazy.

Xcode 4.2.1 Code Folding

I've got a really frustrating issue in Xcode 4.2.1 on OS X Lion, where the code folding doesn't seem to work, or at least hardly every with no obvious reason.
The default keyboard shortcuts are supposed to be:
Fold Methods/Functions ⇧⌘⌥⌘← shift+option+command+left
Unfold Methods/Functions ⇧⌘⌥⌘→ shift+option+command+right
.. but I just get the Homer ('Doh'), error sound all the times I try it.
I always make sure I have the correct pane selected (before anyone asks ;o), and have also tried the following, with no luck:
- With & without Assistant editor enabled
- In a total separate editing window
- By selecting 'Code Folding >> Fold Methods & functions' from the Editor menu
- Changing the keyboard shortcut (Even tho no conflict was showing)
The only clue I have, and I'm not sure if it's related, is that whenever I press the 'option' key in the editing view my cursor changes to a + (or crosshair) - It only does this in the editing views of Xcode, however I don't think this is the issue as if I change the shortcut to not use the 'option' key, it still doesn't work.
Anyone got any ideas, as it's driving me barmy & my searches haven't come up with anything??
OK, I finally resolved to totally remove Xcode, clear out prefs and then re-install.
This seems to have fixed the issue (So far at least)
I've found that Xcode 3 won't fold unless syntax highlighting is turned on. I don't like syntax highlighting, so for lack of a better alternative I use 'View->Syntax Coloring->Simple Coloring', which only highlights comments and numbers.

Xcode find in document stuck in case-sensitive

When in Xcode editing code for my objective C files, I often press Command-F to bring up the little Find-In-Document banner across the top. Sometimes this gets stuck in case-sensitive search, and when it does that it also won't loop through the entire document and sometimes won't even display the selected found string.
I can't find any options to turn off the case sensitivity, and I never intentionally turned it on. I've restarted xcode several times hoping that would be it but it's changed nothing.
Slightly off-topic, but this was the best place I could think of to ask this question. Thanks for any response!
EDIT: I've also tried restarting the computer. Still no dice. Also this happens on any project I open in xcode and is not specific to one project.
Anna's comment is the correct answer: When you press Cmd-F, clicking on the little magnifying glass next to the search input brings up a menu where you can check/uncheck Ignore Case.
You can set parameters for search by clicking on magnifier placed in left-side of search-bar.
There is provision to select/de-select "Match Case" i.e. case-sensitive search on pop-up shown.
Below is screenshot for the same.

# shows solution navigator instead of typing an #

I can't seem to find a question on this, but it might be because I'm unable to find a good way to search for it...
I recently updated my installation of Visual Studio 2010 Pro Power Tools, and now every time I type # in a code window, I get a search window of some sort opened instead of the # symbol in my code. I can't find the key setting that triggers this, and it's beginning to be a real problem.
I'm on a Swedish keyboard, so to get # I press Alt Gr+2. I've gone through all the settings under Tools/Options/Keyboard that starts with "View.", but found nothing.
Can anybody help me delete this keyboard mapping?
Update: I just realized that the key mapping Alt Gr+2 is equivalent to Ctrl+Alt+2. But I still can't find what it's mapped to...
I found the problem in the comment thread on the VS team blog post on the Solution Navigator - it turns out this problem is built-in into the extension, and they're working on fixing it for the next release. (Basically, they're binding stuff to Ctrl+2 and 2, but VS also takes the Ctrl+Alt equivalents, which then are interpreted as Alt Gr...)
For now, disabling Solution Navigator solves the problem (but, obviously, makes Solution Navigator unavailable...), but hopefully there will be a fix out pretty soon.

How can you go forward/backward at the file level with Xcode 3.2?

Xcode 3.2 has implemented cursor-level history for the "Go Forward", "Go Backward" commands. Previously these worked at the file level, so you could navigate back and forth through recent files you've been editing. Now they navigate at a more fine-grained level, through the places within files where you have been editing.
The downside to this is if you navigate backwards through the files and make a minor edit, all of your forward history is wiped out, whereas in the past it used to be easy to return to the file you were working on. It also means issuing a lot more commands if you just want to move through files, since you have to skip through all the edit points within each file.
I can't find anything in the release notes or documentation about this new behavior, so does anyone know if it's possible to get the old 'go back/forward by file' commands in 3.2? If not, does anyone have any tips on other ways of easily navigating recent files in Xcode?
Hold down the option key while you click the forward/backward arrows at the top of the code view, this will use the Xcode 3.0 behavior and go back a file at a time.
I had the same question as well and and Rob's answer on holding Option while clicking the forward/backward arrows works well.
I needed a keyboard shortcut though and I've found that Shift-Option-Cmd-left/right works.
From the comments on this blog entry:
Hold down the Option key to get the old file-based Go Forward/Go Back behavior. We rarely change established behavior like this when adding new options, but in this case, the majority of users considered file-level navigation Broken and location-based navigation Correct, based on their experience in browsers and other IDEs. We chose to give what more people considered the “obvious” behavior the pride of place on the keyboard shortcut, but the old way is still there.
-- Chris Espinosa
But like you guys have said, after every keyboard edit, the forward file history is lost. This is incredibly frustrating to me, as this is a feature I have heavily relied on for years, which is now broken. Is there still no fix?
There are Next File and Previous File commands, however their history is also wiped out after an edit. That seems like a bug to me.
This is plain stupid! What's the reason for suddenly change this ? Shift-Option-Cmd-left/right... great, more stupid shortcuts from Apple. I guess I soon have to use Shift-Option-Cmd-Left-Alt-Enter-N for something I use all the time. Can't they just implement a recent file list on ctrl-tab or something, like the Cmd-tab and the app switcher. Why would I want to grab for the mouse when I'm coding ? Still I have to use it lots in Xcode.
Sorry for my rant :)

Resources