Textmate 2 - Delete a Macro - textmate

I was not able to find a way to delete a custom macro that I just created using the latest Textmate version. Surely this should be fairly simple task?
The only option in the Edit Bundle section is the enable/disable the macro.

Select the macro in the bundle, and either use the hotkey (Command + Delete) or the menu;
If for some reason that doesn't work, the macros themselves are stored in
~/Library/Application Support/Avian/Bundles/[BUNDLE NAME].tmBundle/Commands
or
~/Library/Application Support/Textmate/Bundles/[BUNDLE NAME].tmBundle/Commands
And you can just delete the files from there.

Related

Location of JetBrains IDEs default keyboard shortcuts

I wanted to write a tool for synchronizing keyboard shortcuts between JetBrains IDEs but I cannot find the default ones. When I customize them in the IDE, a new folder keymaps is created under .tool\config which contains only the customized assignment.
However, I need to first compare the original schemes to find differences and to merge them eventually. But I cannot find them anywhere.
I looked for various *.xml files with the content like shift or ctrl or keyboard-shortcut, no results.
Do you know where they are hidden?
Check IDE_INSTALL_FOLDER/lib/resources.jar file (it's an ordinary ZIP archive).
All bundled keymaps will be located in keymaps folder inside that archive.

Sublime Text: Switching files in different folders

I have opened a c++ project in Sublime Text and I am working on windows environment.
I need to switch among .cpp and .h files. There is a command Alt+O which can switch these files if they are in the same folder. but my files are placed as follow:
.h in myfolder/include/subfolder/
.cpp in myfolder/src/subfolder/
The file names are same, they just differ in extensions. Right now I use Ctrl+p, but I want single command to do that.
Thanks in Advance
It might not be exactly what you want but here is a workaround to accomplish what you ask for: if you download and install the CTags plugin for Sublime, you will be able to:
Build tags with Ctrl+t, Ctrl+r
Ctrl+t, Ctrl+t will make you jump to definition (from header to source) of what is under your cursor
Ctrl+t Ctrl+b to "jump back" (to header)
[EDIT]
It seems someone has implemented a plugin to accomplish what you want (didn't test it though, note that the README says that it will look for matches outside of the current folder but only in already opened files)
FWIW, the original feature is in Packages/Default/switch_file.py (also you might want to have a look to Vim equivalent code)
Switch File Deluxe does exactly what you want. It overrides Alt+O.

Coda syntax highlighting for Silverstripe

I've just moved onto a new machine. On my old work horse, I had Silverstripe template (.ss) files following HTML syntax highlighting in Coda. I can't for the life of me remember how I turned this on (I remember it was something I did myself though). Google has turned up no results.
Any suggestions?
UPDATE: The real way
In Coda, open Preferences, go to Editor, at the bottom, add a Custom Syntax Mode.
As per this guide:
Right click on Coda.app in /Applications and select Show Package Contents
Navigate to Contents/Resources/Modes/HTML.mode/Contents/Resources
Open ModeSettings.xml
Add <extension>ss</extension> to the list of extensions.
Or, make your mode (eg, SilverStripe.mode) and put it in ~/Library/Application Support/Coda/Modes
Or, copy HTML.mode to ~/Library/Application Support/Coda/Modes and then modify it, to preserve the original.
(For system-wide changes without modifying the application bundle, create the directory /Library/Application Support/Coda/Modes and put .mode directories there.)

Xcode's theme for TextMate

I'd like the default theme of Xcode but for TextMate.
Is there anyone who knows where I could find this?
I just created it, check it out.
You could always just make it yourself, duplicate one of the TextMate themes and then apply the font styles from Xcode to the textmate theme. It won't take too long and will let you fix the bits that you think are broken!
Since I couldn't get Paolino or El's themes to install in TextMate 2.0, I've created a new Xcode Default theme from scratch here:
https://github.com/jrodatus/xcodedefault-tmtheme-ng
Installation
Theme extension must be ".tmTheme" (exactly)
Double-click to install in TextMate, select "Themes" bundle when prompted
View->Theme->Xcode Default
View->Font->Show Fonts...: Menlo Regular 10.3 or 10.5
TextMate->Preferences->Projects->Open files on single click
Show file browser on: Left side
Extra
To change the selection color from orange, change the hex color code after the "selection" key in the tmTheme file.
To suppress tab creation when clicking on a file in the browser:
Method 1) Hold the Option key every time you click on a file.
Method 2) Clone the TextMate repository and edit textmate/Frameworks/DocumentWindow/src/DocumentWindowController.mm, replacing the occurences of OakIsAlternateKeyOrMouseEvent() with YES, and rebuild.
Method 3) If you don't want to install the build prerequisites, you can patch the binary directly. See GitHub README.

A way to automatically organize #imports in Xcode

I love the "Organize Imports" command in Eclipse to implicitly add and remove classes imported into a source file (as in Java or ActionScript).
Is there a command in Xcode to update the #import directives at the top of.m Objective-C files based on the classes referenced within the file?
You can do this by creating an Automator action and use that in Xcode as well as everywhere in Mac OS X. To do that, do the following:
Start Automator -> New
Choose "Quick Action" (or "Service" on older MacOS/Automator versions)
add a "run shell script" action
use sort | uniq as the script and check the "output replaces selected text" checkbox
save and give it a name (e.g. "sort & unique")
check "Output replaces selected text"
After you saved it, you can just select your imports in Xcode, right click and choose your "sort & unique" action to organize your imports.
This is not as good as the organize import actions in Eclipse or IntelliJ, because it doesn't removes unused stuff etc. but it's better than nothing.
PS: Got that from WWDC 2012 Sessions - Session 402 Working Effeciently with Xcode (starting at 6:15)
EDIT
I started using AppCode, the Objective-C IDE from JetBrains, and it has features like "organise imports". You should check it out: http://www.jetbrains.com/objc/.
I'm resolving this as not currently a feature of Xcode :(
I've found Cedar Shortcuts to at least be usable. It's not as good as Eclipse's import feature (it doesn't organize imports), but it can keep you from having to go to the top of a class file and typing an import statement. With this plugin you just place the cursor on the class that needs imported and press Ctrl + Option + I. Here's the github project. https://github.com/cppforlife/CedarShortcuts
I made a small Xcode plugin to sort the headers and remove duplicates of the file with a shortcut, you can check it out! - https://github.com/insanoid/CleanHeaders-Xcode
AppCode from Jetbrains can do this.
Yup. Like in Eclipse, this would be an awesome feature since developing in XCode (Cocoa Touch) does require quite a bit of class imports which are not easy to remember and Android development in Eclipse sorts this out with a simple keystroke combination that saves so much time ! Hope there is a way to do this in XCode soon !
WordService (freeware) from Devon Technologies, provides a service that can be used in any Cocoa app that can (amongst others) sort lines.
Alternatively, you can use an Xcode Extension, such as Imp
Swiftlint has an opt-in rule which if opted, will automatically sort the imports alphabetically.
Add - sorted_imports to your .swiftlint.yml file under opt_in_rules.
Run swiftlint autocorrect terminal command on project root directory (same where swiftlint.yml is stored).

Resources