Sublime Forum

Goto-CSS-Declaration (ST2 and ST3) - UPDATE: v0.3

#5

Wow, thanks. This is awesome!

I binded this into mousemap:

{ "button": "button1", "count": 2, "modifiers": "ctrl", "alt"], "command": "goto_css_declaration"},
{ "button": "button1", "count": 1,  "modifiers": "ctrl", "alt"], "press_command": "drag_select" }

And works wonderful.

But yeah, i agree with rooc. It needs some polish because is jumping randomly sometimes.

0 Likes

#6

@nobleach mhmmm yeah scss support, i would love that :wink:

0 Likes

#7

[quote=“rooc”]Excellent! But requires a bit of polishing, not just a simple search in css file. for example for class=“box” it founds “box”-shadow, that’s strange.
anyway - thanks![/quote]

I try to solve the problem with search.

0 Likes

#8

UPDATE: v0.1.0

description & screencast see above viewtopic.php?f=5&t=4397#p19874

  • Added: go to the next/previous declaration in the CSS file
  • Removed: F3 support

fixed

0 Likes

#9

Cannot for the life of me get this to work.

Super+any direction was resizing and relocating my window, so I changed the keys to ctrl+alt+left/right. (I checked and this is currently not in use by anything else)

Tried, still nothing. So I tried testing the code to see if it would run, and if it was just the keymapping.

view.run_command("goto_css_declaration")

Tried the above and this is what I get back.

>>> view.run_command("goto_css_declaration") Traceback (most recent call last): File ".\sublime_plugin.py", line 351, in run_ return self.run(edit) TypeError: run() takes exactly 3 arguments (2 given)

*EDIT

It’s working now. Of course I figure it out after I ask the question. It was a simple matter of extra “{” before and after the keymap. Restarted and it’s all good now.

I likes it.

I do not understand what is going on. Yes, I copied and pasted everything exactly as was posted, and only changed the key mappings. I still just cannot find any way to make this work.

0 Likes

#10

I’m not sure if it is your case but corresponding css file should be opened in other tab

yep, I also found this key mappings confusing because in windows they predefined for changing window behaviour

0 Likes

#11

yep, unfortunately you’re right (
in Windows 7
Win + Left - Dock the current Window to the left half of the screen
Win + Right – Dock the current Window to the right half of the screen

try to use [size=120]super+.[/size] and [size=120]super+,[/size] or other suitable combination of keys.

UPDATE: Default (Windows).sublime-keymap to this combination.

0 Likes

#12

It’d alse like very much support for SASS and LESS - I suppose it’s nothing fancy, just adding .less and .scss files to the searching procedure. Or am I wrong?

0 Likes

#13

Support for SASS and LESS (and other from user settings) will be added soon.

Thanks for your feedback.

0 Likes

#14

UPDATE: v0.2.0

+ Added: support for .SASS and .LESS (and .other from goto_css_declaration.sublime-settings)

    {
        "css_files": ".css", ".sass", ".less"]
    }
0 Likes

#15

UPDATE: v0.2.1

+ Fixed: TypeError in is_css() if empty view.file_name() as in “Find Results” window

0 Likes

#16

Hi guys,

I really really love this package when working with css.

Now my question is:

**Do you think you can extend it to make it work with PHP functions?
**
I have 2 files opened in tabs. And I would like to jump to the function setCssAndJsFiles().

Here are my code examples:
File 1 (contains function calls)

// DO IT: Call a function EmsTools::setCssAndJsFiles(); EmsTools.setCssAndJsFiles();

// Function definition public static function setCssAndJsFiles() { }

0 Likes

#17

Has anyone got this working with Rails? E.g. with html.erb and css.scss.erb files? I’ve been unsuccessful… :neutral_face:

0 Likes

#18

Preferences -> Package Settings -> Goto-CSS-Declaration -> Settings-Default

try adding the extension “.scss” (or “.erb” ?) to the list
{
“css_files”: “.css”, “.sass”, “.less”, “.scss”]
}

with “.less” it works fine

0 Likes

#19

[quote=“StevenRas”]Hi guys,
I really really love this package when working with css.
Now my question is:
Do you think you can extend it to make it work with PHP functions?
[/quote]

try using the “Goto Symbol” package

0 Likes

#20

[quote=“rmaksim”]
Preferences -> Package Settings -> Goto-CSS-Declaration -> Settings-Default

try adding the extension “.scss” (or “.erb” ?) to the list
{
“css_files”: “.css”, “.sass”, “.less”, “.scss”]
}

with “.less” it works fine[/quote]

Unfortunately this doesn’t work, I believe it’s because the plugin only considers html files as ending with “.html”, an option for “html_files” would solve this problem. In a Rails context most files end with .erb and only some of those files are css and only some are html, it would make most sense to be able to write the following:

{
“css_files”: “.css”, “.sass”, “.less”, “.css.erb”, “.css.scss.erb”],
“html_files”: “.html”, “.html.erb”]
}

You can also try CTags: github.com/SublimeText/CTags

0 Likes

#21

question: "Is it possible to cycle through ALL definitions between all opened css(in my case scss) files?

because it is not working for me, for example i have three scss files opened, he always pickes the last one and only cycles in this file, although there are also declarations in the first scss file. Would be nice if he goes to the next file when he reaches the end of one file.

0 Likes

#22

Now supports both ST2 and ST3!

https://sublime.wbond.net/packages/Goto-CSS-Declaration

0 Likes

#23

UPDATE: v0.3

99% refactoring

+ Fixed: search and switching between tabs is working correctly.

0 Likes

#24

Hey, this update is not working for me. v0.2 was working perfectly for me. I don’t know what happened with this update. Is there anybody else with the same problem? Please share if there is any solution for this.


microsoft-chat.com

0 Likes