Home Download Buy Blog Forum Support

AutoFileName (ST2/ST3)

Re: Autocomplete Filenames

Postby rmaksim on Sun Jan 22, 2012 10:28 pm

C0D312 wrote:
rmaksim wrote:In linux still starts to work only after a restart the plug-in, as described above.


I'm not really sure what that's supposed to mean... AutoFileName does all of its work at runtime. So I don't know how a restart can change anything. Do you mean a restart just after installing it or every time to get it to work?


omg, I found my problem !
I had another old copy of the autofilename.py in another directory when he was not in the package manager.

now all works fine :)

p.s. maybe pod has the same problem.
rmaksim
 
Posts: 59
Joined: Sat Jul 02, 2011 7:31 pm

Re: New Plugin: Autocomplete Filenames

Postby pod on Sun Jan 22, 2012 10:55 pm

rmaksim wrote:p.s. maybe pod has the same problem.

True-true :)

Now the only issue I have is that all items in auto-complete box have backslash '\' instead of normal slash '/'.
I believe I can fix it by replacing d += os.path.sep with d += '/' correct?
pod
 
Posts: 37
Joined: Sun Nov 07, 2010 3:32 am

Re: New Plugin: Autocomplete Filenames

Postby C0D312 on Mon Jan 23, 2012 12:08 am

pod wrote:
rmaksim wrote:p.s. maybe pod has the same problem.

True-true :)

Now the only issue I have is that all items in auto-complete box have backslash '\' instead of normal slash '/'.
I believe I can fix it by replacing d += os.path.sep with d += '/' correct?


I changed this because when I was trying to fix all the windows bugs, I changed all references of '/' to os.path.sep I'll change it back though.
C0D312
 
Posts: 1063
Joined: Sun Jul 10, 2011 3:23 am

Re: Autocomplete Filenames

Postby aaronmw on Sat Feb 25, 2012 3:53 pm

It would be marvellous if the plugin would somehow use the Sublime Project root as "/", because it's often the case that my CSS files are in /css/ and my images are in /images/, and all of my references to files in CSS are absolute paths. So instead of background: url(../images/bg.png), I use background: url(/images/bg.png). In this context, the plugin is of no use :(

Also, is there some way to have the auto-complete window make suggestions immediately as I type, rather than after a manual invocation with CTRL+SPACE? It was also unable to complete a filename if I began typing one that I knew already. IE: ../images/backg[CTRL+SPACE] yields no suggestions, even though I have a background.png image in there.

Just thought I'd post my feedback! Thanks for making this :)
aaronmw
 
Posts: 18
Joined: Sat Feb 25, 2012 3:06 pm

Re: Autocomplete Filenames

Postby C0D312 on Sat Feb 25, 2012 8:33 pm

aaronmw wrote:It would be marvellous if the plugin would somehow use the Sublime Project root as "/", because it's often the case that my CSS files are in /css/ and my images are in /images/, and all of my references to files in CSS are absolute paths. So instead of background: url(../images/bg.png), I use background: url(/images/bg.png). In this context, the plugin is of no use :(

The Sublime Text API doesn't have much support for working with projects, so this request might be pretty difficult to implement... I'll look into it but it might be more work then it's worth.
Also, is there some way to have the auto-complete window make suggestions immediately as I type, rather than after a manual invocation with CTRL+SPACE? It was also unable to complete a filename if I began typing one that I knew already. IE: ../images/backg[CTRL+SPACE] yields no suggestions, even though I have a background.png image in there.

This is already possible if you add the following to your Settings file (Preferences > Settings - User):
Code: Select all
   "auto_complete_triggers":
   [
      {
         "characters": "<",
         "selector": "text.html"
      },
      {
         "characters": "/",
         "selector": "text.html, source.css"
      }
   ]
(The '<' part is from your default settings so you don't want to override that.) Essentially, ST2's autocomplete will activate when you type letters. This setting gives exceptions, other characters that also trigger the autocompletion popup. As for why ../images/backg[CTRL+SPACE] yields no suggestions, this is because the plugin checks if the previous character is a /. If the autocomplete is already up though, this is not a problem.

Hope that helps!
C0D312
 
Posts: 1063
Joined: Sun Jul 10, 2011 3:23 am

Re: Autocomplete Filenames

Postby aaronmw on Wed Feb 29, 2012 3:12 am

Ah, it does. Thank you!
aaronmw
 
Posts: 18
Joined: Sat Feb 25, 2012 3:06 pm

Re: Autocomplete Filenames

Postby skube on Sat Mar 24, 2012 11:04 pm

OMG. Just discovered this plugin and it's so useful. Thanks!

I do second aaronmw's request that the plugin somehow work with absolute paths though. It would be great if I could specify the root directory as a user preference.
skube
 
Posts: 88
Joined: Tue Feb 28, 2012 8:42 pm

Re: Autocomplete Filenames

Postby C0D312 on Fri Apr 27, 2012 1:40 am

*UPDATE*

Notable changes:
- Support for wildcards
- The cursor position acts as a wildcard
- Behaves smarter
- No longer restricted to / to be activated
- Directories no longer end in / when inserted into the view
- Settings
> Use project root at root for AutoFileName
> Define a custom project root
C0D312
 
Posts: 1063
Joined: Sun Jul 10, 2011 3:23 am

Re: Autocomplete Filenames

Postby C0D312 on Tue May 01, 2012 5:27 pm

I merged all my beta changes to the master branch.

I'll update the README soon but there have been a lot of changes.
- Web designers/developers: AutoFileName now inserts width and height attributes for you.
- Autocompletion will now feel automatic (No more pressing control+space).
- Working on a project but want to use absolute paths? You can now adjust the plugin to use either the current project's root or a custom path. Both of these settings can be found by going to Preferences > Package Settings > AutoFileName.

Please let me know if there are any bugs or features requests. (P.S. this has not yet been tested on windows so results could be interesting.)
C0D312
 
Posts: 1063
Joined: Sun Jul 10, 2011 3:23 am

Re: Autocomplete Filenames

Postby pod on Wed May 02, 2012 6:16 pm

Hi man,
Thank you for new update, I noticed changes in a way how plugin works and was amazed - it is great! Tested only out-of-box functional on windows, everything works nice and smooth :)
pod
 
Posts: 37
Joined: Sun Nov 07, 2010 3:32 am

PreviousNext

Return to Plugin Announcements

Who is online

Users browsing this forum: No registered users and 10 guests