TranslateProject/sources/tech/20201223 How to use the Eclipse IDE as your text editor.md
DarkSun 47232fc9c6 选题[tech]: 20201223 How to use the Eclipse IDE as your text editor
sources/tech/20201223 How to use the Eclipse IDE as your text editor.md
2020-12-24 05:00:59 +08:00

6.4 KiB
Raw Blame History

How to use the Eclipse IDE as your text editor

Though technically an IDE, Eclipse offers a robust editing suite with lots of extensions to give you the tools you need. Women in computing and open source v5

Eclipse is an IDE (integrated development environment). Its definitely not a text editor. Then again, an IDE is really just a text editor with a lot of extra features for specific kinds of text. Furthermore, an IDE is often home to a developer. Developers have their IDE of choice open all day long, so its natural to stay in that IDE when its time to write a project README file, or to jot down a quick note, or to just make a grocery list. So sometimes, an IDE is just a text editor, after all.

Installing

One of Eclipses advantages as a platform is that its wildly popular. Its the default Java IDE in many a classroom and business, and its easy to obtain regardless of your operating system.

On Linux, you can install Eclipse from your software repository.

On Mac or Windows, download an installer from eclipse.org.

Eclipse is a big project, so if you have a favorite programming language, you can download a version of Eclipse tuned specifically for that language. However, you cant go wrong by just downloading the Java one and adding extensions to it for further development options.

Launching Eclipse

When you first launch Eclipse, youre prompted to establish a workspace. This is a useful convention of many IDEs, designed to ensure that all of your active development libraries and projects are centrally located on your computer. This way, you dont throw out a directory of libraries and headers youve forgotten your project relies upon, and youre less likely to bundle in libraries from your base system, forgetting that your users will need to install them separately before running your code. The default location for Eclipses workspace is ~/eclipse-workspace.

eclipse workspace with white text on grey background

Eclipse projects

Eclipse is designed for formal projects. It assumes that youre building an application or command or library consisting of many related files. Even when you create a text file, Eclipse assumes that its probably a README or a configuration file for your project. If you want to use Eclipse to create arbitrary text files that are not associated with a code project, then you can create a project file just for your text files.

To create a new project, navigate to the File menu and select New Project. From the list of project templates, select General. Once you have a project created, you can use it to store arbitrary text files created and maintained within Eclipse.

Extensions

By default, Eclipse is adept with XML and can handle plain text adequately. I write in XML whenever I get the chance, and Eclipse makes for an excellent XML workbench. If you dont write in XML for fun, though, you might prefer to have syntax highlighting for your favorite syntax, too. Eclipse is extensible, so you can install plugins to add to its features.

One of my favorite plugins is LiClipseText, a configurable syntax highlighter for several text formats. To install it (or any Eclipse extension), navigate to the Help menu and select Eclipse Marketplace. Search the Marketplace for LiClipse, and then click the Install button on the result. Depending on the speed of your Internet and computer, wait for the extension to install, and then allow Eclipse to restart so it can load the extension into your environment.

Eclipse marketplace showing available editors

In my experience, most document format plugins are activated according to file extension association. In other words, when I open a file with a name ending in .md or .mdown, LiClipseText is enabled in the text editing window. You can adjust file associations in Eclipses preferences in case you want to override defaults loaded by an extension or by Eclipse itself.

Eclipse for text editing

Writing in Eclipse feels very natural. After all, Eclipse primarily operates upon text anyway, so its well equipped whether your text contains code or natural language. In fact, Ive found that there are some small bonuses to using a code editor like Eclipse for natural language processing. For instance, the occurrence marker in Eclipse highlights all occurrences of a specific term. When programming, this is useful so you can visualize where variables and functions are being used. When youre writing, you can activate the same feature, and Ive found that it helps me keep the terms Im using consistent, and by contrast, it helps me detect overuse of any given phrase.

Eclipse can also handle diffs and patches with ease, and its got version control integration, so synchronizing work between computers is trivial.

Whether you use Eclipse as your primary text editor or just for required text files youre bundling along with applications you develop, its a great platform for writing.

How to set up your Eclipse environment with Python and EASE, and a few ideas to supercharge your...


via: https://opensource.com/article/20/12/eclipse

作者:Seth Kenlon 选题:lujun9972 译者:译者ID 校对:校对者ID

本文由 LCTT 原创编译,Linux中国 荣誉推出