Netbeans IDE Code Snippet Keybinding - netbeans

I'm not sure if this is possible and if this is the right place to ask, but I'd like to give it a try. I'm currently trying Netbeans IDE, coming from Dreamweaver.
In Dreamweaver I can create Code Snippets and bind a key to them. So for example marking a text and pressing CTRL+B then, surrounds the text with the [strong] tag. Or I created a snippet, when I press SHIFT+CTRL+B it adds a [br /] tag at the position of the cursor.
I could not find a way to do this in Netbeans so far. Does anyone know if this is possilbe, and if, how to achieve this?

There is a Plugin available for that,
Go to Tools->plugins and try out TagMyCode
https://tagmycode.com/
I've been using it for quite some time, there is a library of public snippets and the doc is really helpful.

Related

How do I get imports to show up when I press ctrl+dot in javascript in vscode?

When writing JSX (or any typescript code really) if you have an available import that's not yet imported, you get a squiggly line under it and can press ctrl+dot on it and then automatically import the code as a "refactoring."
How can I set this up in Javascript? I've seen a screenshot of someone else's VSC where it is available underneath "more options" and so I'm pretty sure it's possible, but when I press ctrl+dot I get nothing.
Note: I'm aware I can press ctrl+space. However, I don't want to do this, for two reasons. (1) alt+space is pretty bad UX because if you press it in the middle of a word it continues to autocomplete even if you already had the full name there and so you are left with an incorrect tag (e.g. if your cursor was after the d in Keyboard for a component called KeyboardRow you are left with KeyboardRowRow) and (2) I want to rebind quick fix to alt+enter to match pycharm; and I want the same hotkey & UX in both Typescript and Javascript.
I haven't worked too much with JS, mainly with TS, but I have two extensions installed in my vscode that helped me a lot while coding in vanilla JS.
Path intellisense and Auto import
You can try if My Code Actions can be used to construct a Quick Fix for these types of PROBLEMS/squiggles

Does VS Code has any shortcut like ctrl+q in eclipse?

Does VS Code (I currently use v1.8.1) has any shortcut like ctrl+q in eclipse?
It returns your cursor to the place where you stopped writing code(very useful for fast code browsing)
and it is different to alt+left which navigate backward
EDIT: I have found that this extension should do that you're asking. I suggest trying it out.
Original:
Out of the box in VS Code, this command does not exist. The list of default shortcuts can be found here, or you can open the keybindings settings in VS Code (ctrl+k, ctrl+s on Windows) and see which commands are available.
If you'd like to suggest this as a feature, you can open a new issue on GitHub or consider creating an extension.
If I understand correctly, you want a command that will move the cursor to where the last edit in a document was made.
This should be possible using an extension that listens to document change events and records the position of the cursor. Then, when the command is issued, it sets the editors cursor to that saved position.
You can also try "Eclipse Keymap" from Alphabot Security, has a lot of eclipse bindings.
I don't believe there is a built-in way to do this, but you could work around it by using an extension such as https://marketplace.visualstudio.com/items?itemName=alefragnani.Bookmarks .

intellij and or eclipse equivalent of sublime text's select text and edit?

it is kinda hard to explain what I am talking about
easier is have a look at this video at minute 18:50 until 19:00
sublime's nifty text block select and change
he selects a text block, then selects other text blocks with it, and changes them all together at once
is there something like this in intellij or eclipse?
What you want is called Multiple Selections, and it is not yet implemented in official IntelliJ, there is just my prototype which works pretty much like Sublime, and if you want, you can build it and give it a try :).
Edit: It is now implemented in some form in official IntelliJ
There might be an option in Eclipse to Rename In File through Quick Assist (Ctrl+1), but it usually applies to variables and not simply every occurrence of a string in the file.

In an eclipse plugin: How can I programmatically highlight lines of codes in the java editor?

I am trying to develop an eclipse plugin that does some documentation check on java code and highlights some lines of code in the editor.
To achieve my goal, I DON'T want to create a new editor in eclipse, I simply want to extend the default java editor to draw a line under (or highlight) the methods that do not satisfy some set of predetermined requirements.
Do I need to create a PresentationReconciler? If yes, how do I make the JDT or workbench use my reconciler.
I have never done plugin development and this is my first attempt.
Several starting points for you:
Annotations are an UI feature of JFace's text editor that allows you to visually mark some places in an open editor.
Markers are a Workbench feature, more high-level. They are generic "objects that may be associated with Workbench resources", and they can display in several places: in text editors (as annotations) or in the Problems view, for example.
Depending on what you want to do, you would plug in your plug-in into extension points related to either of those.
The Eclipse Java editor is located in the org.eclipse.jdt.internal.ui.javaeditor.JavaEditor package.
The "internal" in the package name means that the Eclipse development team can change how the Java editor works with new revisions.
Try this help page: Juno Help on syntax highlighting
At the end of the page, it describes how to dynamically add a PresentationReconciler, which is used for syntax highlighting. See if that fits the problem that you want to solve.
I assume you already have a plugin project.
In your plugin.xml, open the tab Extensions, click Add..., search for org.eclipse.ui.editors, then you should see a template named Editor, which will produce a simple xml editor to experiment and play with. Also, you will be able to see the needed structure to define a custom editor.
Hope this helps...
I don't know if you still have a need for this, but you are going to want to use Annotations to keep track of what parts of the editor you need to highlight.
For actually doing the graphical effect of highlighting, you could do syntax highlighting via a PresentationReconciler, but I have no experience with that.
We used a technique we borrowed from http://editbox.sourceforge.net/, replacing the background image of the editor Shell. Its open source, so check it out. (Our code might also help -- its at https://github.com/IDE4edu/EclipseEditorOverlay )

Is there a way to highlight code in NetBeans manually?

When I am figuring out someone's code in NetBeans, it occurred to me I could use a feature to mark code as 'understood', or 'suspicious', etc. while going through it. Is there any way to manually highlight or format code in NetBeans, the way it is done in Word? Some plugin maybe?
The alternative, i guess, is adding short comments everywhere, which is often not too convenient.
The Netbeans Collab plugin was pretty useful to share code and color them when you are sharing it through an XMPP server or discussing the code with someone.
You could use that to talk to yourself and color parts that you want to comment on.
You could surround sections of code with an editor-fold. To quickly do this:
Select the section of code you want surrounded
Press Alt + Enter
Select Surround with // <editor-fold defaultstate="collapsed" desc="comment">... from the hints popup
Enter your tag ie. "understood"
Press enter
This will give you a collapsible section of code that when collapsed will only show the tag that you've entered for the comment attribute.