Karabiner-Elements how to map pc style home-end keys - keyboard-shortcuts

recently I'v updated to macOS sierra and found that Karabiner is not supported.
Developers have released Karabiner-Elements but it seem in a "pre-user friendly" state. I cant understand how to map home and end keys in a pc style, as in the original Karabiner.
A user guide will be appreciated.

I just suffered through trying to get this to work as well. What I ended up doing was following these instructions, with a few tweaks.
Here are the steps:
Open TextEdit and create a new file.
Paste the following:
{
"\UF729" = "moveToBeginningOfLine:";
"\UF72B" = "moveToEndOfLine:";
"$\UF729" = "moveToBeginningOfLineAndModifySelection:";
"$\UF72B" = "moveToEndOfLineAndModifySelection:";
}
Save to {your user folder}/Library/KeyBindings/DefaultKeyBinding.dict (UTF-8 encoding)
Restart your computer.
I also found this helpful utility that seems to be a handy editor for modifying your .dict file. It would seem that making new key mappings should be easier with this tool.

Related

Documentation for Xcode Source Editor Extension

I'm looking for some documentation of the new Xcode Source Editor Extensions in Xcode 8.
As far as I can see there is only the "documentation" found in the header file for XcodeKit. Would be great to get something that's more detailed and more official.
Very preliminary XcodeKit reference documentation is now available.
Our WWDC 2016 presentation introducing Xcode Source Editor Extensions remains the best walkthrough.
The very shortest version, however, is: Because App Extensions need to be embedded in an application, you need to first create a new macOS Cocoa Application, and then add a new Xcode Source Editor Extension to that application. Then the XcodeKit reference should help some in implementing that.
Not really a documentation but a good reference also
https://developer.apple.com/videos/play/wwdc2016/414/
Extensions, at the moment, are poorly documented. There are a lot of assumptions made (for example, did you know that you can execute the container app? Yup, it’s really nice for settings GUI - see this How To Execute Container App - Second Answer)
At the moment, there are a lot of things missing: for example, there isn’t a structure that shows the corresponding lines with the data object - though this is quickly created with the following code:
var matches: [NSTextCheckingResult] = []
do {
let regex = try NSRegularExpression(pattern: "\n", options: [])
matches = regex.matches(in: completeBuffer,
options: [],
range: NSMakeRange(0, completeBuffer.count))
}
catch {
}
This gives you the location of all the \n’s - you should be able to fill out the rest to give you starting and ending positions which should match up to the lines.
All in all, there is a lot to like about the extension, but there are quite a few things missing as well.
Currently the only available documentation is in the headers; there's nothing "unofficial" about them. If you have specific questions, please ask.

IntelliJ Idea 12 - Java file is too large for editor

Getting "file x.java is too large for IntelliJ Idea editor" after trying to open a web service stub class that is generated for Axis 2.
I saw a post associated about this issue which says change the
idea.max.intellisense.filesize=2500
in idea.properties.
But this trick didn't work for me despite I increased the value enough. Also I tried to comment out it for disabling this feature; but it didn't work too..
Nowadays the setting
idea.max.intellisense.filesize=50000
works perfectly for me and lets me open files of up to 50M size.
If you just want IntelliJ to open the full file instead of truncating it, use this:
idea.max.content.load.filesize=500000 #500MB
My issue is that the file was > 20mb. See this link: http://youtrack.jetbrains.com/issue/IDEA-85045

How to intercept reading of plist values in Objective-C code?

