You are not logged in.

#1 2021-09-07 11:26:21

seth
Member
Registered: 2012-09-03
Posts: 49,981

Sqriptor. Greatest and best text editor in the world. Tribute.

Guess I'm just plugging this here.
https://github.com/luebking/sqriptor

It has syntax and autocompletion support for PKGBUILD - that counts.

I needed a textt editor that was not fat and slow and convoluted (so not an IDE and nothing that builds on electron/webengine or any other browser technology), didn't pull a complete desktop environment, reasonably competent (so not nano or notepad) but still easy to configure (so not scite, which is a lot of err… "fun" for just configuring syntax colors) and compatible with real humans (there goes vim) and since I wasn't happy w/ anything on the market, I just wrote one myself - NIH style.

It uses qscintilla, should™ build on Qt6 as well (but I'm testing on Qt5) and has some extra lexers (syntax highlight language support), in particular a better the best markdown lexer (well, arguably…).
I also added a filter feature to skim through journals smile

Developing is still loose and fast but I don't forsee massive trainwrecking changes. If you want to be safe: if the last commit was 5 minutes ago, wait an hour.

Feel free to test, be prepared for some lax informalities and have fun.
If you don't have fun because you feel like something very important (to you) is missing: ask. I won't implement random nonsense, but just because it's the best text editor that doesn't mean that it's perfect. I'm just shooting for perfection tongue

Offline

#2 2021-09-07 22:24:18

karabaja4
Member
From: Croatia
Registered: 2008-09-14
Posts: 997
Website

Re: Sqriptor. Greatest and best text editor in the world. Tribute.

Nice editor. It would be cool if find and replace functions would immediately highlight all the matches, similar to qtextpad:
thumb_highlight.png

Last edited by karabaja4 (2021-09-07 22:24:29)

Offline

#3 2021-09-08 02:21:30

Docbroke
Member
From: India
Registered: 2015-06-13
Posts: 1,433

Re: Sqriptor. Greatest and best text editor in the world. Tribute.

wayland support ?
It opens  with wayland but I cannot change font or font size etc.,.

btw., I use vis primarily but sometime I miss nice GUI text editor.

Offline

#4 2021-09-08 06:01:29

seth
Member
Registered: 2012-09-03
Posts: 49,981

Re: Sqriptor. Greatest and best text editor in the world. Tribute.

karabaja4 wrote:

It would be cool if find and replace functions would immediately highlight all the matches

Use case?

It's possible to use scintilla's indicator system for that (prototyped POC) but I'm not overly excited about the idea to search the entire doc for matches (which slows down the find in some editors and browsers and I do that w/ the filter feature which I tested against huge files)

Mitigation strategies:
1.  schedule the highlight (ie. wait a second after the last find intput to do one large search and indicate stuff)
2. only search and highlight the immediate context of the match (few thousand lines or so don't matter)
3. discrimintate the feature by file size

Downsides:
1. Still takes a complete search, might intervene w/ the user when unexpected - also the indication needs to break or update whenever the text gets edited
2. You'll noticate that if you scroll away from the search a lot
3. Might not fit the indend use

If you just want to see all matching lines, try to filter the document.

Offline

#5 2021-09-08 06:04:10

seth
Member
Registered: 2012-09-03
Posts: 49,981

Re: Sqriptor. Greatest and best text editor in the world. Tribute.

Docbroke wrote:

wayland support ?
It opens  with wayland but I cannot change font or font size etc.,.

Is that of Qt resp. QScintilla - I don't do anything for or against wayland support.
Do you fail to open the settings dialog or do the font changes simply not get applied?
Do they get applied when you close and re-open the editor (no, that's not supposed to be required ;-) I just want to understand where it fails)

Offline

#6 2021-09-08 06:35:05

Docbroke
Member
From: India
Registered: 2015-06-13
Posts: 1,433

Re: Sqriptor. Greatest and best text editor in the world. Tribute.

I am able to click on View -> Settings. A window opens, but there are no clickable/selectable elements there. I am not able to click or select font or font-size.

Offline

#7 2021-09-08 06:41:25

seth
Member
Registered: 2012-09-03
Posts: 49,981

Re: Sqriptor. Greatest and best text editor in the world. Tribute.

It's supposed to look kinda like this:
https://i.imgur.com/iaiJ1EY.png

Are there no *clickable* elements or just no elements at all?

Offline

#8 2021-09-08 07:16:07

karabaja4
Member
From: Croatia
Registered: 2008-09-14
Posts: 997
Website

Re: Sqriptor. Greatest and best text editor in the world. Tribute.

seth wrote:

Use case?

For me, it's the visual indicator that helps me identify the subset of the file I am interested in.

For example, /etc/sshd/sshd_config, I want to see the part of the file responsible for configuring password login. I search "password" and visually see what is the approximate area of the file I need to look at.

Filter feature is not really suitable for this purpose because it removes the context (surrounding lines). I am not interested in (modifying) the lines, I am interested in a block where the keyword appears.

Offline

#9 2021-09-08 07:17:18

Docbroke
Member
From: India
Registered: 2015-06-13
Posts: 1,433

Re: Sqriptor. Greatest and best text editor in the world. Tribute.

It looks same, just I cannot click anywhere. If I use keyboard arrow keys, " color dialog" can be selected and entered using return key, nothing else. Font cannot be selected using keyboard.

EDIT: this all works fine with X (cwm) or xwayland (hikari), but not with pure wayland (tabby)

Last edited by Docbroke (2021-09-08 07:18:22)

Offline

#10 2021-09-08 13:52:06

seth
Member
Registered: 2012-09-03
Posts: 49,981

Re: Sqriptor. Greatest and best text editor in the world. Tribute.

Seems input redirection fails.
=> Can you please test eg. sway?

In case it doesn't like a transient non-modal dialog:

diff --git a/settings.cpp b/settings.cpp
index 8558459..2f0ce55 100644
--- a/settings.cpp
+++ b/settings.cpp
@@ -136,6 +136,6 @@ void Sqriptor::showSettings()
     }
     config_bak = config;
     updateTiles();
-    gs_dlg->show();
+    gs_dlg->exec();
 }

Offline

#11 2021-09-08 14:22:23

seth
Member
Registered: 2012-09-03
Posts: 49,981

Re: Sqriptor. Greatest and best text editor in the world. Tribute.

karabaja4 wrote:

For me, it's the visual indicator that helps me identify the subset of the file I am interested in.

For example, /etc/sshd/sshd_config, I want to see the part of the file responsible for configuring password login. I search "password" and visually see what is the approximate area of the file I need to look at.

Ah, so it's more the overlay on the scrollbar, not so much the markings in the text (what rules out #2)
I'll re-implement the filter, check what performance gains there are to be made and whether I can use that for the line match indicator.
Otherwise it's gonna be discrimination by filesize (in a document w/ 100.000 lines the scrollbar isn't very accurate anyway)

