You are not logged in.
Whenever I copy/paste someone's bash code into a TE it ends up as one long line of text instead of several neatly formatted rows.
Offline
a. The cli tool I use from time to time is called shfmt (in repos).
shfmt -i 4 script > out
see
shfmt --help
b. VS Code should have a formatter plugin (not just one).
c. If such function does not exists in geany (I don't remember), one could do a custom command (pipe to shfmt), similar to the thing explained here
https://askubuntu.com/questions/481182/ … any-editor
Offline
Whenever I copy/paste someone's bash code into a TE it ends up as one long line of text instead of several neatly formatted rows.
There are two ways to solve the problem:
1) Check how your text editor is set up.
I use Gedit and this is what the tab View looks like in Preferences:
Text Wrapping must be enabled if you don't want very long lines.
2) I don't know what text editor you're using, but the configuration file is probably somewhere in your HOME folder (maybe inside ~/.config).
If you close the text editor and delete the configuration file the next time you start TE, it should have the default settings.
If people would know how little brain is ruling the world, they would die of fear.
Offline
Check these preferences in Geany.
Debian 12 Beardog, SoxDog and still a Conky 1.9er
Offline
as an example, here's a simple bash script posted by Argantes
https://i.postimg.cc/87CgFQ36/2024-11-27-15-33-48-scrot.png
and here's how it looks posted in geany with line wrapping
You have a link for the original script?
You must unlearn what you have learned.
-- yoda
Offline
It's in this thread
Offline
It's in this thread
I didn't have any formatting issues doing a copy/paste with any of those scripts in either geany or sublime editors.
You can try those settings recommended by Sector11 and marens, but if the geany.conf file is corrupted, this may be your best bet:
If you close the text editor and delete the configuration file the next time you start TE, it should have the default settings.
You must unlearn what you have learned.
-- yoda
Offline
Does the issue turn up only in geany? Try pasting into a different text editor.
It looks as if all the linebreaks are being stripped out somewhere - that's not something that a text editor being used for programming would usually do.
...elevator in the Brain Hotel, broken down but just as well...
( a boring Japan blog (currently paused), now on Bluesky, there's also some GitStuff )
Online
MarkW wrote:It's in this thread
I didn't have any formatting issues doing a copy/paste with any of those scripts in either geany or sublime editors.
You can try those settings recommended by Sector11 and marens, but if the geany.conf file is corrupted, this may be your best bet:
If you close the text editor and delete the configuration file the next time you start TE, it should have the default settings.
Did that, same result
Offline
PackRat wrote:MarkW wrote:It's in this thread
I didn't have any formatting issues doing a copy/paste with any of those scripts in either geany or sublime editors.
You can try those settings recommended by Sector11 and marens, but if the geany.conf file is corrupted, this may be your best bet:
If you close the text editor and delete the configuration file the next time you start TE, it should have the default settings.
Did that, same result
If you open a man page in a terminal is it properly formatted?
You can try this in a terminal:
man tar | col -b > tar_man.txt
That will generate a text file of the tar man page. Open that text file and see if the formatting is preserved.
You may be having an issue with the locale ( https://www.debian.org/doc/manuals/debi … the_locale )
You must unlearn what you have learned.
-- yoda
Offline
That's obviously working. Have you tried pasting the code into the terminal to see if that works?
Offline
Looks the same in a terminal as it does in a text editor.
Offline
A man page for geany? I guess, if this is what it's supposed to look like
That looks right.
You must unlearn what you have learned.
-- yoda
Offline
My locale is set to en-GB. Which is correct for me. Should I add more?
No, you're good there.
You must unlearn what you have learned.
-- yoda
Offline
It looks as if there's something wrong about the way you're copy/pasting code from the web.
Can you copy/paste from a local file with linebreaks intact?
Maybe a problem with your browser?
...elevator in the Brain Hotel, broken down but just as well...
( a boring Japan blog (currently paused), now on Bluesky, there's also some GitStuff )
Online
I tried with a local file. It's the copy/pasting
Would an improperly formatted script still work?
Offline