Giter VIP home page Giter VIP logo

zencodingnetbeansplugin's Introduction

Zen Coding NetBeans plugin

This plugin is deprecated and not developed further.
Please use Emmet for NetBeans instead.

Provides support to HTML/CSS Zen Coding in NetBeans.
CSS abbreviations are expanded also in SCSS, LessCSS and SASS files.

Download the plugin here: org-lorenzos-zencoding-1.1.nbm.

Screenshot

Installation

  1. Download the plugin here.
  2. Open NetBeans IDE (6.9.1 or newer) and go to Tools > Plugins.
  3. Select tab Downloaded, click Add plugins... and search for downloaded nbm file.
  4. Click Install button, follow instructions and restart NetBeans IDE.

How to use

Expand abbreviation

Fill a HTML/CSS code line with Zen syntax, then press CTRL+ALT+N, or click the toolbar button, or go to menu Edit > Zen Coding > Expand Zen code, or press Alt+Insert and choose Expand Zen Code.

Match Pair

Just press CTRL+ALT+M or go to menu Edit > Zen Coding > Match Pair.

Wrap with Abbreviation

Select something, press CTRL+ALT+W or go to menu Edit > Zen Coding > Wrap with Abbreviation, then insert a Zen code abbreviation in the input popup.

Merge Lines

Select multiple lines, then press CTRL+ALT+L or go to menu Edit > Zen Coding > Merge Lines.

Also available in the Edit > Zen Coding menu:

  • Remove Tag
  • Split/Join Tag
  • Toggle Comment
  • Go to Next / Previous Edit Point
  • Evaluate Math Expression
  • Increment / Decrement number by 1 / 10 / 0.1

These actions have not a default keyboard shortcut. You can edit NetBeans shortcuts in Tools > Options > Keymap. Here is a guide.

How to report bugs

If you find any bug or defect, report it to me here.

About Zen Coding

zencodingnetbeansplugin's People

Contributors

junichi11 avatar lorenzos avatar maxceem avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

zencodingnetbeansplugin's Issues

Any plans to update to Emmet ?

Hi !
I'm not sure how much work it would represent to update the plugin to use Emmet (is it just a matter of dopping new javascript files, or does that imply rewriting each feature one by one ?), but is it something that is on your roadmap ?

Emmet adds quite a few interesting features like CSS vendor prefixes, BEM, fuzzy search, CSS gradients or implicit tag names. And I think it would be great to have those in Netbeans.

Thanks !

Edit points

Hi, big thanks for cool plugin.
One question is there a possibility to jump through edit points, where I can edit text?
e.g when I expand img I get this:
where I can edit src attribute, How can I jump to alt attribute immediately after src? Thanks.

tabulator and ctrl+,

Hi,
grat job.

  1. Default "ctrl+," is reserved for other action.
  2. I have set "Expand Tabs to Space" but "Expand Zen code" don't reflect it.
    Thanks

key mapping

Hi

I enjoy zen-cording on NetBeans 7.1 by your plugin. Thank you.

I used version 0.9 nbm, but I can't see items on option->key map.

Is there key-mapping items on 0.9 nbm? If so, please let me know.

modify zen command

Hi, thanks for your plugin. It is great.
I wonder is there a way to modify zen command?
I'm using Windows 7 and when I try to modify C:\Users\me.netbeans\6.9\modules\org-lorenzos-zencoding.jar
the plugin dissapears from netbeans.
It happens every time I modify something in this file, even if I put a single space.
Probably I'm doing something wrong or there is no way to modify a zen command?
Thanks.

Don't change tag to lowercase

Example:

config>Modules

Expect:

<config>
    <Modules>
    </Modules>
</config>

But output:

<config>
    <modules>
    </modules>
</config>

I use zendconding write some xml files.So I really need some tags uppercase.

Java exception on "wrap with abbreviation" comand without text selection

As reported via email

