Is there a text editor or ide that will do this things? - ide

Is there a text editor that will let me shade certain code blocks with specific colors so I can easily find them later? Bookmarks are great, but I also wanted to shade with the same color all code blocks which are somehow related to each other.
and
When my current text editors autocreate curly braces or parentheses for me and I type what I want in between them, are there any that let me either jump to the end of the line to put a semicolon there, or "return" to type the next line, or do I always have to use the arrow key to get out of the curly braces? Perhaps there is a shortcut I'm missing?

I think about every code editor, including Notepad++, has bookmarks. If you're looking for a more complete IDE, it probably depends on the language you're using. For .NET languages that is Visual Studio, but you probably would have known that. For PHP, Javascript and HTML/CSS, you can use Netbeans for PHP. Netbeans is also available for Java. It is a rich editor, and I think one of the best free general purpose IDE's available.
Marking pieces of code in colors is unknown to me. I've never seen an editor that supports this. You would also need a project in which to store the start and end points of these blocks, unless you would save them as comments or so in the file itself.
Visual Studio knows regions which you can define by a start tag and an end tag. You can collapse and unfold an entire region at once, making it quite easy to navigate through larger files.
But these regions are actually part of the code file, so you cannot use this for any file, because those region markers will probably make the file invalid.
I'm still wondering why any other shortcut key would be easier or more convenient than 'arrow down'..

Related

Fold HTML tag attributes feature similar to Sublime Text

One feature I've found really useful in Sublime Text is the ability to fold HTML tag attributes. Is there a way to do this with VSCode that I'm missing?
I don't think there's a built-in way to do this. Also, it seems the extension API currently doesn't have a way of hiding characters, see this open feature request (except for a hack mentioned by the second comment).
Extensions also can't customize the built-in folding yet, see #3422.
To fold individual attributes just move your mouse pointer to the left of the editor, in the empty space on the right of the line numbers. Small - icons will appear. Click on the ones you want to fold items.
Keyboard shortcut is CTRL+SHIFT+].
You can get the full list of key bindings there: https://code.visualstudio.com/docs/getstarted/keybindings

Is there an extension to beautify a Processing sketch?

I haven't used Processing in many years. I am copying some old code into Processing and it is pasting onto one line. Is there a beautify extension for Processing 3? Have looked and can't find.
What you're talking about is called auto-formatting, not beautifying.
The Processing editor includes an auto-formatter. Just go to Edit > Auto-Format, or press ctrl+t to do it from the keyboard.
Alternatively, most code IDEs like eclipse also include auto-formatters.
However, if everything is on one line, it sounds like you're dealing with an issue copying the newline character. This can happen if you copy something from one OS to another, for example. You might be able to google for a tool that fixes this problem, but it might be simpler to just put in the line breaks manually and then use the auto-formatter to handle the indentation for you.

How would I make a notepad++ like Syntax Highlighting?

I'm looking to make a "Code" editor for Visual Basic.
I just wondered how I would achieve the Syntax Highlighting with most editors use.
Well, I'd start by subclassing the RichTextBox
RichTextBox gives you the ability to colour text, change font, etc. Your class could then implement other features like line numbers, intellisense, showing compile-time exceptions, etc...
That said, to get a good one, you're going to have to made a lot of changes - and most likely tie it in to a compiler or custom parser as well as (presumably) all the other stuff that goes along with a code editor.

How to Pretty print VBA code?

How do you copy VBA code into a Word document and retain the VBA editor color scheme?
You can use Notepad++ to accomplish this in three ways. Just so you know, Notepad++ is a more advanced version of Notepad, which supports syntax highlighting of different code files "out of the box" - Visual Basic included!
Download & install it, fire it up, and load up your VBA code. You should automatically see it beautifully coloured (if not, because the file extension is something other than .vb, go to Language -> VB or Language -> V -> VB).
If you need to change any of the colours, you can easily do so - just go to Settings -> Styler Configurator. From that menu, you can change the various highlighting and font options, to suit your needs - although the default usually suffices for most.
Then, go to Plugins -> NppExport. From there, you have three options you can consider:
Directly print from Notepad++
Copy all formats to clipboard
Export to RTF
Export to HTML
The first is self explanatory. The second one - "Copy all formats to clipboard" - will copy the entire file with the highlighted syntax to the clipboard. Once you click it, then open Microsoft Word or your other favourite document editor, and just hit paste! You should see the beautifully syntax-highlighted code. If something goes wrong, then you can try one of the other options (export to RTF/HTML), although I've never had a problem with the clipboard method.
There are two programs on cnet downloads, which are free to try. In case you did not try them, here are the links:
VB-VBA Code Formatter & Printer 2.2
VBAcodePrint 6.13.110
Smart Indenter could be what you're looking for? You'd load the result into Notepad++, set language to VB and save as .rtf/.doc (or print to file, can't remember off the top of my head).
For a more modern approach, Sublime Text users can install ExportHTML from Package Control. This has the added benefit of being able to include the line numbers, and changing the code coloration.
HTML files can be opened directly within Word.
Highlight supports a wide range of Operating Systems and 150+ languages including Visual Basic, although I'm not sure about VBA.
I would recommend this one: planetB
It works well with Internet Explorer (didn't work wit Firefox for me, not sure abt Chrome).
Plus it's online, so no need to install anything (the case of Company/University PC's)
Regards
Wheeliam
The following works with Visual Studio Code:
Start VS Code.
New file.
Copy & Paste the VBA code into the VS Code window.
In the lower right-hand corner, click on "Plain Text" and select "Visual Basic" instead. Note that the code is now syntax-highlighted.
Copy & Paste the formatted code into Word.

Is there an IDE or plugin which allows separation of code from layout?

I'm looking for something like CSS for code. Does it exist either in an IDE, or as a plugin?
The compiler often doesn't care how many more spaces or tabs or newlines you have between tokens in your code, but people do care.
I want to specify in my "style sheet" that braces always live on a seperate line, commas are always followed by spaces, and spaces always surround operators.
Somebody else could then take my code and in their style sheet, specify that no unnecessary spaces should be visible, braces should always be on the same line as their predecessor, and functions should always be separated by 3 line breaks. But the code itself should not actually change.
Is there such a tool?
I don't think such a thing exists, the best solution is to have a custom style for local coding (most IDE's allow this) and then use a tool to reformat your source code (like Jalopy for Java) when you commit it centrally.
That way you have something that's common centrally, but can still style how you want locally.
I don't know of any tool that can arbitrarily apply a style to code without actually modifying the text itself. Since you need to edit the code, that seems impractical.
This is called code formatting and if you google "code formatter" and your language of choice you should get a list of available options.
Try some eclipse based IDE (Aptana) or eclipse itsefl and and from there you can configure how the formatting works :)