Best way to make an advanced text editor?
So editors/ides like vs code, vim, sublime etc. What are the best languages/guis/technologies for making an advanced text editor?
I've made a Vim-like text editor (cough https://replit.com/@CHRISTIANMATTHY/pybless ), and it is a pain, but I used python and Curses. It is nice to use, I am just usually dumb tho
@CHRISTIANMATTHY I don't understand how to use it I just see a blank screen in replit.com and when I run it on my computer it says "AttributeError: 'NoneType' object has no attribute 'fileno'".
@maxina I would use it on repl.it, and read the readme
@maxina I posted the wrong one too, whoops
@CHRISTIANMATTHY OOHHh I see it now wow that's so cool! I was trying to use that module on my computer and I kept getting errors though, any idea why?
On Windows, you need to pip install windows-curses
and remove the window resizing part. @maxina
@CHRISTIANMATTHY oh do I need to run it in command prompt?
@CHRISTIANMATTHY oh ok I got it running in my ubuntu terminal and it's less laggy than in replit.com. Very cool!
please help me i am under the wataaaaaa
If you want to create a CLI text editor (like Vim) then I think a system language (like C) fits the most. Here is a really good tutorial if you want to build one: https://viewsourcecode.org/snaptoken/kilo/
@Wumi4 Thanks!
Well, I'll tell you, to start, any language that has immutable strings will have garbage performance. Ex: JavaScript, Java, Python, etc. Find and replace operations are slow without mutable strings. Then again, they're just slow in general.
@xxpertHacker So I shouldn't use any of those?
@maxina You can, but when operating with large amounts of data, the performance will drop, unless you're using weird techniques to optimize everything, and even then it might be unpredictable.
But it's all your choice ¯\_(ツ)_/¯
Sublime was written in C++ and Python.
VSC was written in JS (iirc), and it can easily become sluggish with a good sized workload.
@xxpertHacker Ok do you knows any GUIs I should use?
@maxina Nope, but I agree with what SixBeebs had said, that's the most important part.
Depends on the language you're using though.
I've heard of IDEs being written in Electron and React before, but really any language with a GUI framework should be fine. Heck, you could even do it in browser
@SixBeeps Well I tried using Tkinter, but it is pretty limited
@SixBeeps I wanna build a Vim sort of editor
i think html, js, and css are the best language to make one. As a helper, here's a link on how to make a good one.
https://www.thatsoftwaredude.com/content/8912/create-a-basic-text-editor-in-javascript
@RYANTADIPARTHI Well I don't really want it to be in the browser and JavaScript isn't too fast for big files
@maxina well, you can also use python, or C. Maybe even java. Those are good too.
@RYANTADIPARTHI I want a GUI that will give me a lot of control over the text box
@maxina you can use styling for that. Css identifier. like an
id
orclass
. Choose width, and height.@RYANTADIPARTHI So you can set the location of the mouse in the textbox like the line and column?
@maxina it comes automatically if oyu are using the right tools.
In js, position of mouse and all comes automatically.
@RYANTADIPARTHI Like I want there to be key binds that the user can use and set the cursor mark somewhere else in the text
@maxina yes, comes normally. If it doesn't, ping me again.
@RYANTADIPARTHI What do you mean by it comes normally?
@maxina i meant in js, you usually get links for the first step. In that process, the cursor, and all comes normally.
@RYANTADIPARTHI :o ok thanks
@maxina no problem :)