Netbeans Version: NetBeans IDE 8.0.2 (Build 201411181905)
Java: 1.8.0_11; Java HotSpot(TM) 64-Bit Server VM 25.11-b03
Runtime: Java(TM) SE Runtime Environment 1.8.0_11-b12

Plugin version:1.1
Source: Plugin Portal

step by step to reproduce:

  1. open an html file with netbeans.
  2. put the cursor anywhere in the editor without selecting any text.
  3. run the command "wrap with abbreviation"
  4. write any tag in the text box. for exemple strong.
  5. clic OK button.

expected result (i dont know the specification but I guess there are two options):

<tag></tag> is displayed
---- or ----
nothing happens

seen result:
Java exception (see attached or traces below).

Caused by: java.lang.StringIndexOutOfBoundsException: String index out of range: 12
at java.lang.String.charAt(String.java:646)
at org.lorenzos.zencoding.zeneditor.ZenEditor.getIndentation(ZenEditor.java:263)
at org.lorenzos.zencoding.zeneditor.ZenEditor.replaceContent(ZenEditor.java:107)

=> in functions getIndentation, there is :

String line = this.getLine();

the string "line" may contain null or may be empty according to how getLine function works.

proposed solution :
I think make null &/or empty string tests before using "line" variable or surround the "while (Character.isWhitespace(line.charAt(i))) ws += line.charAt(i++);" by try-catch at least to prevent displaying the exeption in netbeans output to the end user.

