Page 1 of 2
Linux lightweight code editor with easy code folding?
Posted: 26 Sep 2023 10:35
by mrbombermillzy
As some of you know, my W10 laptop has seen better days and has been semi-retired for now.
I am now using a light Linux distro on a i3-3xxx CPU as a daily driver for both web browsing and Atari code development, but really need a code editor that does 'simple' code folding.
By simple, I mean, non language dependant, or not requiring me to write a thorough script to get it working.
Ive tried CodeBrowser, TextAdept Kate and NotePadqq, with no luck. Not really looking at stuff like VSCodium, as I need a lighter editor.
I will literally resort to writing code on the Atari at this rate, as XEDIT can do this easily. Surely theres something out there? :roll:
Any help would be much appreciated. :)
Re: Linux lightweight code editor with easy code folding?
Posted: 26 Sep 2023 10:52
by alexh
For code folding to work it has to be somewhat language sensitive.
https://www.geany.org/
Re: Linux lightweight code editor with easy code folding?
Posted: 26 Sep 2023 11:08
by chronicthehedgehog
There is only vi(m) :D
vim does code folding - though never used that feature tbh, so can't say whether it's good or not
Re: Linux lightweight code editor with easy code folding?
Posted: 26 Sep 2023 11:11
by rubber_jonnie
Visual Studio Code is available for Linux, probably worth a look.
Re: Linux lightweight code editor with easy code folding?
Posted: 26 Sep 2023 11:50
by mrbombermillzy
Like I said, thats a problem, as most of the editors dont cater for code folding with 68k asm. (Even enabled on plain text would be ok, I dont care for code completion/keyword highlight/etc anyway). I could set language to C/C++, but then the comment characters /* would cause errors in asm files.
rubber_jonnie wrote: 26 Sep 2023 11:11
Visual Studio Code is available for Linux, probably worth a look.
Again, VSCode/VSCodium are a bit too heavyweight/overkill for a low spec laptop. Ideally something like Notepad++ would be great.
chronicthehedgehog wrote: 26 Sep 2023 11:08
There is only vi(m) :D
vim does code folding - though never used that feature tbh, so can't say whether it's good or not
I havent tried that yet. I will have a look. Hopefully it can do 'dumb' folding out of the box rather than have the end user conform to some prerequisite code language use, or needing to code in-depth plugin scripting. :roll:
Many thanks for the input guys. :)
Re: Linux lightweight code editor with easy code folding?
Posted: 26 Sep 2023 13:21
by sporniket
Hello, I think gedit will suffice, with a little plugin
https://github.com/aeischeid/gedit-folding
Installation :
Code: Select all
mkdir -p ~/.local/share/gedit/plugins
cd ~/.local/share/gedit/plugins
git clone https://github.com/aeischeid/gedit-folding
Then, start gedit, and activate the plugin : go to the "preferences" menu
Capture d’écran du 2023-09-26 14-16-41.png
In the plugins tab, enable "folding"
Capture d’écran du 2023-09-26 14-17-07.png
Now, go to a label in your source :
Capture d’écran du 2023-09-26 14-17-35.png
Type Alt-Z, and voilà...
Capture d’écran du 2023-09-26 14-18-04.png
Re: Linux lightweight code editor with easy code folding?
Posted: 26 Sep 2023 13:40
by alexh
mrbombermillzy wrote: 26 Sep 2023 11:50
most of the editors dont cater for code folding with 68k asm. Even enabled on plain text would be ok, I dont care for code completion/keyword highlight/etc anyway
The editor needs to understand the language syntax somewhat to know where to fold. You can't code-fold plain text as where would the delimiters be? Every line?
https://www.scintilla.org/
This definitely supports Motorola 68k asm and code folding.
Re: Linux lightweight code editor with easy code folding?
Posted: 26 Sep 2023 16:18
by mrbombermillzy
Thank you so much
@sporniket for literally spoon feeding me a solution.
Unfortunately, even still, after putting the 2 files in the plugins folder, they dont appear in the Preferences>plugins box. Im running gedit v44.2.
It doesnt appear to have the same layout as your example on the plugin screen (mine is less colourful), so I maybe need to check for version differences. Stay tuned. I will try that next.
alexh wrote: 26 Sep 2023 13:40
mrbombermillzy wrote: 26 Sep 2023 11:50
most of the editors dont cater for code folding with 68k asm. Even enabled on plain text would be ok, I dont care for code completion/keyword highlight/etc anyway
The editor needs to understand the language syntax somewhat to know where to fold. You can't code-fold plain text as where would the delimiters be? Every line?
I understand that it seems like most code folding is done in this manner.
However, as an end user, I dont care how they achieve that goal. Like I said earlier, I can use an editor on the Atari that does this without the above excuse, so it shouldnt be an impossible ask, surely? (I think XEDIT uses another file to record the folding, but Im not 100% sure; thats the whole point; I want to just use it, not learn the whole makeup of the app, as I do not have the time. I dont really want to tinker with linux distros/apps, just get work done with the minimal setup fuss).
Great! I will see how I get on with gedit and look into this if I dont get good results with that.
Again, thanks guys. I will keep going until I hopefully find something that works.
(Otherwise, Its a case of using HATARI with TT high and I can do everything I need from there).
Re: Linux lightweight code editor with easy code folding?
Posted: 26 Sep 2023 16:54
by sporniket
mrbombermillzy wrote: 26 Sep 2023 16:18
Unfortunately, even still, after putting the 2 files in the plugins folder, they dont appear in the Preferences>plugins box. Im running gedit v44.2.
I moved the plugin files to the same location as you, and it was working as well. I have gedit v41.0.
A little peek at the file `folding.plugin`, and it turns out it require python3. Do you have python3 installed ? (if so, typing `which python3` in a terminal should output something, typically `/usr/bin/python3`.
Re: Linux lightweight code editor with easy code folding?
Posted: 26 Sep 2023 17:04
by mrbombermillzy
sporniket wrote: 26 Sep 2023 16:54
Do you have python3 installed ?
Ive just checked the Synaptic File Manager and I have installed 3.11.2-1+b1. I dont have any other libraries/etc installed though, just the basic Python 3 language.
I wonder what Im missing here?