Console editor: something between VIM and nano?
Solution 1
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.
Solution 2
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.
Solution 3
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.
Solution 4
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?
Solution 5
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.
Related videos on Youtube
slezica
Updated on February 10, 2020Comments
-
slezica about 4 years
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 withvim
. The shortcuts and commands have slowly left my memory, my once carefully curatedvimrc
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.
-
larsks over 11 yearsLearn ed, the standard text editor! (Runs and hides...)
-
larsks over 11 yearsBut seriously: There's not a lot of action in the "console editor" market. Other than
emacs
,vi
-clones, andnano
, I'm not sure there's much out there. You could try joe. 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 withvim
, because it's typically there wherever you are. -
slezica over 11 yearsJoe looks pretty good! Requires some configuration, but won't require memory after that
-
-
slezica over 11 years
Cream
seems cool, but it uses gVim, blaming limitations in the command-line environment for this requirement. Is there a CLI equivalent? -
slezica over 11 yearsHave 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)
-
Ingo Karkat over 11 yearsIts FAQ says its not supported, but hints that it could (partially) work. As I said, I have never used it.
-
romainl over 11 yearsHave 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.
-
slezica about 11 yearsYes 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.
-
romainl about 11 yearsThis 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 about 11 yearsBut 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. -
slezica about 11 yearsI 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.
-
romainl about 11 yearsVim 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 about 11 yearsconsider 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.
-
jobukkit over 6 yearsWow, I love it! Why isn't this default? I didn't even know mouse-over-SSH was a thing!
-
Jay over 6 yearsI already had Midnight Commander installed and didn't even realize this was included with it. Fantastic!