Jump to content

Notepad2


davetacular

Recommended Posts

I have just started using Notepad2 today.In other editors I have used in the past they automatically arranged or indented my code as I typed. Notepad2 claims to do this to, maybe it does.For example my understanding of indentation is this;Without Indentation

<table><tr><p>paragraph</p></tr></table>

With Indentation

<table>     <tr>          <p>paragraph</p>     </tr></table>

Does Notepad2 do this or is my understanding of indentation wrong? If so how do I enable this?The only indent option I see is Settings --> Auto Indent text, and i have this checked.Thanks.

Link to comment
Share on other sites

That may not be how auto-indenting is set up in that program, it may be set up so that if you are typing on a line and it is indented by 8 spaces, pressing enter to go to the next line will automatically put the cursor 8 spaces in on the next line, not necessarily indent it any more.Text editors handle indenting in different ways, you might want to try another one. Click the link for ConTEXT in my signature and give that a shot, it also has several options to control the behavior of things like this.

Link to comment
Share on other sites

Yes, you are correct. So I'm guessing Notepad2 does'nt support this sort of indentation. I was reading through the stickied favourite editor topic and I noticed that you love ConTEXT. I downloaded it, but It does too much for what I want an editor to do and I love the speed and simplicity of Notepad2. Currently I'm trying to improve my skills of typing raw html so Notepad2 fits my needs perfectly. maybe in the future... :) Thanks for your reply.

Link to comment
Share on other sites

I don't think I've ever run into an editor that will auto-indent HTML code for you since the scope of HTML is pretty loose. For a language like PHP, if I type this:

if (condition){

and hit enter after the bracket, ConTEXT for example recognizes that I am starting a new code block and will indent the cursor an extra 2 spaces after the bracket, likewise when I write a closing bracket it will move the closing bracket to align with the opening bracket and position the cursor at the next line in the same column. It's harder to do this type of thing with a tag-based language like HTML that doesn't have control characters like brackets.

Link to comment
Share on other sites

I don't think I've ever run into an editor that will auto-indent HTML code for you since the scope of HTML is pretty loose.
XEmacs has an environment that will correctly do auto-indentation for HTML, and many other programming languages. This feature really helps adherence to standards too. It will also do auto element highlighting. And if you are very ambitious, it is fully customizable as well.Cheers,Angela
Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...