We're using the new Urban Airship iOS plugin for PhoneGap.
In the plugin's plist file, we're supposed to enter the app-specific keys needed to enable push notifications.
The problem is we have two versions, free and paid, of the same app, but the plist file only accommodates one version.
Essentially, we need to modify the Objective-C code to read different plist values, depending on whether it's the free or premium version.
We currently manage both versions with the same code base and Xcode project. Unless we change the plugin code, it seems like we need to create a new Xcode project, which we don't want to do.
How do we adjust Urban Airship's Objective-C files to read different values from the plsit file?
Sorry to keep you waiting, I wanted to give you a very detailed answer instead of rushing last night :) So here we go.
First in your project we need to add a new target. Go to your project settings and right click your target. Click duplicate.
You'll get a new target probably named Target-copy. You'll also get a new info.plist file just for that target.
Next we're going to edit our Pro version's Built Settings. Scroll or search and find Apple LLVM compiler 4.0 Preprocessing. Add to both your Debug and Release configurations. I normally just go with the simple PRO=1. You also need to add PRO=0 to your lite version or it will be undefined when you try to build that version.
Now lets look at how to add a custom plist like I'm sure you'll need. First create two folders. Its important these are folders not groups. In each folder we can create a plist with the exact same filename.
Since Now you can add something to each of them. I just added a key property and a value pro string / lite string. Finally to the code. In the sample project I made I simple overrode viewDidLoad but obviously this will work anywhere. Since the plists have the same name you can load them with one line of code. They'll never get mixed up because they are only copied to their respective target. If you need to do code level based logic you can use the PRO preprocessor we made.
- (void)viewDidLoad
{
[super viewDidLoad];
// This will load the proper plist automatically.
NSLog(#"Plist Value: %#",[[NSDictionary dictionaryWithContentsOfFile:[[NSBundle mainBundle] pathForResource:#"Property List" ofType:#"plist"]] objectForKey:#"property"]);
// Also remember we set up a preprocessor PRO. you can use it as well.
if (PRO) {
NSLog(#"Only Show for Pro");
} else {
NSLog(#"Only Show for Lite");
}
NSLog(#"This will show for both");
}
This is the method I use for all my lite/pro version apps so I can share a common codebase without copying it between projects or other complicated systems. It has worked pretty well for me so far :) Happy Coding!
Source
Figured someone may be able to use the project to look at so here it is on GitHub.

TODO tasks list in Flash Builder

Does Flash Builder support tasks list?
I'm testing Flash Builder for PHP, and I can see my // TODO in PHP code but not in AS or MXML.
I found this plugin:
http://www.richinternet.de/blog/index.cfm?entry=911D4B57-0F0D-5A73-AF6F4D4D04099757
but it's very old.
Do you know how can I see my TODO list in AS3 and MXML code with Flash Builder 4.5?
[UPDATE]:
I've installed the plugin from richinternet.de and it works in Flash Builder 4.5 for PHP.
But it's very poor, it only detects the TODOs and FIXMEs if you open the file, it doesn't search all your src for TODOs and FIXMEs.
And also is case insensitive, that's a problem for me, because in spanish "todo" means "everything", so I can't use the word todo in my comments now.
I can't understand how Adobe doesn't include a plugin for this after so many years developing Flash Builder !! they are adding TODO comments when you generate a handler, method, etc !!! I don't know how that can be useful if you don't show it in the tasks!
Get the TODO/FIXME extension for Flash Builder at the following link, and give it a try.
http://www.richinternet.de/blog/index.cfm?entry=911D4B57-0F0D-5A73-AF6F4D4D04099757
Another link at: http://blog.winnemconsulting.com/2011/08/08/fbtoolkit-taskfixmetodo-plugin-for-flex-and-flashbuilder/
How it works: the plugin parses every MXML/AS file when opened and searches comments (both MXML and AS comments) for TODO and FIXME tokens (this search is case insensitive, so it also finds todo). The same action takes place after a file has been saved. If a token is found, a new Task gets generated with its message set to the comment and displayed in the Task View (To open Task View choose Window-->Other Views...-->Basic-->Tasks in Flex Builder 2 standalone and Window-->Show View-->Other-->Basic-->Tasks when running Flex Builder 2 as a plugin in Eclipse). Note: to really delete a Task you have to delete the comment - deleting a Task from the Task View does not kill the comment, so after you save the file the Task will reappear.
For completeness on this question:
I do agree with you on the fact that it is truely amazing and inconceivable that such features do not exist in Flash Builder by default.
There is another alternative, though it's not free (It does have a 30 day trial though)
It is called SourceMate http://www.elementriver.com/sourcemate
The product has loads of other cool features, be sure to check the feature list.
I commented above on the accepted answer, but I'll relist here...
This post is now seriously outdated :(. I would like to offer a different answer... We'll say starting with Flash Builder 4.6.
It's from a great article (from the Adobe Cats) about how to add Task Markers (and Bookmarks) to your Flash Builder Project Files.
You can always search in the solution for "TODO":) And in the results window, press F5 the next time you want to see TODOs.
Best solution is to install the plugins mentioned previously via the software install menu under Help > Install Software.
WARNING - Don't get the SourceMate plugin if you have FB 4.7 - it isn't supported and doesn't look like it will be soon. Check this page for updates: http://support.elementriver.com/discussions/sourcemate

Custom key bindings Xcode 4?

Awhile back I asked a question about custom key bindings in Xcode. I ended up recreating some of TextMate's key commands in Xcode. Just updated to Xcode 4 and it appears that the PBKeyBinding file no longer has any effect. What's the new hotness for custom key bindings, specifically for Xcode 4?
Yes, it can be done (at least for the moment). After spending the better part of a day searching, experimenting and digging through the bowls of /Developer I finally figured out how to accomplish this.
Open IDETextKeyBindingsSet.plist located in /Developer/Library/PrivateFrameworks/IDEKit.framework/Resources/
This bindings plist is formatted differently than others used throughout the system, the most important distinction is that all the methods must be listed in the same string, i.e.
<string>moveToBeginningOfParagraph:, insertText:, foo</string>
edit:
I have not tested this, but it looks like the new location in Xcode is
Xcode.app/Contents/Frameworks/IDEKit.framework/Resources/IDETextKeyBindingSet.plist
You can use Keymando to create any keybinding you like in Xcode 4 and any other OSX application.
The answer now seems to be to use the idekeybindings files — these are tied to the custom keyboard shortcut sets you create in the preferences — stored at ~/Library/Developer/Xcode/UserData/KeyBindings/. More information can be found in the Key Bindings Preferences Help. However it sounds like people are having no luck trying to combine multiple actions under one keyboard shortcut (as you can do with the older-style key bindings dict files). But presumably you could still do this in DefaultKeyBinding.dict, as long as you don't mind the shortcut also working in other applications :) If this doesn't work, I think you're out of luck for now. Sorry; file a bug!
Kike here http://www.codedojo.com/?p=580
you use this binding set
Download
http://www.codedojo.com/files/MSVC_xcode_config.zip
unzip it and place MSVC.pbxkeys in YourUserName/Library/Developer/Xcode/userdata/keybindings
and rename it to msvc.idekeybindings
then from
Xcode -> preferences -> keybindings
just pick msvc
Go to Xcode 4 > Preferences > Key Bindings and fiddle with them all you like. :)