• FEATURED

View more

View more

View more

$30 ### Image of the Day Submit IOTD | Top Screenshots ### The latest, straight to your Inbox. Subscribe to GameDev.net's newsletters to receive the latest updates and exclusive content. Sign up now ## Basic text editor? Old topic! Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic. 11 replies to this topic ### #1wintertime Members Posted 24 January 2013 - 06:39 AM I'd like to ask if you know some free, good, basic, raw text editor(no ide, I already have one for coding and dont want to switch), as there are thousands to try and often they have features to help you which silently change something in a file. I just need it sometimes to edit some config or data file, so it doesnt need any fancy features. Thank you. requirements: - If I load any file into it and save it, it should be byte for byte identical to the original, if I change 1 thing it should not change anything else, even if there are misplaced spaces, tabs, "wrong" lineendings, fancy characters, illegal character encodings or whatever else inside the file. - It should detect which line endings are used(+show which type and if its mixed up) and if I add some more it should use the same as already there. - It shows something for anything inside the file(no hiding of unknown characters). - There should be no problems to make git call it, so I never again have to see the most obscure editor ever(vim). nice to haves: - It lets me choose to convert all line endings to a choosen type. - It can detect and show different character encodings (latin1,all unicode encodings, windows encoding) and lets me choose to let it interpret it as any other and maybe convert to any other. ### #2ic0de Members Posted 24 January 2013 - 07:09 AM http://notepad-plus-plus.org/ I use Notepad++ it's meant for coding but it's not an IDE and works great for what you're talking about too. Currently working on new DOS game, Chuck Jones: Space Cop of the Future, Check out my Dev Blog you know you program too much when you start ending sentences with semicolons; ### #3swiftcoder Senior Moderators Posted 24 January 2013 - 12:21 PM All of the following should support the features you desire (in order of my preference): • Sublime (not free, but more than worth the$60)
• TextWrangler (free, Mac only)
• GVIM/MacVim (free, per-platform distributions, all the power of vim + a friendly GUI)

Tristam MacDonald - Software Engineer @ Amazon - [swiftcoding] [GitHub]

### #4Servant of the Lord  Members

Posted 24 January 2013 - 12:49 PM

Programmer's Notepad 2 I think also supports those features, but I haven't used it for over a year.

It's perfectly fine to abbreviate my username to 'Servant' or 'SotL' rather than copy+pasting it all the time.
All glory be to the Man at the right hand... On David's throne the King will reign, and the Government will rest upon His shoulders. All the earth will see the salvation of God.
Of Stranger Flames -

### #5Sik_the_hedgehog  Members

Posted 24 January 2013 - 12:55 PM

- It should detect which line endings are used(+show which type and if its mixed up) and if I add some more it should use the same as already there.

Stupid question, does any editor actually not attempt to fix mixed newlines? Given when saving they just rewrite the entire file and most likely they use an internal representation completely different from the raw blob that's the original file (e.g. storing individual lines instead of a continuous block of text).

Don't pay much attention to "the hedgehog" in my nick, it's just because "Sik" was already taken =/ By the way, Sik is pronounced like seek, not like sick.

### #6swiftcoder  Senior Moderators

Posted 24 January 2013 - 12:58 PM

Stupid question, does any editor actually not attempt to fix mixed newlines?

Most editors offer the option to "preserve line endings". On some editors that means normalising it based on the first/most-common line ending in the file, but in others it literally means to leave each existing line ending as it is.

I'm honestly not sure what good a mixed-line-ending text file is, but I guess someone needed it once upon a time...

Tristam MacDonald - Software Engineer @ Amazon - [swiftcoding] [GitHub]

### #7Servant of the Lord  Members

Posted 24 January 2013 - 01:02 PM

Hex editors would preserve the differing line-endings.

It's perfectly fine to abbreviate my username to 'Servant' or 'SotL' rather than copy+pasting it all the time.
All glory be to the Man at the right hand... On David's throne the King will reign, and the Government will rest upon His shoulders. All the earth will see the salvation of God.
Of Stranger Flames -

### #8swiftcoder  Senior Moderators

Posted 24 January 2013 - 01:22 PM

I'm honestly not sure what good a mixed-line-ending text file is, but I guess someone needed it once upon a time...

And I have now answered my own question: source patches.

If you have people on multiple platforms committing to the same git repository, chances are they have accidentally introduced multiple line endings. When you go to create a patch, you don't want your editor to change potentially thousands of line endings, or your resulting patch will be ridiculous.

(this is however a good argument for enforcing consistent line endings at the repository level)

Tristam MacDonald - Software Engineer @ Amazon - [swiftcoding] [GitHub]

### #9SiCrane  Moderators

Posted 24 January 2013 - 01:33 PM

Fortunately there are hooks to do that kind of thing for many if not most source control systems now. Ex: with git you can enable CRLF conversion with git config --global core.autocrlf true and/or check in a .gitattributes file. github has article dealing with line endings.

### #10PlayerX  Members

Posted 24 January 2013 - 02:08 PM

I use an ancient version of http://www.ultraedit.com (version 8.20a) which does everything you've listed.  Unfortunately I can't recommend more modern versions because I have not had a good track record with them.  There always seemed to be some show-stopper bug that made them unusable for me.  However, I haven't found anything more comfortable for me than 8.20a.  I did try both Notepad++ and Sublime for a month each but neither of them stuck.

### #11wintertime  Members

Posted 25 January 2013 - 10:39 AM

Thanks for the suggestions, I think I'll try Notepad++ and Programmers Notepad first; I already encountered their websites but couldnt see from the feature lists if they would do what I need. Sublime looks neat, but I was just looking for something simple and dont want to spend that money when I would just use 10% of it.

Oh and yes, the problem with the mixed lineendings or missing spaces and cluttered diffs was one reason I asked for this. I disabled automatic line ending conversion in hg and git, because I would actually like having everything more consistent with just LF even on Windows and I dont like running the risk of silent corruption of a binary file.

The other problem is when some files with mostly text and a bit of binary or which would not work with other lineendings or spaces/tabs removed would get screwed up, but at same time it would be inconvenient and weird to use a hexeditor for.

### #12LorenzoGatti  Members

Posted 27 January 2013 - 12:00 PM

I should recommend Emacs, but if you want a "simple" text editor Notepad++ is comprehensive and well made, and it performs better.

Be sure to launch the integrated plugin manager and install appropriate plugins; important general purpose ones include

• TextFX (low level text manipulations like deleting blank lines, case conversion, escaping, sorting)
• XML Tools (includes reformatting XML documents)
• Customize Toolbar

You can also easily define syntax highlighting schemes for file types which aren't supported out of the box; consult the help pages.

Omae Wa Mou Shindeiru

Old topic!

Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.