Linux - SoftwareThis forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
I have a very long text file.
I want to fold it by chapter, section, etc. like in code in order to view it at a glance and rapidly find where to work my text.
Gedit doesn't do this, so I tried Geany, which does, but seemingly only for code, not text.
How would I go about doing this?
Or you can pretend your text file is a python script in Geany
Document > Set Filetype > Scripting Languages > Python source file
Then you will be able to fold tab indented text like
Code:
Heading 1
bla bla bla bla
bla bla bla bla
bla bla bla bla
bla bla bla bla
bla bla bla bla
bla bla bla bla
bla bla
Heading 2
Section 1
bla bla bla bla
bla bla bla bla
bla bla bla bla
Section 2
bla bla bla bla
bla bla bla bla
bla
etc
I found a workaround which is not too bad. I renamed the file as html. I use tags as the folding signals (<html> <head> etc.).
It even allows me to preview the text in a browser and to add pictures, etc.
Also, it is lighter than Writer.
Too bad we can't select letters for the text files. Ex.: {}
Solved unless someone has a better idea.
Thanks everybody!
Hello,
Thanks for both the above solutions - they both work!
However I'm trying to tailor this folding behaviour to be closer to my work-habits. I find the HTML method tricky because I often export what I've written in Geany to other programmes. I find the python method distracting because syntax errors get highlighted.
--> Can anyone tell me how to suppress the highlighting in python documents please?
I tried messing with the settings in the Edit > Preference menu but that didn't work (or I didn't find the right one). Using the Geany manual so far ...
1. I managed to create my own filetype = created "filetypes.test.config" in /home/username/.config/geany/filedefs/
2. I copied the contents of filetypes.python from /usr/share/geany into the new config.
3. I can set my document filetype to be test and it shows up formatted just like a python document. << Yippee Successful So Far >>
4. But I can't figure out what to edit in the config file. I've been through and selectively deleted each of the subsections of the config = styling, keywords, lexer properties, settings, indentation, build-menu (exited & reloaded geany every time, or did Tools > Relaod Configuration) but it always comes up with the same python formatting ... I'm assuming that it's taking the syntax highlight rules from a parent in the /usr/share/geany directory, but again I can't figure out where that ?lexer? file is.
Many thanks in advance and much adulation to anyone who can help me on this.
BW
BTW
... Got to say that I'm a VERY recent linux convert (full time on my main desktop) and loving it!
... One of my preferences is to change all my default software over to cross-OS ones (eg) Thunderbird instead of WINE/Outlook - which is partly to get my wife used to linux software and then sneakily move her off Windows 10.
... Getting the folding sorted would make me replace Notepad++ on my Windows machines - and tell all my friends who I converted to Notepad++ to do the same!
I've used text styles & headings to structure documents in word and in libre-office but I reserve word processors for creating documents intended for other people to read.
For my own work I prefer the quicker lightweight text editors.
I might start a new thread - and google it some more - but once again I'm so grateful that you asked in the first place because I haven't found anyone else trying to fold text in Geany except in a code/ scripting scenario.
Thanks chapelin,
[...] I haven't found anyone else trying to fold text in Geany except in a code/ scripting scenario.
BW
I'm trying to find this for a long time.
And, I also find using Python, HTML or text processor (openoffice, etc) is a not-so-good solution.
I've tried to adapt to using a already available extension file and see if I could customize it in order to create open and close tags using only one key typed twice, like "<<", for example, but I couldn't do it. If someone could tell me how, I'd be much appreciated
Although this is an old thread, I thought I might point out that to use the HTML solution might have been misunderstood as to what was required.
In the post that S. Chapelin explained it in, they said ...
Quote:
I found a workaround which is not too bad. I renamed the file as html. I use tags as the folding signals (<html> <head> etc.).
However, you don't have to use actual HTML tags at all, after switching the doc to HTML you can use anything enclosed in an <> bracket, or just the brackets themselves. For example, this works for folding -
Code:
<> Section view
ask if wanted as ballooned or labeled, elevation cut through house - footing, foundation, floor joists, walls, ceiling joists, roof, dimensions will be provided.
</>
... producing a simple look like this attached pic below.
You can literally put whatever you want within the <> tags, the closer tags just require the slash present regardless of the opening tags.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.