motoku
motoku

Reputation: 1581

powershell script to behave like vim or nano?

Does Powershell have the capacity to generate some kind of terminal-based text editor program? I am switching to Windows because it supports a few programs I can't use otherwise; but I am having trouble discovering some sort of way to edit text files directly from Powershell. Is it possible to create a terminal-based text editor with a Powershell script; and if not is there a simple alternative?

Upvotes: 0

Views: 3454

Answers (3)

Codertjay
Codertjay

Reputation: 1007

You use chocolately if it is installed on your powershell if you don’t have it just search for it online

Choco install nano

After this you can use nano

Then just

nano filenam

If it exists it edit it and if it doesn’t it create a new file

Upvotes: 1

Pawan Kumar
Pawan Kumar

Reputation: 309

I would suggest micro which is a powershell/ cmd/ terminal based text editor for Windows and other OS

micro https://micro-editor.github.io/

Because micro is flexible cut/copy/paste same keyboard shortcut as notepad. The best part is, it has color highlighter sensitive to programming language. Here is an image

Note: don't forget the add the micro.exe path to environment variable.

Command to open a file from cmd:

micro ./file.xyz

Upvotes: 1

vonPryz
vonPryz

Reputation: 24071

Why don't you just install Vim, as it has a Windows version too? Add it to path and you should be all set.

Upvotes: 2

Related Questions