Offline

#12 2021-09-08 16:08:41

Docbroke
Member
From: India
Registered: 2015-06-13
Posts: 1,433

Re: Sqriptor. Greatest and best text editor in the world. Tribute.

sqriptor works fine with sway ( even with xwayland disabled ). So this seems like tabby issue, possible because tabby doesn't support all wayland features.

Offline

#13 2021-09-08 22:09:40

seth
Member
Registered: 2012-09-03
Posts: 49,981

Re: Sqriptor. Greatest and best text editor in the world. Tribute.

There isn't anything special about that dialog, so you might want to inform the Parrot Inspector ;-)

Offline

#14 2021-09-09 01:53:16

Xyne
Administrator/PM
Registered: 2008-08-03
Posts: 6,963
Website

Re: Sqriptor. Greatest and best text editor in the world. Tribute.

seth wrote:

compatible with real humans (there goes vim)

NAQ wrote:

Q: What about vim?
A: I like vim. It's a great text editor. And in the hands of average humans an even better entropy generator.

Shot's fired! lol

I'm enjoying the levity and casual snark of the project so far. I've also been looking for a really simple and lightweight editor with decent syntax highlighting to replace the aging medit. I use vim most of the time but sometimes I just want to quickly open a file and do some copy&pasting with the mouse. I came to the same conclusion that most of what's out there is just too big and bloated for what I need. I'm glad that it irked you enough to write this. smile

