How to change the line ending used in Netbeans - netbeans

Netbeans has this wiki entry on line endings: http://wiki.netbeans.org/FaqEditorEOLs
But it isn't very useful. It just says that you shouldn't develop on different OS and that's that...
In my situation however, I have no power over it. I'm on a windows machine and the PHP app I'm working on needs to end with the UNIX EOL.
There does not seem to be an option to set this for new files. Can anyone tell me where to set this?

Just saw that you can set this as a command-line startup flag: -J-Dline.separator=LF
I haven't tested this myself but I'm looking for ways to bake this into the configs somehow.

Since, a specific plug-in came out: http://plugins.netbeans.org/PluginPortal/faces/PluginDetailPage.jsp?pluginid=36810
I also like #JimLewis suggestion but I work on Windows with a linux virtual machine thus in some cases the versioning system line ending cannot help.
[update 201709]
I no longer use netbeans (sorry, but I need python support and it's too buggy) and almost no longer develop on windows, but #marinos-an in a comment suggests https://github.com/welovecoding/editorconfig-netbeans which uses a common setting file that can be picked up by multiple editors through plugins. Definitely interesting to try since the settings file is committable!

Have you considered managing the line endings at the version control level? Subversion,
for example, lets you set an "eol-style" attribute with values "LF", "CR", "CRLF",
and "native" (which translates the line endings stored in the repository to whatever
is appropriate for the platform where the files are being checked out, and converts
the other way when you check in.)

Please use following Netbeans Plugin
http://plugins.netbeans.org/plugin/36810/show-and-change-line-endings

fentie's answer solved my problem with line endings, as pasting multi-line MySQL from NetBeans into the MySQL command prompt caused errors.
To pass this argument to NetBeans every time it opens, add it to the netbeans.conf file:
/Applications/NetBeans/NetBeans\ 7.1.2.app/Contents/Resources/NetBeans/etc/netbeans.conf on OS X.
From the NetBeans Mac page under Tips & Tricks.
When I pasted multi-line SQL statements from NetBeans to the MySQL command line client on OS X or a remote Linux server, MySQL would list all possible command choices, give me some strange '> type of prompt and I was forced to hit Ctrl+C and log back into MySQL again.

For my Netbeans 12.6
I found a pluging called "Change Line Endings on Save"
https://plugins.netbeans.apache.org/catalogue/?id=31
more details are there
https://github.com/junichi11/netbeans-change-lf
once pluging installed you can configure EOL in there:
Tools > Options > Editor > Line Endings

Related

How can I enable file path autocompletion in the IPython console in PyCharm?

Note: The suboptimal autocompletion (not necessarily of file paths only, but autocompletion in general) is a known issue, and there seems to be no generic quality solution yet. Please see the researched links below.
Path autocompletion in the IPython console in PyCharm does not work well:
c:/U<TAB>
should autocomplete to:
cd c:/Users/
on my machine; instead, the best it manages is:
cd c:/UserWarning
which is plain wrong. IPython in the Anaconda prompt, however, behaves as it should.
My strong assumption (supported by a link, below) is that this is due to PyCharm not using the standard IPython configuration files.
I'm aware of the console starting script in PyCharm:
Settings->Build, Execution, Deployment->Console->Python console
and I've successfully used it to activate a simple magic command I've written.
So here my question: is there a code configuration snippet that could be inserted there, and that could just enable file path autocompletion? Or a pointer to a general description on how IPython configuration files "work", that would enable me to figure it out myself? That is, I imagine, the most doable hack that would solve the problem for the time being.
Alternatively, any experiences with writing your own autocompletion using the following libraries:
IPython.core.completer
IPython.core.completerlib
?
Is that doable? How much work can that be?
Thanks in advance!
My SW-Setup:
I use:
PyCharm Community Edition 2017.2.1
Anaconda 2 (Python 2.7), version 4.3.22 which contains
IPython 5.1.0
on Windows 7 Professional N
Links supporting claims in the question(s) above - just two, due to lack of StackOverflow-"reputation" :(
1) Autocompletion in IPython console in PyCharm not working as it should
JetBrains (creators of PyCharm) knows about this since, at least, two years (please Google it under "PyCharm Console tab completion" or similar, I'm allowed to add just a limited number of links here), and seems to have started working on it, but never finished it.
The discussion states " this is only the initial step to getting full IPython tab completions": https://youtrack.jetbrains.com/issue/PY-9345, but the issue is closed since October 2016.
On StackOverflow there are three questions with similar wording, but not one substantial answer (no, using Ctrl+Space instead of Tab does not solve anything). Again, I can't add more links here.
_2) PyCharm not using ipython_config.py to configure IPython Console:_
https://intellij-support.jetbrains.com/hc/en-us/community/posts/206603035-Which-ipython-config-py-is-used-to-configure-IPython-for-Python-Console-
See the comment by JetBrains at the end of the page.

Perl syntax is not highlighted

I have Eclipse SDK Version: 3.5.2 with EPIC 0.5.46 installed on Ubuntu Linux. I was writing some Perl code which I could run/debug correctly. The syntax was always highlighted. recently I had to add one *.pl file to my project and debug it. However, for some reason, the code is not being highlighted. What might be the reason for this behavior? My guess was that maybe there is some issue with Eclipse/EPIC adding/importing new files to the existing project but I'm not sure. Please consider even basic mistakes with Eclipse/EPIC configuration and projects management since I'm new to it. Thanks!
It seems that I found the problem which was preventing my Perl code from being highlighted. I've noticed that in the first lines of my .pl file, there is a commented line which include a weird ? symbol as appears on the screenshot below:
The moment I removed this symbol, all the code became highlighted! So it seems that there was some issue with text encoding which prevented Eclipse ho highlight the coded correctly.
You should right-click the file and then open with "epic perl editor", then everything will be fine!

Eclipse IDE; Open in current window / instance?

I've been using Eclipse for about a week now and I'm loving it.. great software for the 'price'. :P However, I'm having a few issues getting started.
The most annoying, so far, has been opening files from outside of Eclipse, and having them set to open w/ Eclipse. When I open a file from the file-explorer or an external application (WinSCP for instance), Eclipse seemingly attempts to open an entirely new instance itself rather than opening the file within a currently running instance. Of course, because this is the case, Eclipse errors out w/ 'The workspace is currently in use. Please select another' (or whatever it says).
Is there a configuration option, or an argument that I can use when opening a file externally that will simply use the currently open instance of Eclipse?
Thx in advance! :)
The easiest way to open external file in the current Eclipse is to drag-n-drop it to the tabbed area where your files are displayed. You should consider that Eclipse is seriously geared towards using files as part of a project and opening random file with Eclipse is certainly possible but not encouraged.
To your question - since Eclipse runs in Java if you attempt to use eclipse.exe to open a file then script will always try to open a new instance, I don't know if what you want is actually doable
To add to DroidIn.net's answer, here are a few eclipse bugs related to the question:
bug 4922 (from 2001!): "Need ability to open a file in eclipse from the command line", with sockent-monitoring kind of solutions, like the IBM proposition of opening an RCP from an URL, which leads to plugins like EclipseCalls.
EclipseCall is a plugin that accepts file-open requests on a defined socket port. A specialized client can be used to open a file in Eclipse by command from outside Eclipse, e.g. by double clicking a source file in Windows Explorer.
bug 178927 (2007): "way to pass arguments from launcher to a running application instance", based on a modifier launcher (more Windows-oriented, although bug 201154 is mac-oriented). An OSGi-based solution is also investigated.
(On Linux, see also steb)
In a Mac terminal, you can use open, though I needed to point to the executable explicitly, since I have more than one Eclipse installed:
open -a ~/eclipse/java-oxygen/Eclipse.app --args --launcher.openFile filename
You may or may not need --launcher.openFile, depending if you have --launcher.defaultAction set to openFile in your eclipse.ini file. (This config-file edit is also what you need for double-clicking or "open-with" to use the running Eclipse.)
For instance, I could do this (with gnu parallel) to open all of my failing tests after I'd copied to the clipboard (pbpaste is mac-specific):
pbpaste | parallel find . -name {}\\\* -print \
| parallel open -a ~/eclipse/java-oxygen/Eclipse.app
The Eclipse file-opening documentation for all OSes is here.

