Notepad++ has keyboard shortcuts built-in that can change the end-of-line convention for a specific line alone. This means one can inadvertently create a MIXED format file by accidentally typing the shortcut:

- Ctrl+M inserts a Mac style EOL character (i.e. 0x0D only) *on just that line*,
- Ctrl+J puts a UNIX style EOL character (i.e. (0x0A only) *on just that line*,

Question: Can these keyboard shortcuts be disabled or changed?

(I've scanned through Settings > Shortcut Mapper and could not find Ctrl+M or Ctrl+J listed for EOL conversion.)


up vote 6 down vote accepted

They are built in, but not in notepad++. Try it with plain notepad, or any other app, it will still work. They are common control ascii codes (that's where ctrl on that key comes from). Ctrl M will be decoded as 0A by keyboard controller/driver (similarly for other Ctrl combinations). More info here:

  • 1
    Well, that was a completely unexpected (but enlightening) explanation! (+1) Making it explicit: Control+[KEY] is implemented as subtracting 64d (decimal) or 0x40 from the ASCII value of the capital letter [KEY]. So since ascii(M) = 77d, ctrl+M = 13d = 0x0D, and since ascii(J) = 74d, ctrl+J = 10d = 0x0A... – Assad Ebrahim Sep 28 '12 at 17:59
  • Hmmm... so how can this be protected against? – Assad Ebrahim Sep 28 '12 at 18:06
  • @ake You probably could re-map the key combination in Windows (as the process in reality is more complex). I can't suggest particular product or procedure as I have not used them, but searching 'windows remap keyboard' brings many. – wmz Sep 28 '12 at 18:16
  • Imposing such a global setting change on a system seems a bit too drastic. I think this would be best handled by a "usability feature" within Notepad++ to protect the integrity of source code files from ending up with mixed EOL formats. What do you think of not allowing different EOL formats for different lines? This could be implemented by trapping Ctrl+M and Ctrl+J and, if the file level EOL format is not set to either Mac or Unix respectively, then Notepad++ would suppress the characters (possibly issuing a notice the first time). Worth a bug / feature request to NPP? – Assad Ebrahim Sep 29 '12 at 20:16
  • 1
    @Ake I personally hate if a tool 'knows better' and does not allow me to do something, so I would rather opt for a message on open/save warning about inconsistent eol and offering option to normalize them. That's only me, though. As for requesting new feature - it's your call, but I can't see why not. – wmz Sep 30 '12 at 10:14

Your Answer


By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Not the answer you're looking for? Browse other questions tagged or ask your own question.