an IntelliJ IDEA question

J

Jerry

I remembered that I changed the line ediing of my code to unix-like
ended line "\n" so that when I opened the source code in UNIX, the code
will looks like the same as the code that is opened using IDEA in
Windows. I forgot to how I changed that. Anyone know how to do it?
Thanks a lot!
 
P

pp

I forgot to how I changed that. Anyone know how to do it?
How about using: java.lang.System.getProperty("line.separator")
Is this what you've wanted?
 
?

.

I remembered that I changed the line ediing of my code to unix-like
ended line "\n" so that when I opened the source code in UNIX, the code
will looks like the same as the code that is opened using IDEA in
Windows. I forgot to how I changed that. Anyone know how to do it?
Thanks a lot!

You didn't mention which version of IntelliJ/IDEA you are using. I'm using
version 4.5. If you are using the same this should work for you.

You can set the end of line character(s) either globally or on a project
by project basis. You can set the project template for new files:

* Make sure there are no projects open
* Go to the 'File' menu and select 'Settings'
* Go to the 'Template Project' tab, if necessary
* Select 'Project Code Style'
* On the right select 'Use global code style' radio button
* Select 'Edit Global Settings...' button
* At the bottom left select the appropriate setting for 'Line separator'

You can set the global settings for the IDE:

* Make sure there are no projects open
* Go to the 'File' menu and select 'Settings'
* Go to the 'IDE' tab, if necessary
* Select 'Global Code Style'
* On the right, select the 'General' tab
* Find 'Line separator' and choose the appropriate setting

If you have a project open then choosing 'Settings' will open the project
settings and 'Project Template Settings' will do the same as above.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,780
Messages
2,569,611
Members
45,273
Latest member
DamonShoem

Latest Threads

Top