Jump to content
  • Advertisement
Sign in to follow this  
wintertime

Basic text editor?

This topic is 2151 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

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.

Share this post


Link to post
Share on other sites
Advertisement

- 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).

Share this post


Link to post
Share on other sites

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...

Share this post


Link to post
Share on other sites

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)

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites

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.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!