[Geany-Users] Bash Script Line Endings - Convert to LF for Unix Automatically When Detected?

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

[Geany-Users] Bash Script Line Endings - Convert to LF for Unix Automatically When Detected?

OwN-3m-All
Hi All,

Would it be possible for Geany to automatically set the line endings
to LF for Unix when working with bash scripts?  I would suggest that
if a file is detected as a bash script, the line ending setting should
be automatically changed to LF.  Also, if the extension is .sh, I
would also like the line ending mode to be set to LF automatically.

I have been burned so many times since I sometimes write my scripts in
Windows depending on which computer I am using.  Since bash scripts do
not run on Windows, they should probably always be converted to LF
line endings.

Is there a way to do this currently, or could this be added as a new feature?

I love using Geany!
_______________________________________________
Users mailing list
[hidden email]
https://lists.geany.org/cgi-bin/mailman/listinfo/users
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: [Geany-Users] Bash Script Line Endings - Convert to LF for Unix Automatically When Detected?

Matthew Brush-2
On 2016-12-06 05:15 PM, OwN-3m-All wrote:

> Hi All,
>
> Would it be possible for Geany to automatically set the line endings
> to LF for Unix when working with bash scripts?  I would suggest that
> if a file is detected as a bash script, the line ending setting should
> be automatically changed to LF.  Also, if the extension is .sh, I
> would also like the line ending mode to be set to LF automatically.
>
> I have been burned so many times since I sometimes write my scripts in
> Windows depending on which computer I am using.  Since bash scripts do
> not run on Windows, they should probably always be converted to LF
> line endings.
>

Are you sure Bash for Windows[0][1][2][3] doesn't support CRLF line endings?

It might be better to do this as a Geany (or GeanyPy) plugin.

Regards,
Matthew Brush

[0]: https://sourceforge.net/p/msys2/wiki/MSYS2%20introduction/
[1]: https://www.cygwin.com/
[2]: https://git-for-windows.github.io/
[3]:
http://www.windowscentral.com/how-install-bash-shell-command-line-windows-10
_______________________________________________
Users mailing list
[hidden email]
https://lists.geany.org/cgi-bin/mailman/listinfo/users
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: [Geany-Users] Bash Script Line Endings - Convert to LF for Unix Automatically When Detected?

Lex Trotman
On 7 December 2016 at 11:21, Matthew Brush <[hidden email]> wrote:

> On 2016-12-06 05:15 PM, OwN-3m-All wrote:
>>
>> Hi All,
>>
>> Would it be possible for Geany to automatically set the line endings
>> to LF for Unix when working with bash scripts?  I would suggest that
>> if a file is detected as a bash script, the line ending setting should
>> be automatically changed to LF.  Also, if the extension is .sh, I
>> would also like the line ending mode to be set to LF automatically.
>>
>> I have been burned so many times since I sometimes write my scripts in
>> Windows depending on which computer I am using.  Since bash scripts do
>> not run on Windows, they should probably always be converted to LF
>> line endings.
>>
>
> Are you sure Bash for Windows[0][1][2][3] doesn't support CRLF line endings?
>
> It might be better to do this as a Geany (or GeanyPy) plugin.

Agree with Matthew its not a default setting, its something a user
should set.  Unfortunately line endings are not settings you can set
in a filetype specific manner, but somebody could provide a pull
request for that.

Cheers
Lex
_______________________________________________
Users mailing list
[hidden email]
https://lists.geany.org/cgi-bin/mailman/listinfo/users
Loading...