60

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?

Tom
  • 7,515
  • 7
  • 38
  • 54
Gpipes
  • 609
  • 1
  • 5
  • 3
  • 8
    oh nooooo..... They removed edlin ! – Bruce Oct 21 '13 at 14:42
  • 2
    I saw people using [FAR](http://www.farmanager.com/opensource.php?l=en) to both navigate the file system and edit text in a more command-line friendly way. It is an open-source software distributed under revised BSD license. I've used it once about a decade ago but I've seen people using it today too. –  Oct 21 '13 at 17:08
  • 2
    I wonder why this doesn't exist. There are so many choices in linux. I wonder if the absence of a command line editor has some sort or design decision, or if it just has never been seen as necessary.by a critical mass of windows users. –  Dec 31 '16 at 23:51
  • Possible duplicate: http://stackoverflow.com/questions/11045077/edit-a-text-file-on-the-console-in-64-bit-windows – Adrian McCarthy Mar 02 '17 at 19:43
  • 1
    [`chocolatey install nano`](https://chocolatey.org/packages/nano) – Chloe Jan 04 '19 at 19:42
  • If you happen to have [Git for Windows](https://gitforwindows.org/) installed (by means of chocolatey or by hand), you already have `nano` and `vim` on your machine. ;-) – CodeFox Nov 09 '21 at 08:58

14 Answers14

30

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

@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 :)

gr1m
  • 337
  • 3
  • 4
15

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

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

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

Krissh
  • 328
  • 3
  • 14
chiliNUT
  • 18,989
  • 14
  • 66
  • 106
  • 2
    @Hack-R see update – chiliNUT Jun 13 '17 at 16:28
  • 3
    If you have git ( https://git-scm.com/downloads ) installed, you can just call `C:\Program Files\Git\usr\bin\nano.exe`. If you don't have git installed, you can use Chocolatey ( https://chocolatey.org/install ) to install nano with `choco install nano` – cowlinator Jul 29 '21 at 22:26
11

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:


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

StanT.
  • 320
  • 2
  • 8
11

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 edit at the command prompt.

Rohit Kharsan
  • 145
  • 1
  • 8
3

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/

Morne
  • 1,623
  • 2
  • 18
  • 33
3

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/

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

copy con [filename.???]

Or if you using Windows XP or lower, use (is have a DOS GUI):

edit

Any comment?

  • 6
    I can't belive that `copy` is a text editor... until you show me how you edit a textfile with it. – Stephan Feb 25 '14 at 09:37
  • 2
    @Stephan: in the case of 'copy con' it's copying the console to the file. You've got basic single-line editing. I don't even want to think about it, but you could cook up a simple text editor in batch. – bugmagnet Mar 06 '14 at 04:49
  • 1
    yes, I know @boost. You can create a new file with it. But how to edit an existing file (without completely retyping it)? – Stephan Mar 06 '14 at 06:32
  • @Stephan well ... umm ... you can't. So by that definition then you are are correct: copy is not a text editor. – bugmagnet Mar 06 '14 at 07:44
  • @Stephan so for the record I'm writing a very very simple editor in batch language. – bugmagnet Mar 06 '14 at 09:41
  • 4
    I suppose you also believe that ">" is a text editor on *nix? – daviewales Apr 13 '14 at 02:46
  • 7
    I kinda miss `EDIT` : – Populus May 13 '14 at 14:46
  • [Kinesics Text Editor](http://www.turtlewar.org/projects/editor/) is a workable `edit` replacement. – Bill_Stewart Mar 13 '15 at 20:03
  • EDIT worked on Windows 7 32-bit as well :) –  Apr 11 '15 at 23:40
  • It's worth mentioning that this command "copy con filename" will DESTROY a prexisting file! It is NOT an editor. – foghorn Jun 13 '15 at 21:20
  • The 32-bit versions of Windows, up to and including Windows 10, continue to have the EDLIN command which *is* a line-based text editor. https://en.wikipedia.org/wiki/Edlin – Alan B May 16 '17 at 09:40
  • `copy con` just doesn't work as an editor. It will either create a new file with the filename or overwrite a file with that name...certainly not what the OP wants! – Zoso Jul 08 '17 at 11:59
  • If the file exists, `copy con xxx` CLEARS it. Not recommended! – WesternGun Nov 10 '17 at 07:44
2

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

Bill_Stewart
  • 22,916
  • 4
  • 51
  • 62
  • You can ignore the drive-by downvote. See also this [answer](http://stackoverflow.com/questions/11045077/edit-a-text-file-on-the-console-in-64-bit-windows/19314955#19314955). – Bill_Stewart Mar 24 '16 at 15:05
  • I'm getting error when I'm trying to run Kinesics. I have Microsoft Windows x64 [Version 10.0.15063] – AlexMelw Sep 03 '17 at 15:45
  • 1
    [When you say that something didn't work, you have to say _how_ it didn't work](https://devblogs.microsoft.com/oldnewthing/20100421-00/?p=14283). – Bill_Stewart Sep 28 '20 at 15:56
2

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

GNU Midnight Commander is 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 are included.

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.

As mentioned somewhere there are also FAR Manager

Paul
  • 2,620
  • 2
  • 17
  • 27
0

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.

Wikipedia page

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

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

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

Hope that helps

Community
  • 1
  • 1
Sergiy Kolodyazhnyy
  • 938
  • 1
  • 13
  • 41
  • 7
    as the Wikipedia page that you referenced states: it works on 32bit Windows, but not on 64bit (which is kind of standard these days). – Stephan Jun 16 '14 at 14:23
  • Yeah good point - I should have mentioned it. But about 32 bit Windows. . . I wouldn't exactly say 32 bit is a standard. Windows 8 still has 32 bit version. It may be less popular but still there. – Sergiy Kolodyazhnyy Jun 16 '14 at 19:52
  • Since Windows won't give a satisfying user experience with less then 4Gb of RAM and 32 bit versions are only capable of handling 2Gb natively (or 3,5Gb trough a hack), 32 bit Windows are quickly becoming a thing of the past. – mg30rg Nov 22 '17 at 10:08
  • @mg30rg not just Windows. 32 bit OS in general is becoming a thing of the past. – Sergiy Kolodyazhnyy Nov 22 '17 at 10:25
  • @SergiyKolodyazhnyy True, but is it really relevant? – mg30rg Nov 22 '17 at 10:28
0

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

codingbruh
  • 2,263
  • 1
  • 13
  • 14
-2

There is one built into windows 7 in which you can open by clicking the windows and r keys at the same time and then typing edit.com.

I hope this helped

Matt
  • 5
  • 1
  • 2
    I can't find edit.com in windows 7. Apparently because I'm using a 64 bit version: https://en.wikipedia.org/wiki/MS-DOS_Editor – Eric Sep 18 '15 at 20:03
-4

The standard text editor in windows is notepad. There are no built-in command line editors.

Windows does not ship a C or C++ compiler. The .NET framework comes with several compilers, though: csc.exe (C# compiler), vbc.exe (VB.NET compiler), jsc.exe (JavaScript compiler).

If you want a free alternative you can download Visual Studio Express 2013 for Windows Desktop that comes with an optimizing C/C++ compiler (cl.exe).

IInspectable
  • 46,945
  • 8
  • 85
  • 181
  • 1
    In 32bit windows, you have edit.com – Kamila Szewczyk Feb 03 '18 at 18:12
  • @KrzysztofSzewczyk: *edit.com* is a 16-bit DOS program, that happens to run in a virtual DOS machine (NTVDM), that ships with 32-bit Windows. This is not a native application running in the CONSOLE subsystem. My statement that there is no built-in command line editor still holds. Besides, NTVDM isn't part of 64-bit Windows, so *edit.com* is not in general available anyway. – IInspectable Feb 05 '18 at 09:27
  • 2
    But you should mention EDIT.COM, as it exists and I can use it, can't I? – Kamila Szewczyk Feb 05 '18 at 10:35
  • @KrzysztofSzewczyk: You can use *edit.com* as long as you run a 32-bit system on a 32-bit CPU (or an equivalent virtualization). This limits you to roughly 3.5GB of RAM. Hardly the system a developer would want to use, particularly with a C/C++ linker managing databases commonly tens of gigabytes in size. Knowing that you can use *edit.com* is anecdotal wisdom, and hardly more than a fun fact. If you feel that *edit.com* is relevant, feel free to provide an answer. – IInspectable Feb 05 '18 at 11:52
  • 1
    Well, I don't want to answer such old question. I'm just trying to improve your answer. – Kamila Szewczyk Feb 05 '18 at 12:03
  • @kam Your suggestion for improvement has already been [published](https://stackoverflow.com/a/27931342/1889329). Based on its reception I would wager that this isn't going to be an improvement to any answer. You're still invited to publish an answer yourself. There is no such thing as being too old when it comes to Stack Overflow's Q&A's. – IInspectable May 01 '22 at 06:14
-5

In a pinch, just type 'notepad (filename)' and notepad will pop up with the file you want to edit in it. Otherwise Vim or some such will have to be installed.

SkipKent
  • 457
  • 1
  • 6
  • 13
-6

notepad filename.extension will open notepad editor

Lijo
  • 6,498
  • 5
  • 49
  • 60