Ask coding questions

← Back to all posts
Best way to make an advanced text editor?
maxina (61)

So editors/ides like vs code, vim, sublime etc. What are the best languages/guis/technologies for making an advanced text editor?

Answered by RYANTADIPARTHI (6018) [earned 5 cycles]
View Answer
Comments
hotnewtop
RYANTADIPARTHI (6018)

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

maxina (61)

@RYANTADIPARTHI Well I don't really want it to be in the browser and JavaScript isn't too fast for big files

RYANTADIPARTHI (6018)

@maxina well, you can also use python, or C. Maybe even java. Those are good too.

maxina (61)

@RYANTADIPARTHI I want a GUI that will give me a lot of control over the text box

RYANTADIPARTHI (6018)

@maxina you can use styling for that. Css identifier. like an id or class. Choose width, and height.

maxina (61)

@RYANTADIPARTHI So you can set the location of the mouse in the textbox like the line and column?

RYANTADIPARTHI (6018)

@maxina it comes automatically if oyu are using the right tools.
In js, position of mouse and all comes automatically.

maxina (61)

@RYANTADIPARTHI Like I want there to be key binds that the user can use and set the cursor mark somewhere else in the text

RYANTADIPARTHI (6018)

@maxina yes, comes normally. If it doesn't, ping me again.

maxina (61)

@RYANTADIPARTHI What do you mean by it comes normally?

RYANTADIPARTHI (6018)

@maxina i meant in js, you usually get links for the first step. In that process, the cursor, and all comes normally.

CHRISTIANMATTHY (4)

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

maxina (61)

@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'".

CHRISTIANMATTHY (4)

@maxina I would use it on repl.it, and read the readme

CHRISTIANMATTHY (4)

@maxina I posted the wrong one too, whoops

maxina (61)

@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?

CHRISTIANMATTHY (4)

On Windows, you need to pip install windows-curses and remove the window resizing part. @maxina

maxina (61)

@CHRISTIANMATTHY oh do I need to run it in command prompt?

maxina (61)

@CHRISTIANMATTHY oh ok I got it running in my ubuntu terminal and it's less laggy than in replit.com. Very cool!

Nicolaijeddfj (0)

please help me i am under the wataaaaaa

Wumi4 (531)

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/

xxpertHacker (930)

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.

maxina (61)

@xxpertHacker So I shouldn't use any of those?

xxpertHacker (930)

@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.

maxina (61)

@xxpertHacker Ok do you knows any GUIs I should use?

xxpertHacker (930)

@maxina Nope, but I agree with what SixBeebs had said, that's the most important part.

Depends on the language you're using though.

SixBeeps (5221)

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

maxina (61)

@SixBeeps Well I tried using Tkinter, but it is pretty limited

maxina (61)

@SixBeeps I wanna build a Vim sort of editor