0

I've a Linux partition mounted using Web Drive on a Windows PC. It uses the same Drive letter all the time. Whenever I create a empty new text file and then open it with Notepad++, it starts using Windows line endings.

Is there any way to force Linux line endings on a specific partition in Notepad++?

3
  • 1
    This isn't really the solution you're seeking, which I understand from your question, but may want to get familiar with ALT-E, E, U
    – Kennah
    Dec 29, 2015 at 22:24
  • I tried connecting default EOL to a Session, but it doesn't seem possible. You can change default EOL by going to Settings, Preferences, New Document, Format or by editing your config.xml file directly docs.notepad-plus-plus.org/index.php/…
    – Kennah
    Dec 29, 2015 at 23:12
  • Thanks @Kennah. I finally created this using your suggestion superuser.com/a/1019631/398328
    – user398328
    Dec 30, 2015 at 7:35

1 Answer 1

1

I'm finally able to do this, with a simple AutoHotKey script. First assign a keyboard shortcut to "Convert to Unix Line Ending" in "Shortcut Mapper" (It should be around S.No 153)

#IfWinActive, G:\ ahk_class Notepad++
    ^s::Send ^!j^s
#IfWinActive

First lines checks if current windows is notepad++ and opened file is from G:\ partition (Notepad++ set current file path as title)

Second line capture Ctrl+S, and then send first Ctrl+Alt+J (Notepad++ keyboard shortcut to change line ending to Unix), and then Ctrl+S to finally save it)

1
  • I use Autohotkey, and that never occurred to me. Much appreciated.
    – Kennah
    Dec 30, 2015 at 15:15

You must log in to answer this question.