7

I seek an editor where Ctrl+C copies, Ctrl+X cuts, Ctrl+V pastes, Ctrl+Z undos, Ctrl+Y redos, F3 searches and F2 renames. When I click the left mouse button, the cursor should go there. All modes should be active at the same time (command and insert and ...).

Also Ctrl+W closes the current tab in tabbed interfaces, Alt+F4 closes the currently focused app, Ctrl+Tab tabs between guess what, tabs, Ctrl+O brings up open dialog, Ctrl+P brings up print dialog,

What Linux editor exists out there that can be used in the terminal and has that behavior?

qwr
  • 2,969

5 Answers5

14

What are "universal shortcuts"? There is something like a "universe" but there are no "universal shortcuts". It is a subjective term. Many vim users will consider the vim shortcuts "universal" and do everything to change different keybindings to resemble these of Vim.

The keyboard shortcuts you mention resemble these that are quite common in graphical environments. There is a terminal based text editor, micro, that implements this style of shortcuts. It is available as a Snap in the software center of Ubuntu. At least in Ubuntu 19.04, it is also available as an APT package.

vanadium
  • 97,564
4

These keystrokes are not "universal." They are part of an IBM project called "Common User Access" (CUA).

Vim can do what you're asking if you install the cua-mode plugin. (Note that this plugin is very old and has not been updated in a long time; I have no idea if it will work with the current version of vim. I only add it here because it is the first link DuckDuckGo returned to me when I searched.)

MDeBusk
  • 1,386
1

Mine. I wrote a text editor exactly for this reason. Unfortunately I don't have a ready-made installer but as long as you have Tcl installed (and optionally Tk for clipboard support) you should be able to use it. It's just a single file of code: https://github.com/slebetman/tcled

Just place the tcled file somewhere in your $PATH and make it executable by doing chmod +x.

If you don't like my editor there's also slap which is quite nice: https://github.com/slap-editor/slap. It tries to implement a terminal editor that feels like sublime.

Unlike my editor you can easily install slap via npm (you need node.js installed of course):

sudo npm install -g slap

Honestly I would recommend using slap but I could not resist plugging my own software . The number of users for tcled is around a dozen (mostly people who need a better editor than plain vi on routers and embedded devices - because almost all installs of Linux come with tcl pre-installed so installing my editor is just copying a single text file).

slebetman
  • 274
1

texteditors.org provides a long list of text editors that use this type of keyboard shortcuts, also known as Common User Access (CUA) shortcuts. Here are some of the more current and available examples.

Cream : Vim editor repackaged to use CUA look and feel

CTE : The standard CUA editor for the Linux console

Micro : "a modern and intuitive terminal-based text editor"

PE64 : IBM Personal Editor

PyPE : Python-centric text editor that uses does code folding

TDE : Thomson-Davis Editor (public domain, DOS, Windows, Linux)

SetEdit : Borland-style text editor

THE : The Hessling Editor - open source multi-platform XEDIT clone

Tilde : Open source comfortable Linux editor for those used to GUI editors

X2 : a multiplatform text editor much like SlickEdit and the IbmEditorFamily.

additionally, many of the available text editors let you reconfigure the shortcuts.

0

These were standardized across IBM products including the PC in 1987 with their Common User Access project.

Many of them were copied from the earlier original Macintosh/Xerox ideas (1984) (with Command mapped to Control on PC keyboards), while there another large set were from other existing GUI apps at the time (such as Shift+Insert for paste). Which is why there are often two ways to do things. (e.g. Ctrl+Q and Alt+F4)

Microsoft found the Mac HIG/shortcuts appealing when creating Word and Excel over there and started using them in Windows before IBM and later (in the early 90s) brought them to DOS editors as well.

These new standards made their way to Unix with Motif and later CDE starting in 1988. Most Unix-like FLOSS desktops in the 90s copied this standard, as everyone knew them already.

Traditional Unix terminal editors preceded all this by a decade or two and weren't interested in changing. So that leaves just a few newcomers to take on the mantle of standard keybindings.

Early:

  • rhide, setedit (Turbo-vision editor clones, no longer packaged)
  • ne (nice editor, used this for years; not well known; tiny)
  • nano (must be extensively configured, support improved over the years; small)

Later:

  • vim (small to medium size)
  • emacs (gigantic)
  • tilde (not often packaged)

CUA modes were brought to these venerable editors but also incur a significant learning curve. Probably more than most folks want for their "notepad" clone.

Recent:

  • micro (in Debian and 20.04+)

Pretty darn big (12+ MB) and lacks a standard menu, but is otherwise excellent.

My recommendation is to use micro, unless you are in constrained environment such as OpenWRT, then use nano or ne.