org.mozilla.javascript.WrappedException: Wrapped java.lang.StringIndexOutOfBoundsException: String index out of range: 12 (zencoding-java.js#3346)
at org.mozilla.javascript.Context.throwAsScriptRuntimeEx(Context.java:1773)
at org.mozilla.javascript.MemberBox.invoke(MemberBox.java:183)
at org.mozilla.javascript.NativeJavaMethod.call(NativeJavaMethod.java:247)
at org.mozilla.javascript.optimizer.OptRuntime.callN(OptRuntime.java:86)
at org.mozilla.javascript.gen.c1._c138(zencoding-java.js:3346)
at org.mozilla.javascript.gen.c1.call(zencoding-java.js)
at org.mozilla.javascript.ScriptRuntime.applyOrCall(ScriptRuntime.java:2408)
at org.mozilla.javascript.BaseFunction.execIdCall(BaseFunction.java:282)
at org.mozilla.javascript.IdFunctionObject.call(IdFunctionObject.java:129)
at org.mozilla.javascript.optimizer.OptRuntime.call2(OptRuntime.java:76)
at org.mozilla.javascript.gen.c1._c104(zencoding-java.js:2632)
at org.mozilla.javascript.gen.c1.call(zencoding-java.js)
at org.mozilla.javascript.optimizer.OptRuntime.call2(OptRuntime.java:76)
at org.mozilla.javascript.gen.c1._c379(zencoding-java.js:7561)
at org.mozilla.javascript.gen.c1.call(zencoding-java.js)
at org.mozilla.javascript.ContextFactory.doTopCall(ContextFactory.java:398)
at org.mozilla.javascript.ScriptRuntime.doTopCall(ScriptRuntime.java:3065)
at org.mozilla.javascript.gen.c1.call(zencoding-java.js)
at ru.zencoding.JSExecutor.runAction(JSExecutor.java:75)
at org.lorenzos.zencoding.actions.ZenCodingAbstractAction$1.run(ZenCodingAbstractAction.java:44)
at org.netbeans.editor.GuardedDocument.runAtomic(GuardedDocument.java:323)
at org.openide.text.NbDocument.runAtomic(NbDocument.java:436)
at org.lorenzos.zencoding.actions.ZenCodingAbstractAction.actionPerformed(ZenCodingAbstractAction.java:49)
at org.openide.awt.InjectorAny.actionPerformed(InjectorAny.java:73)
at org.openide.awt.ContextAction$Performer.actionPerformed(ContextAction.java:226)
at org.openide.awt.ContextManager.actionPerformed(ContextManager.java:260)
at org.openide.awt.ContextAction.actionPerformed(ContextAction.java:109)
at org.openide.util.actions.ActionInvoker$1.run(ActionInvoker.java:93)
at org.openide.util.actions.ActionInvoker.doPerformAction(ActionInvoker.java:116)
at org.openide.util.actions.ActionInvoker.invokeAction(ActionInvoker.java:99)
at org.openide.awt.GeneralAction$BaseDelAction.actionPerformed(GeneralAction.java:234)
at org.openide.windows.TopComponent.processKeyBinding(TopComponent.java:1176)
at javax.swing.JComponent.processKeyBindings(JComponent.java:2940)
at javax.swing.JComponent.processKeyEvent(JComponent.java:2842)
at java.awt.Component.processEvent(Component.java:6304)
at java.awt.Container.processEvent(Container.java:2234)
at java.awt.Component.dispatchEventImpl(Component.java:4883)
at java.awt.Container.dispatchEventImpl(Container.java:2292)
at java.awt.Component.dispatchEvent(Component.java:4705)
at java.awt.KeyboardFocusManager.redispatchEvent(KeyboardFocusManager.java:1954)
at java.awt.DefaultKeyboardFocusManager.dispatchKeyEvent(DefaultKeyboardFocusManager.java:806)
at java.awt.DefaultKeyboardFocusManager.preDispatchKeyEvent(DefaultKeyboardFocusManager.java:1074)
at java.awt.DefaultKeyboardFocusManager.typeAheadAssertions(DefaultKeyboardFocusManager.java:945)
at java.awt.DefaultKeyboardFocusManager.dispatchEvent(DefaultKeyboardFocusManager.java:771)
at java.awt.Component.dispatchEventImpl(Component.java:4754)
at java.awt.Container.dispatchEventImpl(Container.java:2292)
at java.awt.Window.dispatchEventImpl(Window.java:2739)
at java.awt.Component.dispatchEvent(Component.java:4705)
at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:746)
at java.awt.EventQueue.access$400(EventQueue.java:97)
at java.awt.EventQueue$3.run(EventQueue.java:697)
at java.awt.EventQueue$3.run(EventQueue.java:691)
at java.security.AccessController.doPrivileged(Native Method)
at java.security.ProtectionDomain$1.doIntersectionPrivilege(ProtectionDomain.java:75)
at java.security.ProtectionDomain$1.doIntersectionPrivilege(ProtectionDomain.java:86)
at java.awt.EventQueue$4.run(EventQueue.java:719)
at java.awt.EventQueue$4.run(EventQueue.java:717)
at java.security.AccessController.doPrivileged(Native Method)
at java.security.ProtectionDomain$1.doIntersectionPrivilege(ProtectionDomain.java:75)
at java.awt.EventQueue.dispatchEvent(EventQueue.java:716)
at org.netbeans.core.TimableEventQueue.dispatchEvent(TimableEventQueue.java:159)
at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:201)
at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:116)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:105)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:101)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:93)
at java.awt.EventDispatchThread.run(EventDispatchThread.java:82)
Caused by: java.lang.StringIndexOutOfBoundsException: String index out of range: 12
at java.lang.String.charAt(String.java:646)
at org.lorenzos.zencoding.zeneditor.ZenEditor.getIndentation(ZenEditor.java:263)
at org.lorenzos.zencoding.zeneditor.ZenEditor.replaceContent(ZenEditor.java:107)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:483)
at org.mozilla.javascript.MemberBox.invoke(MemberBox.java:161)
... 65 more

Add snippet

Hi.
I didn't t find the place to manage the shortcuts.
I want to add and change some others, as I do in eclipse + zen coding.

It's possible?

link:css

Sorry for my bad english..

I think this is bug:

link:css -> link rel="stylesheet" type="text/css" href="${1:style}.css" media="all"

In PhpStorm and Notepad++: link:css -> link rel="stylesheet" type="text/css" href="style.css" media="all"

Example: in bundle editor (e text editor) source view like this
link rel="stylesheet" type="text/css" href="${1:style.css}" media="all"${TM_XHTML}>$0
link rel="shortcut icon" type="image/x-icon" href="${1:favicon.ico}"${TM_XHTML}>$0

