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.
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.
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 cx cs
(save) and cx cc
(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?
I haven't personally used it, but the Cream flavor of Vim modifies Vim with more standard-style mappings (eg 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.
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.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.