LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This 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


Reply
  Search this Thread
Old 05-28-2016, 07:38 AM   #1
S. Chapelin
Member
 
Registered: Jan 2010
Location: Quebec
Posts: 144

Rep: Reputation: 6
Question Geany how to fold a text file


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?
 
Old 05-28-2016, 07:47 AM   #2
keefaz
LQ Guru
 
Registered: Mar 2004
Distribution: Slackware
Posts: 6,552

Rep: Reputation: 872Reputation: 872Reputation: 872Reputation: 872Reputation: 872Reputation: 872Reputation: 872
I don't know if those tools are well suited for text work

Tools like open office writter have navigation features, like:
http://openoffice.blogs.com/openoffi...ivalent-o.html
 
Old 05-28-2016, 08:01 AM   #3
keefaz
LQ Guru
 
Registered: Mar 2004
Distribution: Slackware
Posts: 6,552

Rep: Reputation: 872Reputation: 872Reputation: 872Reputation: 872Reputation: 872Reputation: 872Reputation: 872
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

Last edited by keefaz; 05-28-2016 at 08:05 AM.
 
Old 05-28-2016, 10:01 AM   #4
S. Chapelin
Member
 
Registered: Jan 2010
Location: Quebec
Posts: 144

Original Poster
Rep: Reputation: 6
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!
 
1 members found this post helpful.
Old 08-02-2016, 11:31 AM   #5
whyglobaleyes
LQ Newbie
 
Registered: Aug 2016
Posts: 2

Rep: Reputation: Disabled
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!
 
Old 08-03-2016, 11:23 AM   #6
S. Chapelin
Member
 
Registered: Jan 2010
Location: Quebec
Posts: 144

Original Poster
Rep: Reputation: 6
Take a look at the oo feature call Navigator. It may work for you. http://openoffice.blogs.com/openoffi...ivalent-o.html
 
Old 08-08-2016, 04:07 PM   #7
whyglobaleyes
LQ Newbie
 
Registered: Aug 2016
Posts: 2

Rep: Reputation: Disabled
Thanks chapelin,

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.

BW
 
Old 02-17-2017, 08:13 AM   #8
supermistershell
LQ Newbie
 
Registered: Feb 2017
Posts: 9

Rep: Reputation: Disabled
Quote:
Originally Posted by whyglobaleyes View Post
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
 
Old 08-13-2020, 08:39 AM   #9
bogs
LQ Newbie
 
Registered: Sep 2015
Distribution: Debian
Posts: 4

Rep: Reputation: Disabled
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.
Attached Thumbnails
Click image for larger version

Name:	2aIOS8b.png
Views:	71
Size:	37.1 KB
ID:	33851  
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Geany Highlighted Text Line Count sweeny_here Linux - Software 3 03-18-2016 01:48 AM
[SOLVED] return text from geany or other editor to IDE after saving and closing the editor mtdew3q Programming 4 05-15-2013 10:40 PM
Problems with patch file creation using svn diff and fold lgp171188 Linux - General 1 08-28-2009 11:49 AM
text match pipe to file then delete from original text file create new dir automatic tr1px Linux - Newbie 6 09-10-2008 09:40 PM
How to parse text file to a set text column width and output to new text file? jsstevenson Programming 12 04-23-2008 02:36 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 10:13 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration