18

I used vim for a long time, but switched to Sublime Text last year for most of my programming work.

Now, every time I have to make use of a console editor (mostly over ssh), I feel extremely uncomfortable with vim. The shortcuts and commands have slowly left my memory, my once carefully curated vimrc is gathering dust, and I just can't use the editor effectively without re-learning everything.

On the other hand, nano is just dumb. Great for opening a file, adding a flag and closing it, but way too primitive for anything else.

Is there something in between I can use? I can settle for not-as-easy-as-nano-nor-as-powerful-as-vim.

salezica
  • 74,081
  • 25
  • 105
  • 166
  • 5
    Learn ed, [the standard text editor](https://www.gnu.org/fun/jokes/ed-msg.txt)! (Runs and hides...) – larsks Feb 02 '13 at 02:05
  • 4
    But seriously: There's not a lot of action in the "console editor" market. Other than `emacs`, `vi`-clones, and `nano`, I'm not sure there's much out there. You could try [joe](http://joe-editor.sourceforge.net/). You could try adopting a version-control based workflow where you're doing all your editing with sublime locally, and then pushing your changes to remote systems. Or you could just stick with `vim`, because it's typically there wherever you are. – larsks Feb 02 '13 at 02:14
  • Joe looks pretty good! Requires some configuration, but won't require memory after that – salezica Feb 02 '13 at 05:28

5 Answers5

22

You can use mcedit. It is much more user friendly than other editors - it even supports mouse over ssh (even in Putty console from Windows).

Simply install package Midnight Commander as follows:

  • Ubuntu/Debian:

    sudo apt-get install mc
    
  • Fedora/Redhat:

    sudo yum install mc
    
  • MacOS:

    brew install mc
    

and it will make mcedit available.

In local console it even supports Shift+Del, Shift+Ins, Ctrl+Ins shortcuts that we use in Windows.

It also has nice ability to copy blocks into arbitrary files, effectively giving you unlimited number of clipboards.

mvp
  • 111,019
  • 13
  • 122
  • 148
  • Wow, I love it! Why isn't this default? I didn't even know mouse-over-SSH was a thing! – jobukkit Sep 01 '17 at 14:48
  • I already had Midnight Commander installed and didn't even realize this was included with it. Fantastic! – Jay Jan 03 '18 at 21:48
3

You could try these, but you'll have to install them on the machines you SSH into:

But my opinion is that you should drop the seriously underpowered Sublime and go back to Vim.

$ vimtutor is your friend.

romainl
  • 186,200
  • 21
  • 280
  • 313
  • 4
    Have you tried using Sublime for a significant amount of time? There's nothing underpowered about it. It has everything you can expect from an editor, plus things I had never seen before (such as dead-easy multiple cursors) – salezica Feb 02 '13 at 14:59
  • Have you tried Vim or Emacs for a significant amount of time? The amount of effort needed to perform simple tasks like duplicating lines, moving around in a file or removing an HTML tag in Sublime Text is stagering when you come from Vim. And yes, I've tried to like the famous multi-cursor but I found it too gimmicky. – romainl Feb 02 '13 at 23:17
  • 1
    Yes I have! I loved VIM. I would take a second look at Sublime if I were you :) There are plugins that make all the tasks you mentioned instantaneous, just like in VIM; and you can always roll out your own (in Python!) over a pretty simple API. – salezica Feb 03 '13 at 17:18
  • This blog post is a joke. 1. Vintage covers less than 1% of Vim which is far from being enough for relatively advanced Vim users. The simple fact that you can't combine operators with search or marks is quite a show stopper. VintageEx helps a lot on that front and it isn't even mentioned in the post. 2. Mappings are also very easy in Vim. 3. Vim has that too, kind of, and the plugin ecosystem is quite a bit larger. 4. `:h :mksession`. 5. CtrlP, FuzzyFinder, Command-T, LustyExplorer, wildmenu, etc. Seriously… ST is a great alternative if you don't know Vim or don't know it well. – romainl Feb 03 '13 at 18:26
  • But if you are a relatively advanced Vimmer, *nothing* in ST can be compelling enough to make the switch. The same list is *always* put forward and people always repeat the same misinformed arguments about vintage. If someone *really* thinks that vintage "has most vim support" it just means that he/she has never been further than `vimtutor`. Which is not a problem per se but doesn't really make for serious credentials when talking about Vim capabilities. – romainl Feb 03 '13 at 20:32
  • I think you're not taking into account the fact that you've put hundreds of times more energy into mastering VIM than you have into using Sublime. Different is not worse. ST is fully scriptable, so there's little you cannot do. – salezica Feb 04 '13 at 04:16
  • 1
    Vim is a hell of a lot more powerful and expressive than ST without any plugin. The motions, text-object, composability of commands, Ex commands, ranges, macros, crazily powerful folding, substitution engine, tags navigation, top notch help… you get all that by default. Yes, what you just said is at the core of my argument: ST is great and might be good if you are a beginner Vimmer but switching is pointless if you have invested a lot of time into mastering Vim. I don't know about you but "this tool does a subset of what your current tool does and a few other niceties" is not enough to make me – romainl Feb 04 '13 at 06:42
  • 1
    consider switching. An alternative editor should be *at least* as capable as my current editor and fix some problems that I face everyday. Since ST does a lot less than Vim and I don't have any problem with Vim then switching would be useless and worthless. – romainl Feb 04 '13 at 06:48
2

If you want to learn a text editor that's available on just about every machine you could possibly SSH into, basically your only options are vim, emacs, nano, and ed.

Emacs is an okay choice, so long as you can remember c-x c-s (save) and c-x c-c (close)… But that's only two fewer commands than you need to remember with vim (i for insert mode, <esc> for normal mode, :w to save, and :q to quit).

Possibly a better alternative would be to run X11 locally, so you can use gedit, gvim, or one of the other graphical editors from the remote machine? Or maybe print off a couple of cheat sheets (see: https://stackoverflow.com/questions/442057/what-is-your-linux-vim-cheat-sheet) and keep them on your person at all times?

Community
  • 1
  • 1
David Wolever
  • 148,955
  • 89
  • 346
  • 502
2

I haven't personally used it, but the Cream flavor of Vim modifies Vim with more standard-style mappings (e.g. CTRL-F for Find), no modal editing (normal vs. insert mode) as in Vi(m), and it also works in the console (with menus). Maybe that makes Vim suitable to you.

Ingo Karkat
  • 167,457
  • 16
  • 250
  • 324
  • 1
    `Cream` seems cool, but it uses gVim, blaming limitations in the command-line environment for this requirement. Is there a CLI equivalent? – salezica Feb 02 '13 at 14:58
  • 1
    Its FAQ says its not supported, but hints that it could (partially) work. As I said, I have never used it. – Ingo Karkat Feb 02 '13 at 18:31
2

Since you're a Sublime user, you'll probably feel comfortable with Suplemon https://github.com/richrd/suplemon.

It's a bit like Sublime and it's specifically created to be easy and powerfull at the same time. It also has multiple cursors and similar key mapping as Sublime. It's written in Python and supports addon modules. Hopefully one day it'll support Sublime packages too.

Disclaimer: I'm the developer of Suplemon.

Richrd
  • 6,722
  • 1
  • 17
  • 12