Thanks!


My Arch Linux StuffForum EtiquetteCommunity Ethos - Arch is not for everyone

Offline

#15 2021-09-09 02:24:42

Docbroke
Member
From: India
Registered: 2015-06-13
Posts: 1,433

Re: Sqriptor. Greatest and best text editor in the world. Tribute.

seth wrote:

There isn't anything special about that dialog, so you might want to inform the Parrot Inspector ;-)

done ;-)

@Xyne

Have you tried vis, it is light compared to vim, with support for many vim features (atleast good enough to replace vim for me) and some extras inherited from sam(command language), and it supports x and wayland clipboard. There is no gui though.

Offline

#16 2021-09-09 02:39:28

Xyne
Administrator/PM
Registered: 2008-08-03
Posts: 6,963
Website

Re: Sqriptor. Greatest and best text editor in the world. Tribute.

Docbroke wrote:

@Xyne

Have you tried vis, it is light compared to vim, with support for many vim features (atleast good enough to replace vim for me) and some extras inherited from sam(command language), and it supports x and wayland clipboard. There is no gui though.

Thanks for the tip. I'll check it out but I'm not looking to replace Vim (to the great displeasure of some people around me who constantly laud Kakoune tongue). I use Vim when I'm actually working on something and I'm happy with it. I just like to have something that serves as an ever-so-slightly-glorified notepad that I can pop up with keyboard shortcut for some very basic ctrl+{c,v,x} editing on the fly.


My Arch Linux StuffForum EtiquetteCommunity Ethos - Arch is not for everyone

Offline

#17 2021-09-09 02:59:42

Docbroke
Member
From: India
Registered: 2015-06-13
Posts: 1,433

Re: Sqriptor. Greatest and best text editor in the world. Tribute.

Kakoune is difficult after vim, it requires you to unlearn vim habits. No such trouble with vis.

Offline

#18 2021-09-09 15:42:02

seth
Member
Registered: 2012-09-03
Posts: 49,981

Re: Sqriptor. Greatest and best text editor in the world. Tribute.

karabaja4 wrote:

Nice Greatest and best editor. It would be cool if find and replace functions would immediately highlight all the matches

Ftfy. Also https://github.com/luebking/sqriptor/co … 3bd836e22c smile

Offline

#19 2021-09-09 18:12:22

zaxdan69
Member
Registered: 2016-06-04
Posts: 271

Re: Sqriptor. Greatest and best text editor in the world. Tribute.

I just tried it and I like it very much. The color theming approach is very nice, simple and easy. I missed 2 futures though so far:
1. There is no an open recent files action
2. No support for different character encodings. I opened an .srt file which is in my native language and characters appear as rombes.

Offline

#20 2021-09-09 21:52:10

seth
Member
Registered: 2012-09-03
Posts: 49,981

Re: Sqriptor. Greatest and best text editor in the world. Tribute.

2. No support for different character encodings.

Meh. "man iconv"?

Scintilla operates in either utf-8 or latin1.
Ie. in utf-8, because it's 2021.

I could pipe the text through setText(QTextCodec::codecForName("thisshouldnotevenexist")->toUnicode(text())) and then back before saving it, but
1. you'd still have to select the encoding (at best one could blindly guess QTextCodec::codecForLocale())
2. A text editor isn't a codec converter.

Emotionally, it feels wrong to read datedlocale™ and silently write utf-8 and it feels even wronger to write datedlocale™
So at best I'd provide support to read legacy codecs and at conversion efforts slap you with an insult warning that the text will be saved in utf-8 (and even that feels like adding cruft)

