6

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,802
Saeed Neamati
  • 793
  • 2
  • 7
  • 20
  • Did you try any GUI editors like gedit or mousepad or VS Code ? – Archisman Panigrahi Jul 17 '21 at 07:14
  • VS Code is awesome. But it can't be installed on the server. That doesn't make sense. Thus I prefer another choice. I have not tested gedit or mousepad yet. I'll test them. But I just wanted to see if the community knows a compliant editor already. – Saeed Neamati Jul 17 '21 at 07:17
  • Mousepad and gedit are also GUI. See https://askubuntu.com/q/1227102/124466 for how to copy and paste into terminal (these work in nano, I don't know if they work in vi) – Archisman Panigrahi Jul 17 '21 at 07:18
  • 4
    Universal shortcuts??? The keys used by vi are the same for other tools, and were a standard created in the early 1970s. You want it to follow another later standard?? What is a universal shortcut? as to me the standard used by unix/posix/vi makes sense given so many *nix tools use them. – guiverc Jul 17 '21 at 07:19
  • 5
    Ummm... The history of these text editors, especially vi, go way way back, before there were window managers and mice. What you're describing is a GUI notepad. There are dozens of them. – Nmath Jul 17 '21 at 07:19
  • You can install VS Code/ium on your server and connect using X-Forwarding. – pLumo Jul 17 '21 at 08:38
  • 1
    @guiverc If you didn't start programming in the 70s or 80s but in the GUI world of the 90s and 00s, you will get used to exactly the shortcuts, OP mentioned. While I also disagree with the term universal, many people feel exactly like OP. I personally never got into nano, so I directly used vim and enjoy it. However, I am a poweruser, and cannot really recommend it to newcomers who want to edit a file once in a while in the terminal. So I really think this is a good question. With some less rant against other editors it would be very good :-) – pLumo Jul 17 '21 at 08:51
  • I agree @pLumo that it been worded without the off-topic rant it would have been a much better question. – guiverc Jul 17 '21 at 09:22
  • 1
    Re "We all know that Ctrl+C copies, Ctrl+X cuts, Ctrl+V pastes", no, we DON'T all know that. Unfortunately, we're stuck with those badly-designed Windoze commands when we use a browser (at least, I've never seen one where it's configurable). Elsewhere, many of us prefer to use a more rationale command set. And many, if not most, decent editors allow you to configure commands to your liking. So if you want Windoze-like commands, configure them, or find a profile from someone who's already done the work. – jamesqf Jul 17 '21 at 16:36
  • If you're ok with using a graphical text editor, gedit is surprisingly capable for a simple text editor – qwr Jul 17 '21 at 17:01

4 Answers4

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
  • 88,010
  • thanks for answering. Universal shortcuts are those shortcuts that you use almost everywhere and you don't care about the original vendor. You open Google Sheets and they work. You open an online form and they work in every text field. Yes they are part of graphical environment. But the terminal is also graphical isn't it? We see stuff there don't we? – Saeed Neamati Jul 17 '21 at 07:16
  • I read the README.md of micro and OMG, it says Common keybindings (Ctrl-s, Ctrl-c, Ctrl-v, Ctrl-z, …). and Sane defaults. This shows a lot of other people felt the pain I felt using those stupid vi and nano etc. – Saeed Neamati Jul 17 '21 at 07:21
  • 1
    @vnandium, thank you a million times. I immediately fell in love with this micro. It's just what I wanted. Productive from the first moment. No need for complex searches on how to copy paste in vi, or in nano. No need to spend 40 minutes to figure out what weird codes you should use to get a simple task done. No need to always worry and get tired of knowing your current environment. – Saeed Neamati Jul 17 '21 at 07:26
  • Glad you like it! I explored it some time ago. In 21.04 (but not in 20.04, I think), it is also available as a normal .deb package. – vanadium Jul 17 '21 at 07:44
  • +1 Didn't know about micro. While I will continue using vim, this is at last something to recommend to newcomers. – pLumo Jul 17 '21 at 08:48
  • Also know as the Macintosh/CUA/Windows accelerator key bindings. – Dan D. Jul 17 '21 at 15:13
  • VIM and EMACS have CUA modes. VIM has one called CREAM. – Dan D. Jul 17 '21 at 15:14
  • According to CUA, Ctrl+Ins is the copy key, Shift+Del the cut key and Shift+Ins the paste key ;-) – vanadium Jul 17 '21 at 15:22
  • You are being pedantic about universal shortcuts, are you gonna tell me Ctrl+C and Ctrl+V shortcuts for copy and paste are not used in every OS in some form and almost in every application with text input. It's pretty clear from OP's question what he's asking. – Ghos3t Sep 28 '22 at 15:44
  • @Ghos3t Downvoted the other answer, that tells the same, also? – vanadium Sep 29 '22 at 11:21
3

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,175
  • 2
  • 8
  • 21
  • 2
    The very word common means they are universal. Something that exists in Photoshop, Windows, Ubuntu, Word, Autocad, Notepad, Chrome, ... is universal. OK? so please don't even argue about that. – Saeed Neamati Jul 20 '21 at 16:21
  • 1
    I've been speaking English since I was a toddler and I'm very good at it. "Common" and "universal" are not synonyms. – MDeBusk Sep 27 '21 at 22:21
0

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
  • 264
0

texteditors.org provides a long list of text editors that use this type of keyboard shortcuts, also known as 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
  • 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.