简体   繁体   English

控制台编辑器:VIM和nano之间的东西?

[英]Console editor: something between VIM and nano?

I used vim for a long time, but switched to Sublime Text last year for most of my programming work. 我使用vim很长一段时间,但去年我的大部分编程工作都改用了Sublime Text。

Now, every time I have to make use of a console editor (mostly over ssh ), I feel extremely uncomfortable with vim . 现在,每次我必须使用控制台编辑器(主要是通过ssh ),我对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. 快捷方式和命令慢慢地留下了我的记忆,我曾经精心策划的vimrc正在收集灰尘,而我无法在不重新学习所有内容的情况下有效地使用编辑器。

On the other hand, nano is just dumb. 另一方面, nano只是愚蠢。 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 . 你可以使用mcedit It is much more user friendly than other editors - it even supports mouse over ssh (even in Putty console from Windows). 它比其他编辑器更加用户友好 - 它甚至支持鼠标悬停在ssh上(甚至在Windows的Putty控制台中)。

Simply install package Midnight Commander as follows: 只需按如下方式安装Midnight Commander包:

  • Ubuntu/Debian: Ubuntu的/ Debian的:

     sudo apt-get install mc 
  • Fedora/Redhat: 于Fedora /红帽:

     sudo yum install mc 
  • MacOS: 苹果系统:

     brew install mc 

and it will make mcedit available. 它会使mcedit可用。

In local console it even supports Shift+Del , Shift+Ins , Ctrl+Ins shortcuts that we use in Windows. 在本地控制台中,它甚至支持我们在Windows中使用的Shift+DelShift+InsCtrl+Ins快捷方式。

It also has nice ability to copy blocks into arbitrary files, effectively giving you unlimited number of clipboards. 它还具有将块复制到任意文件的能力,有效地为您提供无限数量的剪贴板。

You could try these, but you'll have to install them on the machines you SSH into: 您可以尝试这些,但是您必须在SSH到的机器上安装它们:

But my opinion is that you should drop the seriously underpowered Sublime and go back to Vim. 但我的意见是你应该放弃严重不足的Sublime并回到Vim。

$ vimtutor is your friend. $ vimtutor是你的朋友。

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. 如果你想学习几乎可以通过SSH连接的每台机器上的文本编辑器,基本上你唯一的选择是vim,emacs,nano和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). Emacs是一个不错的选择,只要你能记住cx cs (保存)和cx cc (关闭)......但是这只比你需要记住的命令少了两个( i用于插入模式, <esc>用于普通模式, :w保存,并且:q退出)。

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? 可能更好的替代方案是在本地运行X11,因此您可以使用geditgvim或远程计算机上的其他图形编辑器之一? 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? 或者可以打印几张备忘单(参见: https//stackoverflow.com/questions/442057/what-is-your-linux-vim-cheat-sheet )并随时将它们保存在您的人身上?

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). 我没有亲自使用它,但是VimCream风味用更多的标准样式映射修改Vim(例如用于Find的CTRL-F),没有模态编辑(正常与插入模式),如Vi(m),它也适用于控制台(带菜单)。 Maybe that makes Vim suitable to you. 也许这让Vim适合你。

Since you're a Sublime user, you'll probably feel comfortable with Suplemon https://github.com/richrd/suplemon . 既然你是一个Sublime用户,你可能会对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. 它有点像Sublime,它专门创建为同时容易和强大。 It also has multiple cursors and similar key mapping as Sublime. 它还具有多个游标和与Sublime类似的键映射。 It's written in Python and supports addon modules. 它是用Python编写的,支持插件模块。 Hopefully one day it'll support Sublime packages too. 希望有一天它也会支持Sublime软件包。

Disclaimer: I'm the developer of Suplemon. 免责声明:我是Suplemon的开发者。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM