Link with Editor feature of Eclipse

20150301_link

The Project Explorer and Outline views in Eclipse have a Link with Editor feature that can be very useful. This can be enabled in either view, by clicking the down arrow button in the view and choosing Link with Editor (see screenshot above).

  • If Link with Editor is enabled in Project Explorer: The current file open in the Editor will be highlighted in Project Explorer.

  • If Link with Editor is enabled in Outline: The class or method at the location of the cursor will be highlighted in Outline.

Tried with: Eclipse 4.4.1 Luna and Ubuntu 14.04

How to set editor used by sudoedit

sudoedit is the recommended command to use to edit files owned by the superuser. On many systems, it uses the nano editor to open these files. You might prefer to use a different editor like Vim to edit these files.

The man page for sudoedit says that the editor used is decided based on the environment variables EDITOR, SUDO_EDITOR or VISUAL. Setting these variables proved to be useless, since it did not affect the editor used by sudoedit.

The method that works is to run sudo update-alternatives --config editor and choose your preferred editor from the list that is displayed. It works and sudoedit starts using the editor you picked.

Tried with: Raspbian 7

How to use Quick Diff in Eclipse

Added, modified and deleted lines marked by Quick Diff in Eclipse editor.
Added, modified and deleted lines marked by Quick Diff in Eclipse editor.

Eclipse has support for version control systems like Git, SVN and CVS. Support for Mercurial can be enabled by using the MercurialEclipse plugin. When viewing files in version control, it is common practice to quickly see which of the lines are uncommitted compared to the current head (or parent) revision. This information can be viewed in Eclipse by using its Quick Diff feature. This is easy to do:

  1. Go to Window -> Preferences -> General -> Editors -> Text Editors -> Quick Diff. This is the dialog from where it can be configured.

  2. Turn on Quick Diff, by enabling the option Enable quick diff.

  3. Choose the version control system for which Quick Diff is needed from the dropdown Use this reference source. Git, SVN and CVS should be present here. Mercurial appears if the MercurialEclipse plugin is installed.

  4. The overview ruler is the ruler to the right of the scrollbar in the editor. If you would like to see the uncommitted lines to be marked on it, enable the option Show differences in overview ruler.

  5. Choose Apply and OK. Close all editor windows and reopen the source file that you want in the editor.

You should be able to see the newly added, modified or deleted lines marked in colors in the left bar on which line numbers are usually displayed. The colors used are the ones set in the Quick Diff dialog (see above steps). You can also view these uncommitted locations marked along the overview ruler on the right.

Tried with: Eclipse Luna 4.4.1 and Ubuntu 14.04

How to set editor used by Ranger

You might find that Ranger uses Nano as editor when you open text files. It does this if the EDITOR environment variable is not set.

To make Ranger use a different editor to open text files, just set this environment variable.

For example, in the Fish shell, I set the editor to vim by adding a line to ~/.config/fish/config.fish:

set -x EDITOR vim

Tried with: Ranger 1.6.1 and Ubuntu 14.04

Edit PDF using PDF-XChange Viewer

There has always been a dearth of good quality inexpensive tools to edit and annotate PDF documents. Most forms are today available as PDF files for download and I prefer to fill them out neatly on the computer, print and sign them. On Windows, PDF-XChange Viewer is a good tool for these tasks.

There is a newer version of this tool called PDF-XChange Editor that has more features and is paid-only software. However, the older PDF-XChange Viewer works fine for me and it is available free for academic use.

To add text to a PDF page: Tools > Comment And Markup Tools > Typewriter Tool > Default Style. Then click anywhere on the PDF page and start typing.

To move or edit text: single-click on the text to select the box of text, double-click to edit it.

To change the formatting of the text: right-click in edit mode and choose Show/Hide Text Formatting Toolbar. The toolbar appears at the top. Change the font or size and click the Make Default button to make this the default style.

Tried with: PDF-XChange Viewer 2.5 and Windows 7 x64

ReText

Markdown has become an essential file format, especially if you are sharing source code on Github or Bitbucket. ReText is a good Markdown editor for Ubuntu. It can be installed easily:

$ sudo apt install retext

I like to use ReText in the live preview mode where the resulting HTML is shown in a pane on the right. So, it acts as an excellent Markdown viewer too. I have no idea why this is not turned on by default.

Tried with: ReText 4.1.2 and Ubuntu 14.04

MarkdownPad: A markdown editor for Windows

The markdown format is increasingly used at websites like GitHub. Thus, there is a need for a simple markdown editor that can be used to edit and view markdown files.

MarkdownPad is a markdown editor for Windows which I found does this job well. Just download and install. Associate .md files with MarkdownPad, which can be found as MarkdownPad.appref-ms in the directory %USERPROFILE%\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\MarkdownPad

Tried with: MarkdownPad 1.3.5.8 and Windows 7 Professional x64

TeXstudio

TeXstudio

I was using Texmaker as my LaTeX editor on Windows until recently. It was sufficient as an editor, but I was not fully happy with its autocompletion and multi-file UI. I came across TeXstudio, which is a fork of Texmaker and it turns out it fills out all the features I felt were missing in Texmaker and it seems to be more updated. For example, the autocompletion of LaTeX commands, references and citations actually works. Also, if you have structured your document as multiple LaTeX files, compiling from any of them compiles the document. If you are a Texmaker user, do try out TeXstudio.

Tried with: TeXstudio 2.3 and Windows 7 64-bit