But snippets give different result in netbeans:

link:favicon -> link rel="stylesheet" type="text/css" href="${1:style}.css" media="all"
link:css -> link rel="shortcut icon" type="image/x-icon" href="favicon.ico"

Add/Edit snippets

Hi Lorenzos,
I download the zip file but i don't understand how to add/edit snippets and rebuild the nbm file . Can you help me please :)

"CNTL+ALT+N" does not work on Mac OSX and No Keymap!

Re: org-lorenzos-zencoding-0.8.nbm

"CNTL+ALT+N" on Mac OSX does not work (already taken). Tried your suggestion from http://code.google.com/p/zen-coding/issues/detail?id=98 to change the keymap via Tools>Options>Keymap and then search for "zen". Result: only one item listed "Zend: Run Command...", i.e. no "Zen Coding" keymaps! See image file below.

So, how do you change the key mapping for your plugin when there are no Zen Coding keymaps listed in Tools>Options>Keymap?

Image file: http://f.cl.ly/items/0X0B1t2O2q273x3d273v/keymap.png

(P.S. Thanks for this plugin. It's really useful. Now if I can only expand my abbreviations, it would be awesome!)

How to Change an Abbreviation's Expanded Text

How do you change what a Zen Coding abbreviation is expanded to? For example, I would like "script" to be expanded to "[script][/script]" instead of "[script type="text/javascript"][/script]" (note: had to replace angle brackets with square brackets so they don't get deleted.)

Thanks.

Wrap with abbreviation doesn't take account of selection

If text is selected, then the wrap method still looks at surrounding tags.
If I understand the zencoding documents this should only happen when text isn't selected.

For instance in the document below, if I select the two lines "This will be a paragraph..." and choose to wrap with p*,
then the two paragraph tags above are also wrapped. Shouldn't the selection prevent zencoding from seeking the surrounding tag (in this case div#Content)?

Example:


    <div id="Content">
        <p>Some info text here</p>
        <p>and another para</p>

        This will be a paragraph
        and this too
    </div>

## Expected output
<div id="Content">
        <p>Some info text here</p>
        <p>and another para</p>

        <p>This will be a list item</p>
        <p>and this too</p>
    </div>

Actual output

<div id="Content">
        <p>
            <p>Some info text here</p>
        </p>
        <p>
            <p>and another para</p>
        </p>
        <p>This will be a list item</p>
        <p>and this too</p>
    </div>

Bug with increment

Hello, in this sintax div>(button{Enviar...$_9}+br)_9 it should create an increment with tilesito-1, tilesito-2..... it just creates the number one in the whole loop.










Thanks! ;)

Undo/Redo handled incorrectly in Netbeans

Note: I'm using Netbeans 7.0.

If we issue an 'Undo' after 'Expand Abbreviation' action the original expression plus the expanded tags get deleted. Same with 'Wrap with Abbreviation', 'Undo' would delete the original wrapped string along with the expanded wrapping tags.

In both cases the correct behavior is to undo the expansion action itself and leave the original strings intact. In the case of wrapping it's clear that we would like to keep the original text. In the case of expansion, we would like to go back to the original abbreviation and edit it and reapply expansion.

It seems that the actions of the plugin are replacing the last action in the action history list of the application rather than adding a new action that can be undone separately.

And by the way - thanks a bucket for your work on this plugin.

Regards,
Basel Shishani.

abbreviations inside inline css

Abbreviation inside inline css are expanded as they where html, not css.

For example, let's have index.html like this:

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html lang="en">
<head>
    <style type="text/css" media="screen">
    body {
        background: #fff;
    }
    </style>
</head>
<body>
    <p style="color: red">Lorem ipsum</p>
</body>
</html>

If I write

fw:b

inside <style/> or in style property in <p/> the abbreviation will be expanded into

<fw:b></fw:b>

insted of

font-weight: bold

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.