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 with CNC10 v2.38 and below

You may sometimes find that the Alt- and Ctrl-key shortcuts will stop working: Ctrl-key shortcuts will just insert strange sequences in your file (e.g. you press Ctrl-S to quit and NEdit inserts "<dc3>" instead); Alt-key shortcuts will insert the unmodified character (e.g. you press Alt-F for the file menu and NEdit inserts "f" instead).

Centroid and other online references will tell you that the keyboard shortcuts will not work unless CAPS LOCK and NUM LOCK are both OFF. This may be true, so try turning off CAPS LOCK and NUM LOCK first, if either is on.

However, it appears there is something else going on, as the Alt- and Ctrl-key shortcuts can also stop working, seemingly at random, even without CAPS LOCK or NUM LOCK.

The most reliable solution is to plug in a mouse (a PS/2 type mouse if you have CNC10 software earlier than v2.60; either a PS/2 mouse or a USB mouse with CNC10 version 2.60 and later). Then you can simply click on the File menu, Save option, Quit option, etc..

Lacking a mouse, if you have a "Windows" keyboard plugged in, try pressing the "menu" key on your keyboard (usually to the right of the space bar). Then press ESC to dismiss the resulting menu. In several cases I have found that this sequence restores correct operation of the Alt- and Ctrl-key shortcuts.

If that is not an option, 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 several times to switch away from the editor and back. Double-check that CAPS LOCK is off.

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.

Sometimes when you press Ctrl-F for Find, Ctrl-O for Open, or another command that brings up a floating dialog box, you will find that keyboard focus stays in the edit window instead of shifting to the dialog box.

You can tell this has happened because the blinking cursor will still be in your text: the cursor in the Find box or other dialog box will not be blinking. In this case too, you can get the focus into the dialog box where it belongs by using Alt-Tab multiple times, to jump to the CNC10 control software, then back to NEdit.

More Information

Much, much more information can be found at

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) with CNC10 v2.7x use 25 X 85.
    For Low Resolution screens (10.4/9.4 LCD screens or older CRT monitors) with CNC10 v2.3x use 31 X 85.
    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.


Copyright © 2021 Marc Leonard
Last updated 01-Sep-2021 MBL