CNC Services Northwest


NEdit Linux Text Editor

Version 1.51 of the CNC10 Linux-based control software saw the introduction of a new default text editor, called NEdit. Overall it is a vast improvement over the previous editor. There are, however, a few differences and a couple idiosyncrasies to get used to.

The Bare Essentials

Pressing ESC will no longer get you out of the editor. Therefore the one command you need to know is:

Ctrl-Q   Quit

If you have made any changes, you will be prompted whether you want to save them before quitting. Press Y or N as desired.

Alternately, you can save the file first with:

Ctrl-S   Save

More Details

NEdit is a menu-based editor, similar to Windows Notepad (but much more capable). All commands are available on drop-down menus. You can get into the menus with a mouse, if you have one connected, or by using Alt-key shortcuts as in Windows. For example, Alt-F will drop down the File menu; Alt-E will drop down the Edit menu; etc..

You can also activate the menus by pressing F10, then using arrow keys to navigate the menus.

The most common and useful commands have Ctrl-key shortcuts. As you browse through the drop-down menus, you will see the Ctrl-key shortcuts displayed next to their commands.

More Useful Commands

Shift-Arrows   Highlight (select) text
Crtl-X   Cut selected text and put it on the clipboard
Crtl-C   Copy selected text to the clipboard
Crtl-V   Paste contents of clipboard into the text
Crtl-F   Find text
Crtl-R   Find and replace text

File Names and Paths

If you use the Open or Save As commands, NEdit will display a dialog box and prompt for a file name to load or save. It will show the name of the current directory, and give you the opportunity to change directories if needed.

NEdit, however, is a native Linux program, not written by Centroid. It will therefore show native Linux directories, without translating into the simulated DOS/Windows format used in the Centroid software. The "C:" drive will appear as /cncroot/c. Most of your CNC G code files will be in /cncroot/c/cnc10/ncfiles (or /cncroot/c/cnc10t/ncfiles on Lathe controls). This is the same location as "c:\cnc10\ncfiles" or "c:\cnc10t\ncfiles" in the Centroid software menus.

Idiosyncrasies

The Alt- and Ctrl-key shortcuts will not work unless CAPS LOCK and NUM LOCK are both OFF.

Don't turn on NUM LOCK. Centroid has provided a startup script that makes the number pad keys work as numbers, even with NUM LOCK off.

In some rare circumstances (generally if you open more than one copy of the editor at a time) NUM LOCK can get turned back on automatically. Just press the NUM LOCK key to turn it off again.

If you turn on CAPS LOCK (for example, to enter nicer-looking G codes) then you should turn it back off as soon as you are done typing those G codes. You should do this automatically anyway, since you put useful comments in your G codes, and comments in ALL CAPS are ugly, right? :-)

In some circumstances, keyboard focus will return to the CNC10 control program, even though the editor window is still on the screen. This will cause you to get gray-and-yellow "Invalid Key" messages in the center of the screen as you try to type. To fix this, press Alt-Tab a couple times to switch tasks to CNC10 then back to the editor.

In some circumstances, the Alt- and Ctrl-key shortcuts will all stop working despite your best efforts. You may press Ctrl-Q to quit, and just get a control sequence like <xon> inserted in the file you are editing. You may then press Alt-F for the file menu and just get the letter F inserted. Try pressing F10 to activate the menu bar, then use arrow keys to navigate to Save and/or Quit. If that doesn't work, try using Alt-Tab to switch away from the editor and back. Double-check that CAPS LOCK is off.

More Information

Much, much more information can be found at NEdit.org.

Window Size on 640x480 Screens

The default installation provides a nice large editor window on a 1024x768 SVGA display (such as the 15" screens on post-2001 M400 controls and most M39 controls). Unfortunately, on older M400 controls with 9.4" or 10.4" LCD displays, much of the editor window is off the screen.

To change the NEdit window size to fit one of these 640x480 displays:

  1. Press Alt-P to drop down the Preferences menu.
  2. Use the right arrow key to bring up the Default Settings menu.
  3. Press the up arrow once to highlight Initial Window Size.
    Note: On Low Resolutions screens you will not see Initial Window Size because it is off the screen.
  4. Press the right arrow once to bring up the Initial Window Size menu.
  5. Move down to the Custom selection and press ENTER.
  6. For High Resolution screens (15" LCD screens or newer CRT monitors) use 45 X 120.
    For Low Resolution screens (10.4/9.4 LCD screens or older CRT monitors) use 31 X 87.
    Note: Use the TAB key to move to the next field.
  7. TAB over to the OK button and press ENTER.
  8. Press Ctrl-Q to quit and ENTER to save.

Changing the default font size

If your monitor is getting old and blurry, you may find the default font hard to read. You can tell NEdit to use a larger font, at the expense of a little less information on the screen.

To change the default font from size 12 to size 20:

  1. Press Alt-P to drop down the Preferences menu.
  2. Use the right arrow key to bring up the Default Settings menu.
  3. Press 'F' to select Text Fonts
  4. Press Tab twice to begin editing the name of the Primary Font.
    Initially it should read -misc-fixed-medium-r-normal--12-120-75-75-c-0-iso8859-1
  5. Change the numbers to read -misc-fixed-medium-r-normal--20-140-100-100-c-100-iso8859-1
  6. Press Tab to highlight the "Fill Highlight Fonts from Primary" button
  7. Press Space to set the names of the syntax highlighting fonts
  8. TAB down to the OK button and press ENTER.
  9. Press Ctrl-Q to quit and ENTER to save.

With the larger font, you won't be able to fit as many rows and columns on the screen. Follow the previous procedure to change your default window size to something that fits on the screen: perhaps 32 X 90 on a high resolution screen, or 22 X 60 on a low resolution screen.

Home

Copyright © 2008 Marc Leonard
Last updated 20-May-2008 MBL