Offline

#21 2021-09-10 07:30:22

zaxdan69
Member
Registered: 2016-06-04
Posts: 271

Re: Sqriptor. Greatest and best text editor in the world. Tribute.

I want to use sqriptor so I'll get what I can, lol. I don't mind to save a file as utf-8 if I want to edit it. This is a great text editor though. Thanks.

Last edited by zaxdan69 (2021-09-10 07:30:55)

Offline

#22 2021-09-10 15:51:31

seth
Member
Registered: 2012-09-03
Posts: 49,981

Re: Sqriptor. Greatest and best text editor in the world. Tribute.

Knock yourself out.
For the moment I rely on calling the external "file" process, but there'd also be https://archlinux.org/packages/extra/x86_64/uchardet/  and https://archlinux.org/packages/extra/x86_64/enca/
"file" is more likely available and it accurately determined a brief testfile as iso8859-1 where uchardet could just come up w/ "unknown" hmm

Offline

#23 2021-09-18 11:28:10

zaxdan69
Member
Registered: 2016-06-04
Posts: 271

Re: Sqriptor. Greatest and best text editor in the world. Tribute.

I'm trying to run sqriptor as root with  pkexec and after I put my password in popup window I get error about:

qt.qpa.xcb: could not connect to display 
qt.qpa.plugin: Could not load the Qt platform plugin "xcb" in "" even though it was found.
This application failed to start because no Qt platform plugin could be initialized. Reinstalling the application may fix this problem.

Available platform plugins are: eglfs, linuxfb, minimal, minimalegl, offscreen, vnc, wayland-egl, wayland, wayland-xcomposite-egl, wayland-xcomposite-glx, xcb.

Ακυρώθηκε (core dumped)

I've created a policy file in /usr/share/polkit-1/actions with these contents:

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE policyconfig PUBLIC
 "-//freedesktop//DTD PolicyKit Policy Configuration 1.0//EN"
 "http://www.freedesktop.org/standards/PolicyKit/1/policyconfig.dtd">
<policyconfig>

  <vendor>Sqriptor Editor</vendor>

  <action id="org.freedesktop.pkexec-sqriptor">
    <description>Run Sqriptor Editor as Root</description>
    <description xml:lang="el">Εκτέλεση του επεξεργαστή Sqriptor ως Root</description>
    <message>Authentication is required to run Sqriptor Editor as Root</message>
    <message xml:lang="el">Χρειάζεται πιστοποίηση για την εκτέλεση του επεξεργαστή Sqriptor ως Root</message>
    <icon_name>/home/useful/sqriptor-editor/sqriptor.svg</icon_name> 
    <defaults>
      <allow_any>auth_admin</allow_any>
      <allow_inactive>auth_admin</allow_inactive>
      <allow_active>auth_admin</allow_active>
    </defaults>
    <annotate key="org.freedesktop.policykit.exec.path">/usr/bin/sqriptor</annotate>
  </action>

</policyconfig

but I still get the same error(I found some similar cases and the .policy file fix ti but not in this case). Any idea what's wrong?

Last edited by zaxdan69 (2021-09-18 11:29:21)

Offline

#24 2021-09-18 11:39:17

seth
Member
Registered: 2012-09-03
Posts: 49,981

Re: Sqriptor. Greatest and best text editor in the world. Tribute.

I'm trying to run sqriptor as root

For principle reasons and regardless: Don't.

man sudoedit

qt.qpa.xcb: could not connect to display

You're lacking proper environment variables (notably DISPLAY and maybe XAUTHORITY but you do not want to run graphical processes as root anyway.

EDITOR=sqriptor sudoedit /etc/shadow

Offline

#25 2024-03-12 06:59:08

jclsn
Member
From: Hamburg
Registered: 2023-04-21
Posts: 4

Re: Sqriptor. Greatest and best text editor in the world. Tribute.

There can only be Vim!

Offline

Board footer

Powered by FluxBB