Home Download Buy Blog Forum Support

Soft tabs, selection wrap and switch syntax

Re: Soft tabs, selection wrap and switch syntax

Postby jbjornson on Thu Jun 23, 2011 8:10 am

bizoo wrote:Isn't it redundant with the new Command Palette ?


Right you are, this is totally redundant now. I hadn't really played with the command palette yet but it looks quite cool!
jbjornson
 
Posts: 353
Joined: Tue Oct 27, 2009 4:25 pm
Location: Zurich, Switzerland

Re: Soft tabs, selection wrap and switch syntax

Postby jps on Thu Jun 23, 2011 9:05 am

iamntz wrote:First thing that was annoying to me was the soft tabs.
..
The only two thing that I need to replace E completely is: translate all snippets from E to ST and make ctrl+tab to behave (is very redundant right now). Go to last active tab would be great. Any clues?


I'm a bit late here, but could you explain what you mean by soft tabs? It's generally used in text editor parlance to mean inserting spaces when you press tab, which is done in Sublime Text with the translate_tabs_to_spaces setting.

Ctrl+tab behaves just as it does is almost every other application: it cycles through a stack of files, with the most recently selected one on top. "Go to last active tab" is done by pressing ctrl+tab once.
jps
Site Admin
 
Posts: 3077
Joined: Wed Mar 19, 2008 12:33 pm

Re: Soft tabs, selection wrap and switch syntax

Postby iamntz on Thu Jun 23, 2011 10:31 am

@Jps: fortunately, i migrated to ST without these things. i like the release cycle and your activity on the forums, which compensate somehow :mrgreen:

Ctrl+tab doesnt behave normally. Let me explain.

If we have 5 files opened ( a, B, c, D, e, f ). If B is active and previous active was D, when i press ctrl+tab, it goes to D, but now, the last active tab should be B. No? (just noticed is working like it should if i press ctrl+tab, release ctrl+tab then press again)

And about soft tabs, check out this video, should be explicit enough: http://screencast.com/t/5JziAePQGrY4
iamntz
 
Posts: 917
Joined: Fri Apr 29, 2011 8:52 am
Location: Romania

Re: Soft tabs, selection wrap and switch syntax

Postby jps on Thu Jun 23, 2011 1:13 pm

That's right, the stack of recent files is only updated when you let go of the ctrl key - alt tab (or command tab on osx) works the same way.
jps
Site Admin
 
Posts: 3077
Joined: Wed Mar 19, 2008 12:33 pm

Re: Soft tabs, selection wrap and switch syntax

Postby iamntz on Thu Jun 23, 2011 1:40 pm

Yes, you are right.
I guess i was... familiar with the editor that we don't name it ( :ugeek: ) and i thought that is normal. Now, if I'm thinking a little at this, it kind of make sense...
Last edited by iamntz on Sat Jul 02, 2011 9:50 am, edited 1 time in total.
iamntz
 
Posts: 917
Joined: Fri Apr 29, 2011 8:52 am
Location: Romania

Re: Soft tabs, selection wrap and switch syntax

Postby bizoo on Sat Jun 25, 2011 8:33 pm

bizoo wrote:Isn't it redundant with the new Command Palette ?

I tried this key binding:
Code: Select all
[
    { "keys": ["ctrl+shift+y"], "command": "show_overlay", "args": {"overlay": "command_palette", "text": "Set Syntax:"} }
]

but it doesn't work properly, look like the "text" parameter is ignored. Maybe Jon could make it work.

Note that it work now with Build 2070.
bizoo
 
Posts: 889
Joined: Wed Dec 08, 2010 6:53 am
Location: Switzerland

Re: Soft tabs, selection wrap and switch syntax

Postby iamntz on Sat Jul 02, 2011 12:16 pm

@jps: any news with soft tabs thing? http://screencast.com/t/5JziAePQGrY4
I'm using the following key shortcut config:

Code: Select all
   { "keys": ["tab"], "command": "move_to", "args": {
         "to": "bol",
         "forward":true
      }, "context":[
         {
            "key": "following_text",
            "operator": "regex_contains",
            "operand": "\t",
            "match_all":   false
         }
      ]
   }


But there are some issues if the code is like this:
Code: Select all
[tab][tab]some things[tab] {


and `translate_tabs_to_spaces setting` doesn't really do anything. Any hint please?

thanks!
iamntz
 
Posts: 917
Joined: Fri Apr 29, 2011 8:52 am
Location: Romania

Re: Soft tabs, selection wrap and switch syntax

Postby jps on Sat Jul 02, 2011 1:24 pm

Can you explain exactly what you mean by soft tabs? Different programs use the phrase to mean different things.
jps
Site Admin
 
Posts: 3077
Joined: Wed Mar 19, 2008 12:33 pm

Re: Soft tabs, selection wrap and switch syntax

Postby iamntz on Sat Jul 02, 2011 1:53 pm

Look at the movie posted at start there is no smart tab and at 0:15 there are. (i just remembered they are called SMART tabs not soft tabs. Sorry about this confusion.)

Long story short, when i have tabs after current cursor position is not inserting new tabs.

So if i have this:

[cursor][tab]{

and i press tab key, the cursor will jump just before { without inserting any new tabs. The problem is, however, the key i used is considering all tabs in that line, not all tabs untill first non-tab char. I tried to use \t\b as operand with no luck.
iamntz
 
Posts: 917
Joined: Fri Apr 29, 2011 8:52 am
Location: Romania

Re: Soft tabs, selection wrap and switch syntax

Postby jps on Sun Jul 03, 2011 9:51 am

If I understand what you want correctly, you may be able to get by with the move by words command, which will advance the cursor to the start of the next word:

Code: Select all
"command": "move", "args": {"by": "words", "forward": true} }


If that doesn't do it, then you'll likely have to resort to a plugin.
jps
Site Admin
 
Posts: 3077
Joined: Wed Mar 19, 2008 12:33 pm

PreviousNext

Return to Plugin Announcements

Who is online

Users browsing this forum: Yahoo [Bot] and 16 guests