Closed ghost closed 7 years ago
Thanks for the detailed list of features!
In the case of FeatherPad, the fun has been making a lightweight feature-rich text editor that could be used not only for reading/editing simple files but also for coding. Most of the time, I use it instead of Qt Creator for programming. I've made its search, replacement, session manager, syntax highlighting and other features so that, on the one hand, they make editing and coding jobs easier and, on the other hand, the app remains lightweight.
Of course, a lot of features could be added to FeatherPad -- side-pane or customized syntax highlighting, for example -- but I really don't like to make a heavier version. Before adding any feature, I ask myself (1) if it is redundant (could its job be done in other ways), (2) if it makes FeatherPad heavy and (3) if it requires more dependencies. Only if all answers are negative, I'll start to work on it.
That being said, your list was inspiring to me. My opinion:
(1) Custom actions (converting Markdown to HTML, for example) and spell checking aren't compatible with lightness. Spell checking would require extra dependencies too. However, FeatherPad is already able to run executable script files with output.
(2) FeatherPad's session management is good for a lightweight text editor but I might add some features to it later. (I use the the Session Manager dialog a lot; it can also serves as a bookmark list.)
(3) Personally, I've found Kate's behavior annoying and don't like its selection highlighting at all. What I prefer is highlighting of found matches, as FeatherPad does. I often use it while coding. As for search and replace, a regex search is in my TODO list but first, I should replace QRegExp with QRegularExpression in the current code.
(4) I also like a side-pane but have to see if it can be added in such a way that it doesn't add to the weight when disabled.
(5) "Open as root" or, preferably, "save to root" is a good idea and deserves some study. I should see if it's possible without extra dependencies and under all DEs.
Oh, I forgot about custom syntax highlighting! After https://github.com/tsujan/FeatherPad/issues/30, I found out that it definitely needed extra dependencies like qscintilla
. In other words, syntax highlighting would be done outside FeatherPad. I can't help saying that I really like the concise way of syntax highlighting I've induced in FeatherPad ;) Please tell me if you could find another lightweight text editor that does its syntax highlighting itself! For example, gEdit uses gtk source view for that but it's still heavy. I'll make FeatherPad's syntax highlighting more complete but without custom highlighting because there would no fun in reinventing the (heavy) wheel ;)
All very reasonable points.
Yes, FeatherPad's syn-high is brilliant; only if you could include markdown and config/ini files as well for us, simple users.
(1) & (5) Just to clarify, all those "Open as root", "Spell check", "Markdown to HTML" etc. are custom actions as in pcman, that is I've created them. Here are two of them:
Would an option to use combobox (at the bottom next to search buttons) instead of tabs make it heavier like a side pane? And would you like that?
While those custom actions of QtC are fine, I would prefer much more simple one line commands of tea.
And please consider adding bash_aliases to the shell syntax as well.
As for combo box, I prefer a side-pane with filtering capability over it. If the user has opened 10 tabs and wants to work on a specific one, he/she could find it on the side-pane by filtering its name. I have a plan to disable the side-pane by default.
Custom actions are about file management -- I have several actions with pcmanfm-qt
and have prepared a patch to arrange them according to "level-zero.directory", for example. I don't see any relation to text editing here. Am I missing something? Yes, FeatherPad can execute script files but that's useful for coding. Could you please be more specific about how custom actions are related to text editing or coding?
Spell checking by using an external program is a very good idea. I just wonder how it could be implemented. Food for thought ;)
Opening as root can be done by using a custom action in pcmanfm-qt
or any other file manager. However, "Save to root" could come handy: the user opens a root file in FeatherPad, edits it and then, when he wants to save it, a root password prompt will be shown. That's my plan after reading your first comment but I have to see if it's possible under all DEs (KDE, LXQt, Gnome,...).
Will add "bash_aliases" to the "sh" syntax. Thanks!
Custom actions are all about external programmes, probably that's why they're called External Tools in qtcreator and Programmes in tea editor. I call them custom actions because of my prior familiarity with that terminology of pcman.
Both these editors provide us with some variables (basically "current directory", "current file base name", "current file extension" and "current selection") and execute external commands/programmes (pandoc, sed, sort, nl, vim, qupzilla etc.). Some of the outputs changes the current document naturally (sort, nl, sed etc.) and others just produce another document (pandoc, vim etc.).
Here is one of my pandoc actions (to produce an HTML document out of the currently edited markdown document):
pandoc -f markdown --css /home/burak/Public/CSS/pandoc.css --toc --toc-depth=4 -s -S -w html -o %{CurrentDocument:FileBaseName}.html %{CurrentDocument:FilePath}
The same command, thougn much simpler in tea editor:
pandoc %s -f markdown --css /home/burak/Public/CSS/pandoc.css --toc --toc-depth=4 -s -S -w html -o %dir/%basename.html
The bold parts are what the editors provide me with and are replaced by the real ones obviously.
Same with all the other actions (external programmes). Here's "Open as root" in tea editor:
lxsu tea %s
This action is useful when I want to edit a root-owned file opened as read-only in the first place.
Another one to show the colour in qarma/zenity of the selected #xxxxxx in qtcreator:
qarma --color-selection --color=#%{CurrentDocument:Selection}
To check the spelling of the selected word:
echo %{CurrentDocument:Selection} | hunspell
If not clear, please tell me.
If you intend to implement this, you may not need another menu for these; just put actions related to the selection under the right click menu of that selection and put others under the right click menu of the files themselves on the forthcoming side pane.
Custom actions (external programmes) may not be terribly relevant for coders, but for others you may just put a single context menu under the currently edited document to "Open the Containing Directory" and leave all actions to be managed and executed by pcmanfm-qt, naturally, except for the ones on selection.
Please also consider, if not undesirable for you or needless bloat, an option to disable tabs when you implement the side pane and adding syntax highlighting for config files (.conf, .config, .cfg, .ini) and markdown.
Thank you for the explanation! I'll look into "custom actions" if I find enough free time.
an option to disable tabs when you implement the side pane
Sure! Whenever I start to work on it.
syntax highlighting for config files (.conf, .config, .cfg, .ini) and markdown.
Good idea! I gave it a high priority in my TODO list. The markdown doc should have one of several markdown extensions though; otherwise, a text editor like Kate couldn't highlight its syntax either.
What I'll do, in the order of doing them: ● config and markdown highlighting. ● QRegExp → QRegularExpression (a lot of work, I think, but necessary). ● side-pane. ● "Save to root, ● "Custom actions" The list may be revised, of course.
Thank you. And thank you as well for your patience!
Sorry for forgoting, for markdown just three extensions: .md, .mkd, .markdown.
There are several markdown extensions. I'll include: .markdown, .mdown, .mkdn. .md, .mkd, .mdwn, .mdtxt, .mdtext, .Rmd
Very fine. I'd tried to keep it feather-weight!
On another note, why not put FP as an optional dependency of LXQt, like Openbox for which there's a better alternative in fact (Fluxbox), but as a text editor there's only juffed which doesn't seem to be maintained aggresively and is not as light as FT?
I mean, why not other LXQt devs recommend it as such?
Very fine. I'd tried to keep it feather-weight!
Yes, the list isn't short but won't add to CPU usage as the last check.
I mean, why not other LXQt devs recommend it as such?
@pmattern wanted to do so. His bug reports and feature requests have been important for FeatherPad (and FeatherNotes). He often sees details that others don't. However, for some reason unknown to me, he hasn't had any activity since March. I hope he's fine and will return soon -- I miss his accuracy.
I too hope he's fine.
Added markdown to syntax highlighting. The markdown extensions recognized by Kate and gEdit were exactly what you proposed. So I removed the other extensions. Kate and gEdit weren't consistent in some cases; I chose the middle way for FeatherPad.
Since your knowledge of mardown is more than mine, I'd be grateful if you test the latest commit and let me know if there's a problem (but only inside the limits of Kate and gEdit)! Thanks in advance!
BTW, .bash_aliases
is also added.
Thank you very much for testing and especially for the tips!
I received your message when I'd removed quotation highlights and was adding correct highlights for "`" instead. Sometimes, syntax highlighting of a simple language isn't easy. Tomorrow I'll try to fix everything but will need your test again.
My pleasure and I'm in your service!
This type of code block is absent as well:
``` nrnrnnrnr nntnrn nrnrnt odoadood ```
Is this light highlighting (compared to qtcreator's) intentional or necessary for lightness? Taken from ~/.bashrc:
Again, is this intentional or for lightness that you don't paint "$CHOICE" and $DOC and "$OUTPUT" with light blue as well?
BTW, as you can see I could manage to get together external custom actions with qarma/zenity.
And finally, as a minor (non)enhancement, those light green and the default white seems a tad bright to "my eyes" especially because they make up the bulk of my texts, yet again one man's bright is another's legible.
Another highlight definition you may consider is restructuredtext (.rst) as it is, I believe, widely used, perhaps especially among programmers, especially python programmers though I don't use it myself.
Is this light highlighting (compared to qtcreator's) intentional or necessary.... Again, is this intentional or for lightness that you don't paint...
Long story short, I didn't copy syntax highlighting of any editor in FeatherPad -- whether on the usability level or on the coding one -- but implemented my own preferences. All quotes all highlighted similarly everywhere partly because of my preferences and partly because of less CPU usage. Editors like Qt Creator don't care about CPU usage (and they shouldn't). I might rethink that in future though.
And finally, as a minor (non)enhancement, those light green and the default white...
Tastes are different -- for some users, your other screenshots have a too low contrast and are not very readable (green on green, for example) -- but OK, I may increase the upper value of the dark scheme to 60.
Another highlight definition you may consider is restructuredtext
I'll look into it. Thanks.
BTW, markdown is almost ready. I'll make a commit soon today :)
Yes, I've thought so; no big deals anyway.
It's easily possible to highlight keywords inside quotes, like this:
The non-keywords are in green while keywords are styled like in other places. However, it isn't right for all languages and I have to see if it doesn't cause confusion with languages like sh.
EDIT: "make" can also be highlighted in the above screenshot.
I made a commit for markdown right now. Like always, your test would be very appreciated.
This was the second time I was deceived by the simple appearance of a language ;) I hope backquotes -- among tens of other things -- are OK now.
Some explanation:
(1) Making the following kinds of headings bold may not be possible with Qt (have you seen them bold in a Qt editor?) but the lines under them are colored like horizontal rules:
Heading 1
=========
Heading 2
---------
(2) Heading1 (with #
) and Heading2 (with ##
) are highlighted in the same way (as Kate does).
(3) It seems there is no consensus about bold-italic and strike-through. So I left them unformatted.
(4) Some colors are changed for more readability and consistency.
Please don't hesitate to tell me if you find a problem!
Thanks for the file! It was informative. I got happy, seeing that it was all about $(...)
; not keywords inside quotes.
I'll test rightaway.
I don't use those heading style and can't imagine them being terribly popular. They're in fact the rst's headings and yes, qtc can't/doesn't highlight the words themselves in markdown and highlights only the ------- because I think it sees as ruler rather than the heading. And in rst highlighting they're not painted in any way as far as I remember, certainly the headings themselves aren't painted.
I've rebuilt, but I can't see any difference; am I doing something wrong?
I've rebuilt, but I can't see any difference; am I doing something wrong?
If you had the latest git commit, probably a FeatherPad window was open before compilation and is still open after it, in which case, you should close all FP windows first.
No, can't see a difference. Have compared the newly pulled changelog (for instance) with the one on Github and they're same. Yet after compilation I can't see any difference about the markdown highlighting.
You should see something like this:
with the following markdown:
> Block quotes are
> written like so.
`monospace`
>
> They can span multiple paragraphs,
> if you like.
`inline code`
~~strikeout~~
**bold**
***bold italic***
<!--comment comment
> sds
comment-->
[inline link](http://example.com "Title")
<foo@bar.com>
<http://example.com>
[id2]: /path/to/image "alt text"
[Link](http://a.com)
[Link][1]
[1]: http://b.org
![Image](http://url/a.png)
![Image][1]
[1]: http://url/b.jpg
If that's the case, several things have changed. And see how github has made a mistake on the third line!
I see this:
I've looked at the diff and seen that I've got the latest changes/addition like in Changelog, yet…
I see this:
Oh, that's wrong. The latest commit is this:https://github.com/tsujan/FeatherPad/commit/69702b9f5069d84161a7455552f78a66c2221741
Right now, I downloaded the master zip with QupZilla, compiled it, and issued ./featherpad
inside the "featherpad" folder. The result was the same as in my last screenshot.
Grrrrrrr! Have just noticed, have compiled almost half a dozen times and have forgot to "make install"! Well!.....
Excuse me!
It works.
That red of codes are really very beautiful, but really too bright, you must have young eagle eyes!
If you can stretch the dark background something like 70-80 it would be most beautiful thing on the whole earth I guess. What do you think? No?
LOL! I'm not young.
I guess it's past midnight there, as it is here. Please take your time and test it -- maybe tomorrow?
All right. It's fine though. Thank you so much.
Thanks to your comments and screenshots (especially https://github.com/tsujan/FeatherPad/issues/37#issuecomment-307611419) , at last I found a way for highlighting bash quoted codes:
Will make a commit after some tests and polishing.
Elegant. Will be more elegant (in my personal FeatherPad) when I replace (just before compilation) that DarkGreen (highlighter.cpp line 122) with QColor (0, 170, 127);
and the DarkRed (line 121) with QColor (255, 170, 127);
, as well as the White (textedit.cpp line 38) with #c1c1c1;
! I'm not hinting at anything, just saying!
Highlighting bash quoted codes started to seem important to me after https://github.com/tsujan/FeatherPad/issues/37#issuecomment-307611419. Some other script languages may need it too.
At some point, I might find and add a user-friendly way for customizing some of highlight colors.
BTW, I may delete some long comments of mine and/or yours on this page to make room for more comments.
At some point, I might find and add a user-friendly way for customizing some of highlight colors.
Not a showstopper, especially in a lightweight editor. I was joking.
Highlighted the syntax of double quoted sh codes and also fixed xml highlighting.
Contrary to the simple appearance of the result, this is a very big change. While I was working on it, I was also wrestling with some problems in other apps (LXQt). I can just hope no mistake is made here -- not caring about probable LXQt mistakes ;)
So, although I tested, am testing and will test it, your tests would be really appreciated.
xml seems fine to me, no visible inconsistency.
I found my "little" mistake. A work for tomorrow.
With a new commit, I took another -- yet provisional -- approach to highlighting of bash command substitution variables and couldn't find any serious problem with the bash scripts I had. However, who knows what you might find? ;)
Yes, renders without any issue, seemingly. … Yet, if you force me to find anything I can point out the ./parse-sass.sh
near the end which is painted with a different colour in qtcreator though you might consider this unnecessary.
adw() {
sed -i "s|^\$base_color: if(\$variant == 'light',.*|\$base_color: if(\$variant == 'light', $(sed -n 2p $(sed -n 2p /home/burak/.config/qt5ct/qt5ct.conf | cut -d'=' -f2) | cut -c96-102), #a59d8c);|g; s|^\$text_color: if(\$variant == 'light',.*|\$text_color: if(\$variant == 'light', $(sed -n 2p $(sed -n 2p /home/burak/.config/qt5ct/qt5ct.conf | cut -d'=' -f2) | cut -c69-75), black);|g; s|^\$bg_color: if(\$variant == 'light',.*|\$bg_color: if(\$variant == 'light', $(sed -n 2p $(sed -n 2p /home/burak/.config/qt5ct/qt5ct.conf | cut -d'=' -f2) | cut -c105-111), #647d86);|g; s|^\$fg_color: if(\$variant == 'light',.*|\$fg_color: if(\$variant == 'light', $(sed -n 2p $(sed -n 2p /home/burak/.config/qt5ct/qt5ct.conf | cut -d'=' -f2) | cut -c15-21), #eeeeec);|g; s|^\$selected_bg_color: if(\$variant == 'light',.*|\$selected_bg_color: if(\$variant == 'light', $(sed -n 2p $(sed -n 2p /home/burak/.config/qt5ct/qt5ct.conf | cut -d'=' -f2) | cut -c123-129), darken(#4a90d9, 20%));|g" /home/burak/Downloads/Adwaita/_colors.scss && cd /home/burak/Downloads/Adwaita && ./parse-sass.sh _common.scss && cat /home/burak/Downloads/Adwaita/gtk-contained.css > /home/burak/.config/gtk-3.0/gtk.css
Thanks you!
Yet, if you force me to find anything I can point out the ./parse-sass.sh near the end ...
I think that's a mistake in qtcreator -- there's no reason to give it a different color. When I typed the meaningless string & /////haha
instead, qtcreator did the same thing.
Anyhow, highlighting of bash command substitution variables is complex. The current approach is a trick and not a real solution. Kate and Qt Creator are good but not perfect ,while gEdit is terrible in this regard. I found the KDE-independent library of Kate's syntax highlighting which, theoretically speaking, could be modified and included in FP. The recent bash difficulties made me think about that but I'm still really reluctant to do so -- at least not in the near future.
Yes, qtc has some quirks. Inclusion of Kate's syntax highlighting in FP would be fine, though FP is already a fine work (in my noob opinion); thanks for making it free.
FeatherPad is brilliant as a featherweight editor, especially compared to something like leafpad or the very heavyweight notepadqq. Yet how about making the best yet lightweight editor, a kate (or a better kate) without KDE, something whose heavy lifting has already been done by the developers of the Qt company itself: the TextEditor component of QtCreator?
Please excuse me and close this issue if it's not relevant here, but I couldn't help myself as it seems too good to be ignored universally while I've been using it happily –thouh not as a coder but plain end user, to edit config files and to write (with pandoc markdown).
Causes of this ignorance might be partly the preconditioning by its description as an IDE, partly its ugly, bloated and non-standard default view and partly the heavy download size (70MB in Arch) and still much heavier installed size (380MB) much of which is due to the (in fact optional) clang dependency. Removing it along with many plugins and modules (like QtDesigner, QtAssistant etc.) would make it much reasonable like kate (without the KDE stuff) I guess.
Just doing that and packaging it as QtCreator-Minimal or something might open people's eyes or basing a new editor on that core would be another alternative.
With QtCreator –in a very neat and functional GUI– I've got all the below and more while consuming a total of around 50MB RAM (according to
pc_mem
) by just enabling the TextEditor along with the Bookmarks and the DiffEditor plugins out of the many more available in the Help menu:CUSTOM ACTIONS (External Tools)
So, obviously, for instance, convert
Markdown > HTML
,Markdown > ODT
,Check Spelling of the Word
and see output in the General Messages pane,Open As Root
,Sort selection
etc. etc. etc. (Though I'd rather like this to be more easily reached under a separate menu rather than a nested one.) All with assignable key bindings.SESSIONS
I have three sessions (Configs, Notes, Work) each with many files and I like them to behave independently. When I open the Configs session I only see those files belonging to this session and in that the last opened one in front of me with the cursor position and very simply managed bookmarks retained as well. And when I open another file in that session it's automatically added only to that session. I open sessions by just issuing
qtcreator SESSION_NAME
or if qtcreator is already open I can as well change the session by File>Sessions>SESSION_NAME (though I'd rather like this as well to be more easily reached under a separate menu rather than a nested one). For files to be opened but not retained in and added to any session there's the Default session.SEARCH & REPLACE
Just a C+F brings everything to the bottom. If any text is selected it's already there too while all the other occurances are selected in the text body and marked at the corresponding places at the scroll bar. For adwance search there's also the Search panel with additional options like using regex, searchin in "Open Documents" or "Files in File System" etc.
EDITING
Block selection; moving, copying, inserting lines above/below as well as cutting/deleting them; toggling un/comment or upper/lowercase (all with customisable key bindings as usual); marks on the left showing the newly edited parts along with the "*" sign in "fancy bar" showing the current document as unsaved; split view or new window view etc.
SYNTAX HIGHLIGHTING
It uses kate's syntax definition files. So they're modifiable. I've added a few extensions to bash.xml and deskop.xml and modified markdown.xml a bit though this one has turned out to be harder for me. Could have even created a new syntax file for fountain markup. As for colour schemes (for syntax, background/foreground etc.) there're many styles already and it's easy to modify them or create new ones with live preview in Oqtions>TextEditor.
GUI
Side panes with Open Documents, Bookmarks, File System (with the option to synchronize with the current document) etc. –a better organisation than tabs which are only functional if you have just a few documents open (though there's a third party tabs plugin among many others). And, it has the "fancy bar", a kind of combobox containing the open documents and showing the current one in view. Mousing over it shows its path and right clicking offers some useful actions as in the side panes.
One peculiarity of QtCreator I find irritating is its internal theming mechanism rather than honering the system theme though there's a solution: after every update of qtcreator I use a bash alias (or function to be correct) to adapt a few colours from my qt5ct.conf and change two values to be "ture" instead of "false" in /usr/share/qtcreator/themes/flat.creatortheme.
Sorry for the verbosity and possibly showing the obvious, but at least it might serve a bit as an inspiration –though, again, it might possibly be an inspiration for the already inspired!