1

I've started to use sublime text 2 and I was hoping for a fast way to create relative path references for the purpose of creating hrefs or src references?

E.g. say i had this file strucure:

myfolder
|-->css
|   `-->js
|       `-->something.js
`-->current.html

And i was editing a <script src="[cursor_here]"> tag, I would like to use sublime's 'fuzzy' search function to quickly and accurately create the file path 'css/js/something.js by typing something like cjs and picking with my keyboard.

is this a base sublime functionality or is there a package for such a task or would I need to create this package myself?

1
  • 1
    href attribute on <script> won't work. Commented Apr 3, 2014 at 7:39

1 Answer 1

3

Check out the AutoFileName plugin from Package Control, it does exactly what you're describing. It can also do cool things like inserting dimensions for images, if you like. Make sure you read the README at the link above, and also go through the configuration options available in Preferences -> Packages -> AutoFileName -> Settings-Default (they'll need to be entered into Preferences-User if you want to change them).

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.