Hi
Allan wrote about autocomplete and F5 :
"You can use 'escape' to auto-complete. Although it's not exactly the same as the systems function (the system brings up a menu, TextMate just inserts the first match and lets you cycle between matches with [shift] escape)."
1) Almost every text box you use is a Cocoa text box ( Safari web form boxes, the documents in Pages or TextEdit, the email composer in Mail, etc...) and F5 is used to autocomplete words ( there is a bug with french dictionnary because if you complete Étu you lose the accent and you get Etude )
The text boxes in Textmate are not Cocoa however, why F5 and not F6 or another key in the Text Bundle?
F5 is used by Apple’s Cocoa text system so perhaps it's preferable to respect the Apple guide.
I now I can change the shortcuts or modify / create keybindings.dict but ...
How many shortcuts of the Apple’s Cocoa text system are modified by TextMate?
2) I suppose there is a technical problem to implement the F5 functionality but F5 is very interesting with TextEdit or Page because the completion with the dictionnary is fine and the language is auto detected, ⎋ and ⌥ ⎋ are fine ( ⌥ ⎋ has always a bug with LaTeX ) but is it possible in TextMate to implement the F5 functionality?
Best Regards
Alain Matthes
On 22.11.2009, at 14:07, Alain Matthes wrote:
- I suppose there is a technical problem to implement the F5 functionality but F5 is very interesting with TextEdit or Page because the completion with the dictionnary is fine and the language is auto detected, ⎋ and ⌥ ⎋ are fine ( ⌥ ⎋ has always a bug with LaTeX ) but is it possible in TextMate to implement the F5 functionality?
There's an "hack". You can download my TMTOOLS plug-in here: http://email.eva.mpg.de/~bibiko/downloads/textmate/
double-click on it to install it.
Then save the attached tmcommand "Complete" which is bound to F5, and double-click at it to install.
The tmcommand: Input: none Output: discard Command: "$TMTOOLS" complete usingDictionary '{lang="`"$TMTOOLS" get currentSpellCheckerLanguage`";showInternalListFirst=yes;}'
Set TM's spelling language to whatever language eg. French. Then type in a doc eg "Étu" and press F5 for Complete (maybe you have to rebind the "Sort" commands) and type further "dien" and press RETURN and enjoy.
You can also write "Étu", press F5 for Complete, press BACKSPACE and type further ie to complete to "Étienne".
The command cannot auto-detect the spelling language. It takes that language set in the spelling pane. It also cannot toogle upper/lower case letters of that word part typed before you invoked Complete.
In other words it can do 98% of the Cocoa completion BUT it can something which Cocoa does not can do, press BACKSPACE :)
Cheers, --Hans
PS Please read the Important Note before installing.
Le 22 nov. 2009 à 15:15, Hans-Jörg Bibiko a écrit :
Set TM's spelling language to whatever language eg. French. Then type in a doc eg "Étu" and press F5 for Complete (maybe you have to rebind the "Sort" commands) and type further "dien" and press RETURN and enjoy.
You can also write "Étu", press F5 for Complete, press BACKSPACE and type further ie to complete to "Étienne".
The command cannot auto-detect the spelling language. It takes that language set in the spelling pane. It also cannot toogle upper/lower case letters of that word part typed before you invoked Complete.
In other words it can do 98% of the Cocoa completion BUT it can something which Cocoa does not can do, press BACKSPACE :)
PS Please read the Important Note before installing.
Hello,
I downloaded your plug-in several months ago and it looks really great but I never had enough time to examine all the possibilities.
It's fantastic, really awesome, you make me really happy!
Best regards
Alain Matthes
On 22 Nov 2009, at 14:07, Alain Matthes wrote:
The text boxes in Textmate are not Cocoa however, why F5 and not F6 or another key in the Text Bundle?
Not entirely sure what you are asking here.
The Cocoa text system had a ‘complete:’ method since 10.0 but it was a no-op. There was a TextExtras input manager which implemented completion behavior a la what you currently have in TextMate. It came with a key bindings dictionary that bound ‘complete:’ to escape.
When I wrote TextMate I simply copied the behavior of this implementation, also using the ‘complete:’ method and additionally also copied the key binding.
Later Apple implemented ‘complete:’ for their text views (with a different behavior) and bound ‘complete:’ to F5.
We could remove the default binding on ‘escape’ and then also remove the default bindings of F5 — but I haven’t felt compelled to do that, as a lot of users would then have to learn new keys for (presumed) often used functionality (including me, and I find F5 quite awkward for completion as I can’t hit it w/o looking at the keyboard).
Le 24 nov. 2009 à 13:19, Allan Odgaard a écrit :
hi,
Later Apple implemented ‘complete:’ for their text views (with a different behavior) and bound ‘complete:’ to F5.
We could remove the default binding on ‘escape’
No !! sorry but my english language is very poor and it's difficult for me to find the good words!
I'm very happy with the solution of Hans. "Escape" is very fine and I use "escape" when I want to (re)use something. Alt Esc is also very fine for LaTeX( I'm only frustrating with the little bug (fileExt = "")) But F5 adds something different and F5 is used in a lot of Apple's softs
and then also remove the default bindings of F5 — but I haven’t felt compelled to do that, as a lot of users would then have to learn new keys for (presumed) often used functionality (including me, and I find F5 quite awkward for completion as I can’t hit it w/o looking at the keyboard).
Yes I understand this from a developer but you can use TextMate to write other things and not only code.
The only request is to keep a place for F5 and perhaps to find a solution without TMTools plug-ins but with "esc" and "alt esc"
Best regards
Alain Matthes