Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is it possible to indent JavaScript code in Notepad++?

I have some JavaScript code that is written in one line (no carriage returns), it's completely unreadable...

With Notepad++, I tried to replace these characters ({, }, ;) by themselves plus a carriage return, but it still isn't very handy...

Is there a way to do this correctly in Notepad++?

like image 922
GianT971 Avatar asked Feb 02 '12 15:02

GianT971


People also ask

Can you type JavaScript in notepad?

If you are a beginner and want to go for a simple approach for writing JavaScript programs, use a simple text editor like Notepad++. It is free, open-source, and will work fine for JavaScript development. Notepad++ is a general-purpose editor that supports highlights the syntax of JavaScript and HTML code.

Can Notepad ++ auto indent?

You need to enable "Auto-indent". Show activity on this post. You can use a plugin (IndentByFold).


2 Answers

JSTool is the best for stability.

Steps:

  1. Select menu Plugins>Plugin Manager>Show Plugin Manager
  2. Check to JSTool checkbox > Install > Restart Notepad++
  3. Open js file > Plugins > JSTool > JSFormat
    screenshot

Reference:

  • Homepage: http://www.sunjw.us/jstoolnpp/
  • Source code: http://sourceforge.net/projects/jsminnpp/
like image 64
Quang Vinh Avatar answered Sep 29 '22 07:09

Quang Vinh


I think you want a code beautifier, this one looks quick and easy: http://jsbeautifier.org/

like image 42
Ryan Doherty Avatar answered Sep 29 '22 07:09

Ryan Doherty