Difference between revisions of "How to avoid DOS line endings in Windows tools"
Jump to navigation
Jump to search
m (Formatted UI stuff more or less according to Style guide#General_rules (although this page isn't part of the KB)) |
(Added Programmer's Notepad to the list, in alphabetical order) |
||
Line 17: | Line 17: | ||
** Check the box '''Replace by space''' | ** Check the box '''Replace by space''' | ||
** Note: if you are going to be using the program as a general editor you can customize which file types this tab to space conversion applies to. | ** Note: if you are going to be using the program as a general editor you can customize which file types this tab to space conversion applies to. | ||
==Programmer's Notepad== | |||
Configuring Programmer's Notepad ([http://pnotepad.org/ download Programmer's Notepad]) | |||
* Per-file Line-ending Setting | |||
** You should not need to specify the line ending for an existing file but for a new file you will want to set '''File''' > '''Properties...''' > '''Line Endings''' to '''Unix (LF)''' | |||
* To set "Unix" line endings as default for new files | |||
** Go to '''Tools''' > '''Options''' > '''General''' > '''Defaults''' | |||
** Set '''Line Endings''' to '''Unix (LF)''' | |||
* Tab spacing | |||
** Go to '''Tools''' > '''Options''' > '''General''' > '''Defaults''' | |||
** Make sure the '''Use the tab character for indentation''' setting is ''not'' checked. | |||
** Set '''Tab Width''' to <code>4</code> | |||
* Visible whitespace | |||
** It is convenient to be able to tell at a glance if there are incorrect characters used for indentation or line endings | |||
** Go to '''Tools''' > '''Options''' > '''General''' > '''Defaults''' | |||
** Check the box '''Visible Line Endings''' | |||
** Check the box '''Visible Whitespace Characters''' | |||
* Correcting line endings on existing files | |||
** Go to '''Tools''' > '''Line Endings''' > '''Unix (LF)''' to convert the file |
Revision as of 09:46, 1 February 2011
If you are going to work on the viewer code you need to conform to the Coding Standard. Standards your editor must support:
- Lines must end with a
LF
(linefeed) character. - A tab must generate 4 spaces.
Notepad++
Configuring Notepad++ (download Notepad++)
- Line ending
- You should not need to specify the line ending for an existing file but for a new file you will want to set Edit > EOL Conversion > UNIX Format
- Tab spacing
- Go to Settings > Preferences > Language Menu/Tab Settings.
- Click on Default
- Change Tab Size to
4
- Check the box Replace by space
- Note: if you are going to be using the program as a general editor you can customize which file types this tab to space conversion applies to.
Programmer's Notepad
Configuring Programmer's Notepad (download Programmer's Notepad)
- Per-file Line-ending Setting
- You should not need to specify the line ending for an existing file but for a new file you will want to set File > Properties... > Line Endings to Unix (LF)
- To set "Unix" line endings as default for new files
- Go to Tools > Options > General > Defaults
- Set Line Endings to Unix (LF)
- Tab spacing
- Go to Tools > Options > General > Defaults
- Make sure the Use the tab character for indentation setting is not checked.
- Set Tab Width to
4
- Visible whitespace
- It is convenient to be able to tell at a glance if there are incorrect characters used for indentation or line endings
- Go to Tools > Options > General > Defaults
- Check the box Visible Line Endings
- Check the box Visible Whitespace Characters
- Correcting line endings on existing files
- Go to Tools > Line Endings > Unix (LF) to convert the file