Home Download Buy Blog Forum Support

Dev Build 2055

Re: Dev Build 2055

Postby jbrooksuk on Wed Apr 13, 2011 8:42 am

qqq wrote:Well, it takes all sorts :)

The only question that bothers me now is how do I change it so that I don't have to edit default key bindings on every build.

I believe you can put them in Base File.sublime-settings

:)
jbrooksuk
 
Posts: 754
Joined: Sun Apr 11, 2010 10:37 am
Location: England

Re: Dev Build 2055

Postby bizoo on Wed Apr 13, 2011 9:19 am

qqq wrote:How do you change this behaviour using your user key bindings file?

Something like this put in your "Default (XXX).sublime-keymap" of the User directory could probably work (untested):

Code: Select all
   { "keys": ["tab"], "command": "next_field", "context":
      [
         { "key": "last_command", "operator": "equal", "operand": "insert_best_completion" },
         { "key": "setting.tab_completion", "operator": "equal", "operand": true },
         { "key": "has_next_field", "operator": "equal", "operand": true }
      ]
   }

I don't know if there's a way to disable a keybinding (like define it with a "null" or "pass" command), something like:
Code: Select all
   { "keys": ["tab"], "command": "pass", "context":
      [
         { "key": "last_command", "operator": "equal", "operand": "insert_best_completion" },
         { "key": "setting.tab_completion", "operator": "equal", "operand": true }
      ]
   }

Someone know if there is something like that ?
bizoo
 
Posts: 873
Joined: Wed Dec 08, 2010 6:53 am
Location: Switzerland

Re: Dev Build 2055

Postby stiang on Wed Apr 13, 2011 9:40 am

Goto Anything no longer smooth scrolls

Thanks for this :)
stiang
 
Posts: 39
Joined: Sat Jan 29, 2011 12:34 pm

Re: Dev Build 2055

Postby theblacklion on Thu Apr 14, 2011 8:14 am

I've an issue with tab completion - especially within my orgmode plugin, where I use many short tab triggers (snippets) like "-t" which expands to "- TODO ". Currently I turned tab completion off by adding the following into the packages settings file:
Code: Select all
"tab_completion": false


You can also add this to your Packages/User/Base File.sublime-settings file but I find it somehow useful in Python etc..

Jon, can you somehow give tab triggers more priority?
theblacklion
 
Posts: 67
Joined: Sat Feb 05, 2011 10:07 pm
Location: Hannover, Germany

Re: Dev Build 2055

Postby jps on Thu Apr 14, 2011 8:27 am

theblacklion wrote:Jon, can you somehow give tab triggers more priority?


What do you have in mind?
jps
Site Admin
 
Posts: 3062
Joined: Wed Mar 19, 2008 12:33 pm

Re: Dev Build 2055

Postby theblacklion on Thu Apr 14, 2011 10:15 am

jps wrote:What do you have in mind?

Hard to explain. Perhaps it helps to compare both situations:
* Having tab completion enabled "-t" expands to e.g. "-testing" where the word "testing" comes from somewhere within the file.
* Having tab completion disabled "-t" expands to "- TODO" which has been defined as a tab trigger within a snippet.

I think the first behavior is wrong. A completion only makes sense if no tab trigger could be found/executed. Tab triggers should always have a higher prio / being checked first.

No?
theblacklion
 
Posts: 67
Joined: Sat Feb 05, 2011 10:07 pm
Location: Hannover, Germany

Re: Dev Build 2055

Postby qqq on Thu Apr 14, 2011 11:23 am

This makes sense and could solve many problems.

For example there are more than 4000 (!) PHP completions which fire off almost before you touch your keyboard. Hard to get this couple of snippets you have to work in such environment.

That's why the first item on my to-do list on every build is:
1)delete PHP.sublime-completions file
ST2 Win7 64-bit
qqq
 
Posts: 57
Joined: Tue Mar 08, 2011 9:49 am

Re: Dev Build 2055

Postby jps on Thu Apr 14, 2011 11:29 am

theblacklion wrote:I think the first behavior is wrong. A completion only makes sense if no tab trigger could be found/executed. Tab triggers should always have a higher prio / being checked first.


Snippets do have the highest priority in this sense: if a snippet has an exact match for the tab trigger, it'll also execute first. If no snippets/completions/words match exactly, then the usual fuzzy match ranking will be used, with snippets always taking priority if the ranking for two words is equal.
jps
Site Admin
 
Posts: 3062
Joined: Wed Mar 19, 2008 12:33 pm

Re: Dev Build 2055

Postby qqq on Thu Apr 14, 2011 11:59 am

If this is the case - it's good.

But I don't like what happens when I press a->tab:

an exact match from Html completions (html:a) loses with Php completion (php:abs) which is not an exact match.
ST2 Win7 64-bit
qqq
 
Posts: 57
Joined: Tue Mar 08, 2011 9:49 am

Re: Dev Build 2055

Postby Anomareh on Thu Apr 14, 2011 2:26 pm

Honestly I think the biggest problem is competitions being on tab. It just messes too many things up. I actually can't think of another editor that has both completions and snippets on tab. Most have snippets on tab and completions on ctrl + spacebar or some sort of intellisense. Actually would any sort of intellisense be possible? That would be amazing and it seems like some of what would be needed is already there, like when there are multiple snippets with the same trigger and the box that pops up and lets you choose.

Also +1 for some sort of way to unbind default keybinds from the user keybinds file. Every update I have to go and unbind all the quote and brace overwrite binds as they drive me nuts.
Anomareh
 
Posts: 222
Joined: Thu Oct 01, 2009 7:32 pm

PreviousNext

Return to General Discussion

Who is online

Users browsing this forum: No registered users and 28 guests