windows 命令提示符中的基本文本编辑器?

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/19497399/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-09 11:00:40  来源:igfitidea点击:

Basic text editor in command prompt?

windowstextcmd

提问by Gpipes

I know for linux and Unix machines there is emacs and vi text editor and gcc is built in to compile c code? what would be the Windows text editor in cmd and are there any compilers built in?

我知道对于 linux 和 Unix 机器有 emacs 和 vi 文本编辑器,并且内置了 gcc 来编译 c 代码?什么是 cmd 中的 Windows 文本编辑器,是否有内置的编译器?

回答by gr1m

I made a simple VIM clone from batch to satisfy your needs.

我从批处理中制作了一个简单的 VIM 克隆来满足您的需求。

@echo off
title WinVim
color a
cls
echo WinVim 1.02
echo.
echo To save press CTRL+Z then press enter
echo.
echo Make sure to include extension in file name
set /p name=File Name:
copy con %name%
if exist %name% copy %name% + con

Hope this helps :)

希望这可以帮助 :)

回答by chiliNUT

There is also a port of nano for windows, which is more more akin to notepad.exe than vim is

还有一个用于 windows 的 nano 端口,它比 vim 更类似于 notepad.exe

https://www.nano-editor.org/dist/win32-support/

https://www.nano-editor.org/dist/win32-support/

Get the WINNT zip. Tested in Windows 7 works as expected

获取 WINNT 压缩包。在 Windows 7 中测试按预期工作

回答by Rohit Kharsan

MS-DOS Editor (or just edit) is a 16-bit text editor that is still included with 32-bit versions of Windows XP, Vista, 7, 8 and 8.1. It can edit files upto 65,279 lines long and has mouse support. Being an 16-bit DOS editor, it cannot run directly on 64-bit versions of Windows.It can be launched by typing editat the command prompt.

MS-DOS 编辑器(或只是edit)是一个 16 位文本编辑器,它仍然包含在 32 位版本的 Windows XP、Vista、7、8 和 8.1 中。它可以编辑长达 65,279 行的文件并支持鼠标。作为 16 位 DOS 编辑器,它不能直接在 64 位版本的 Windows 上运行。它可以通过edit在命令提示符下键入来启动。

回答by StanislavT.

I want to add that it is very strange to introduce Core and Nano servers without native console full-featured editor. Like others I`ll recommend to use vim or nano. But my suggestion is to install it via OneGet (require WMF5)! They both are presented in Chocolatey repository so installation is simple and fast:

我想补充一点,在没有原生控制台全功能编辑器的情况下引入 Core 和 Nano 服务器是很奇怪的。和其他人一样,我会推荐使用 vim 或 nano。但我的建议是通过 OneGet 安装(需要 WMF5)!它们都出现在 Chocolatey 存储库中,因此安装既简单又快速:


PS C:> Find-Package -Name vim | Format-Table -AutoSize
Name Version Status    ProviderName Source     Summary
---- ------- ------    ------------ ------     -------
vim  7.4.638 Available Chocolatey   chocolatey Vim is an advanced text editor...

PS C:> Install-Package vim

回答by Paul

I also wondered what had happened to the text editor in console mode in windows. I remembered the famous mcfrom Linux. Of course, it's available for Windows!

我还想知道 Windows 中控制台模式下的文本编辑器发生了什么。我想起了Linux 中著名的mc。当然,它适用于Windows!

GNU Midnight Commanderis a visual file manager, licensed under GNU General Public License and therefore qualifies as Free Software. It's a feature rich full-screen text mode application that allows you to copy, move and delete files and whole directory trees, search for files and run commands in the subshell. Internal viewer and editor areincluded.

Midnight Commander is based on versatile text interfaces, such as Ncurses or S-Lang, which allows it to work on a regular console, inside an X Window terminal, over SSH connections and all kinds of remote shells.

GNU Midnight Commander是一个可视化文件管理器,在 GNU 通用公共许可证下获得许可,因此有资格作为自由软件。它是一个功能丰富的全屏文本模式应用程序,允许您复制、移动和删除文件和整个目录树,搜索文件并在子 shell 中运行命令。内部查看器和编辑器都包括

Midnight Commander 基于多功能文本界面,例如 Ncurses 或 S-Lang,这使其可以在常规控制台上、在 X Window 终端内、通过 SSH 连接和各种远程 shell 工作。

As mentioned somewhere there are also FAR Manager

正如某处提到的,还有FAR Manager

回答by Morne

There is no command based text editors in windows (at least from Windows 7). But you can try the vi windows clone available here : http://www.vim.org/

Windows 中没有基于命令的文本编辑器(至少从 Windows 7 开始)。但是您可以尝试这里提供的 vi windows 克隆:http: //www.vim.org/

回答by Bill_Stewart

vim may be challenging for beginners. For a quick-and-dirty Windows console-mode text editor, I would suggest Kinesics Text Editor.

vim 对初学者来说可能具有挑战性。对于快速而肮脏的 Windows 控制台模式文本编辑器,我建议使用Kinesics Text Editor

回答by djangodude

You can install vim/vi for windows and set windows PATH variable and open it in command line.

您可以为 windows 安装 vim/vi 并设置 windows PATH 变量并在命令行中打开它。

回答by Batch Genuine

There is no command based text editors in windows (at least from Windows 7). But you can try the vi windows clone available here : http://www.vim.org/

Windows 中没有基于命令的文本编辑器(至少从 Windows 7 开始)。但是您可以尝试这里提供的 vi windows 克隆:http: //www.vim.org/

You are Wrong! If you are using Windows 7, you can using this command:

错了!如果您使用的是Windows 7,则可以使用以下命令:

copy con [filename.???]

Or if you using Windows XPor lower, use (is have a DOSGUI):

或者,如果您使用的是Windows XP或更低版本,请使用(具有DOSGUI):

edit

Any comment?

任何意见?

回答by Sergiy Kolodyazhnyy

There actually is a basic text editor on Windows. In the command prompt simply type edit, and it should take you to there. Now, someone already mentioned it, but they said it's XP or lower. Actually it works perfectly fine on my Windows 7.

Windows 上实际上有一个基本的文本编辑器。在命令提示符下只需键入edit,它就会带你到那里。现在,有人已经提到了它,但他们说它是 XP 或更低。实际上,它在我的 Windows 7 上运行良好。

Wikipedia page

维基百科页面

Again, I am running Windows 7, so I've no idea if it's still is present on Windows 8.

同样,我运行的是 Windows 7,所以我不知道它是否仍然存在于 Windows 8 上。

And as IInspectable pointed out, there's no built in C compilers, which is a disappointment. Oh, well, back to MinGW.

正如 IInspectable 指出的那样,没有内置的 C 编译器,这令人失望。哦,好吧,回到 MinGW。

Also, "here"someone mentioned Far Manager, which has ability to edit files, so that's some alternative.

此外,“这里”有人提到了 Far Manager,它具有编辑文件的能力,所以这是一些替代方案。

Hope that helps

希望有帮助