Completely change IDE language in Netbeans 6.8

I installed the lastest version from NetBeans IDE (6.8). I tried to install it in English, but it forces me to install it in Portuguese (OS Language). I've googled about it and I found that I should add --locale en:US when launching the program.
It almost works perfectly: some things are still in portuguese. For example, the descriptions from the Tasks tab and the Services tab's name.
Is it possible to change it, without having to change my OS' language?
Thank you.
Netbeans automatically uses the Windows system default language as the default user interface language. I believe that it means to be a nice feature for localization. But I personally find it uncomfortable because I have been used with English interface.
After I did some Google search, I learned a few tips to set the Netbeans UI language.
1. Temporary Solution
Add "--locale en:US" at the end of Netbeans startup command.
"C:\Program Files\NetBeans6.8\bin\netbeans.exe" --locale en:US
2. Permanent Solution
Go to Netbeans installation directory, for example,
C:\Program Files\NetBeans6.8\etc
Open "netbeans.conf" and find netbeans default option line
netbeans_default_options="-J-client -J-Xss2m -J-Xms32m -J-XX:PermSize=32m -J-XX:MaxPermSize=200m -J-Xverify:none -J-Dapple.laf.useScreenMenuBar=true"
Add "-J-Duser.language=en -J-Duser.region=US" to the end of this line
netbeans_default_options="-J-client -J-Xss2m -J-Xms32m -J-XX:PermSize=32m -J-XX:MaxPermSize=200m -J-Xverify:none -J-Dapple.laf.useScreenMenuBar=true -J-Duser.language=en -J-Duser.region=US"
It would be nice that there is an option to allow me choose the user interface language in the next Netbeans release.

How can I set up Eclipse to edit Perl without the runtime checking?

I'm working on a project that include both Java (on the client side) and Perl (on the server side), and I would really like to use Eclipse to edit my Perl scripts instead of going to another editor. I've tried to use the EPIC plugin. However, I have no way of setting up a run environment for these scripts on my local machine, so the plugin displays all kinds of errors related to missing libraries and other external dependencies.
I just want a text editor with nice syntax highlighting for Perl. Any suggestions? Any way that you can turn off the runtime error checking when using the EPIC plugin? I wasn't able to find anything with a quick search.
It isn't a setting, per se, in the workbench. It's a per-project setting.
While in your Perl project, select Project->Properties. In that dialog, click on "Builders". You probably have just the one-- "Perl Auto Builder". De-select it and click "Ok".
Unfortunately, you'll have to do this for each separate Perl project.
You could try Perlipse, which appears to be an active project.
You didn't indicate your OS. Try Padre - it is cross-platform. It can be installed with the CPAN shell (if you use Strawberry Perl on Windows, you will need at least the version from October). Padre is still rapidly evolving, but already has support for Perl 5 and 6 (6 will require a plugin). HTML, JavaScript and CSS (also with plugins). Many other plugins are already written, for example for Perl::Critic.
Emacs is a great text editor for Perl.
cperl-mode has the best Perl syntax highlighting support of any
editor (even Padre), and Emacs should meet all of your editing needs.
It is easily scriptable, and there are thousands of extensions
available for it. (Some even make support for Perl better, like Stylish::REPL.)
Use EditPlus, simplest editor for syntax highlighting. Works well for Perl.