TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

Ask HN: What code editors or IDEs are easily scriptable?

38 pointsby ericb9 months ago
I want to build a deeper relationship with an editor or IDE that&#x27;s designed to be extended or scripted.<p>I&#x27;d prefer to use an everyday-language I work in for scripting, which rules out Vimscript, Lua or Lisp. I&#x27;d be most happy with any of Ruby, Python, Go or Rust. Ideas?

36 comments

lambdaba9 months ago
You shouldn&#x27;t dismiss Lua outright, it&#x27;s a language designed specifically for embedding, there&#x27;s practically nothing to learn to begin using it productively.<p>See this presentation by a core Neovim maintainer that explains why Lua was chosen <a href="https:&#x2F;&#x2F;www.youtube.com&#x2F;watch?v=IP3J56sKtn0" rel="nofollow">https:&#x2F;&#x2F;www.youtube.com&#x2F;watch?v=IP3J56sKtn0</a>.<p>See also <a href="http:&#x2F;&#x2F;lua-users.org&#x2F;wiki&#x2F;MechanismNotPolicy" rel="nofollow">http:&#x2F;&#x2F;lua-users.org&#x2F;wiki&#x2F;MechanismNotPolicy</a> to understand Lua&#x27;s core design.
ashton3149 months ago
Of the “preferred not” languages you listed, Lisp and Lisp-derivatives are easily the most pragmatic languages you will see doing “real” work outside of the scripting environment. So, given the dearth of good scriptable editors using other languages, why not give Emacs a try? I will grant that Elisp is a bit of an odd dialect, but a lot of what you learn from learning Elisp will transfer to understanding other languages better, modulo function names and whatnot. It’s also helpful that Elisp has comprehensive documentation available right from the editor itself. There are also hundreds of high-quality examples you can look at too, and Elisp lets to poke at basically every aspect of the editor.
评论 #41226570 未加载
holowoodman9 months ago
Plain old vim doesn&#x27;t only do vimscript, you can also script it in Perl, Python, TCL, Lua and maybe one more I cannot remember. See e.g. this python howto: <a href="http:&#x2F;&#x2F;codeseekah.com&#x2F;2012&#x2F;03&#x2F;04&#x2F;vim-scripting-with-python-lookup-ip-country&#x2F;" rel="nofollow">http:&#x2F;&#x2F;codeseekah.com&#x2F;2012&#x2F;03&#x2F;04&#x2F;vim-scripting-with-python-l...</a>
评论 #41226814 未加载
评论 #41228283 未加载
评论 #41225248 未加载
000ooo0009 months ago
Neovim. You can use Lua, but you can also use your language of choice via msgpack.<p><a href="https:&#x2F;&#x2F;github.com&#x2F;orgs&#x2F;neovim&#x2F;repositories?type=all&amp;q=Client">https:&#x2F;&#x2F;github.com&#x2F;orgs&#x2F;neovim&#x2F;repositories?type=all&amp;q=Clien...</a>
bloopernova9 months ago
Emacs, as has been mentioned multiple times in this thread, but I wanted to share a bit more about <i>why</i>.<p>Emacs is a text manipulation environment, and it&#x27;s incredibly powerful to be able to run any elisp code. In org-mode, I use plain lists and checkboxes often, and after inserting the checkbox, I always need to move my cursor 2 spaces to the right. Well, with Emacs and elisp, I can do that:<p><pre><code> (defun my-org-toggle-checkbox-and-move-right () &quot;Toggle checkbox and move cursor 2 spaces to the right.&quot; (interactive) (org-toggle-checkbox) (forward-char 2)) ;; Bind the function to a key if desired ;; (global-set-key (kbd &quot;C-c t&quot;) &#x27;my-org-toggle-checkbox-and-move-right) </code></pre> Other examples: <a href="https:&#x2F;&#x2F;www.reddit.com&#x2F;r&#x2F;emacs&#x2F;comments&#x2F;1bgyq3y&#x2F;wrote_my_first_function&#x2F;" rel="nofollow">https:&#x2F;&#x2F;www.reddit.com&#x2F;r&#x2F;emacs&#x2F;comments&#x2F;1bgyq3y&#x2F;wrote_my_fir...</a> or <a href="https:&#x2F;&#x2F;blog.thomasheartman.com&#x2F;posts&#x2F;my-first-emacs-lisp" rel="nofollow">https:&#x2F;&#x2F;blog.thomasheartman.com&#x2F;posts&#x2F;my-first-emacs-lisp</a> or <a href="https:&#x2F;&#x2F;emacs.stackexchange.com&#x2F;questions&#x2F;54602&#x2F;how-do-i-define-a-function-to-execute-as-a-command-with-m-x" rel="nofollow">https:&#x2F;&#x2F;emacs.stackexchange.com&#x2F;questions&#x2F;54602&#x2F;how-do-i-def...</a><p>And of course, because your config is text&#x2F;code you can version control it, which allows rollbacks if you make a mistake ;)
max_9 months ago
VSCode has a comprehensive API that you can create scripts for in Typescript
评论 #41225349 未加载
CarpeQueso9 months ago
Some people live in their editor and occasionally drop into a shell. I&#x27;ve personally found a lot less friction in doing the opposite. Live in the shell, and occasionally drop into your editor.<p>I used to think that it would be better to have a lot of scripting and automation built into my editor, but there are so many well-built, connect-able tools already available in a unix shell that it&#x27;s usually easier to write scripts in that context, instead. There are often easy ways to pull the outputs of those scripts into your editor or use your editor as a thin, pass-thru layer to run shell scripts on certain selected bits of text in a file.
评论 #41227136 未加载
评论 #41229741 未加载
mike_hearn9 months ago
Well, every IDE is designed to be extended. Unfortunately neither Go nor Rust are really intended for the extension use case. Sublime Text supports Python scripting but isn&#x27;t an IDE.<p>I think the best IDE scripting experience I know of right now is IntelliJ (or other Jetbrains IDEs) with the Live Plugin extension. You can write simple scripts in Kotlin or Groovy. They&#x27;re similar langs but the latter is dynamically typed. And then you can just do things like register menu items, explore the language AST, edit buffers, trigger refactorings, access remote machines. Anything, really.<p>As your script gets too big, you just convert it to a &#x27;real&#x27; plugin project with multiple files, can use libraries, etc.<p>Then you can upload it to the Marketplace so people can find it.<p>And if your plugin ends up being really good, Jetbrains run a monetization system so you can sell it easily. They handle all the billing, tax, licensing etc for you, so you can focus on your plugin.<p>It&#x27;s pretty rad. That said, in years of working with IntelliJ I never felt a need to extend it for my own personal use. It&#x27;s not like emacs where every user ends up with piles of elisp. The defaults are pretty good, and many features where in other IDEs you&#x27;d be forced to write a script can be done entirely via the GUI. For example if you want to define templates that auto-expand and where the cursor moves between &#x27;slots&#x27;, you can do that using a mini templating language without needing to do any coding. There&#x27;s a thing called Structural Search &amp; Replace which is similar - it lets you create templates that match against ASTs and do transforms on them.
Ancapistani9 months ago
I&#x27;ll echo others&#x27; comments that you should consider not completely ruling out Lua. I&#x27;m a Neovim user almost exclusively, and knew no Lua at all coming in to it. In less than a day I was up to speed enough to be able to write complex extensions in it, and honestly didn&#x27;t struggle much with the language itself in getting to that point. Most of my time was spent learning the APIs, not the language.<p>That said, while I&#x27;ve not done so, it _is_ possible to write Neovim extensions in Python. Check out this project for details: <a href="https:&#x2F;&#x2F;github.com&#x2F;neovim&#x2F;pynvim">https:&#x2F;&#x2F;github.com&#x2F;neovim&#x2F;pynvim</a><p>While there are obviously many editors out there these days, IMO the ubiquity of [n]vim and emacs make them strong leaders. Convincing me to use anything else would be difficult.<p>I love Neovim, and it fits my needs well - but my choosing it over emacs was largely arbitrary. Now I&#x27;m in a position where I understand Neovim very well but lack that knowledge of emacs. As far as I know they&#x27;re on par with each other.
enricozb9 months ago
Kakoune _barely_ has a scripting language. It has essentially a set of commands and some basic string substitution, one of which will let you drop to a shell (something akin to substitute this string with the result of evaluating its contents through bash). With this you can write your scripts in whatever language you like. My plugins are almost all in Rust, some are in bash.
评论 #41225387 未加载
评论 #41225575 未加载
_benj9 months ago
To add a few less popular options, I really liked working with TextAdept. Almost the whole API is accessible via Lua and you can script the heck out of that editor.<p>The challenge with that is that you don&#x27;t get a lot of items out of the box. The community is awesome though and the author of the project is very responsive in github.<p>There&#x27;s also Lite XL, which is also a very hackable editor. Also hackable in Lua. The documentation for it is a bit lacking but one can jump into the code and start tweaking things in it.<p>There&#x27;s also micro. This one also uses Lua for writing plugins and such. It&#x27;s a terminal editor if that&#x27;s something you are interested in.
weebull9 months ago
What kind of things do you want to script?<p>Personally I use macros in an editor for &quot;text manipulation&quot;, and drop to Python&#x2F;sed&#x2F;awk for &quot;text processing&quot;. I don&#x27;t find I have a need for anything in-between.
评论 #41225733 未加载
Woshiwuja9 months ago
Sublime uses python if i remember correctly
nosduco9 months ago
There are a variety of API clients written in various languages to configure and script Neovim including Ruby, Python, Go, and Rust. You can find an extensive list here: <a href="https:&#x2F;&#x2F;github.com&#x2F;neovim&#x2F;neovim&#x2F;wiki&#x2F;Related-projects#api-clients">https:&#x2F;&#x2F;github.com&#x2F;neovim&#x2F;neovim&#x2F;wiki&#x2F;Related-projects#api-c...</a>
solardev9 months ago
Do VScode and Jetbrains&#x27;s plug-ins &#x2F;extensions satisfy your scripting needs? They&#x27;re in JS and Java, I think.
评论 #41225165 未加载
评论 #41225360 未加载
dualogy9 months ago
You said no-Lua, but since for many interested in this thread Lua&#x27;s a non-problem, I&#x27;ll pitch a disconcertingly under-hyped &#x2F; under-noticed native (aka non-Electron) editor with Lua extension story (and many of its parts built on that plus its small C core) called TextAdept.<p>I&#x27;m still a happy camper on VSCode but if it ever begins to crumble&#x2F;rot&#x2F;overbloat (by subjective criteria), I&#x27;d hop onto that. Lua is (for my purposes here) no better&#x2F;worse than JS&#x2F;TS. Save for those darned 1-based array indexings!<p>LSP-capable too, last I heard, else it&#x27;d be a non-option for me in 2024. <a href="https:&#x2F;&#x2F;orbitalquark.github.io&#x2F;textadept&#x2F;" rel="nofollow">https:&#x2F;&#x2F;orbitalquark.github.io&#x2F;textadept&#x2F;</a>
gnomewascool9 months ago
Sublime Text? (It&#x27;s extendable in Python, but isn&#x27;t FOSS, which might be a deal-breaker.)
rtcode_io9 months ago
<a href="https:&#x2F;&#x2F;RTCode.io" rel="nofollow">https:&#x2F;&#x2F;RTCode.io</a> is built on Monaco! It&#x27;s incredibly easy to script!<p>0. Go to <a href="https:&#x2F;&#x2F;RTCode.io&#x2F;x&#x2F;" rel="nofollow">https:&#x2F;&#x2F;RTCode.io&#x2F;x&#x2F;</a><p>1. Type a number<p>2. Select the number<p>3. Press ↑&#x2F;↓ keys<p>3. Open the context menu (right click&#x2F;long tap)<p>4. Mess with Selections: or Eval menu items<p>Claude has helped with the selection actions!<p>See <a href="https:&#x2F;&#x2F;diff.rt.ht" rel="nofollow">https:&#x2F;&#x2F;diff.rt.ht</a> which is also built on Monaco!<p>For more advanced stuff visit: <a href="https:&#x2F;&#x2F;go.rt.ht" rel="nofollow">https:&#x2F;&#x2F;go.rt.ht</a> and select the Backend or PDF starters and hover over the attributes!<p>Feel free to view the sources to see how I script it!
davidkunz9 months ago
I wouldn&#x27;t exclude Lua, it&#x27;s a simple language whose basics you can learn pretty quickly if you know JavaScript or comparable languages. I therefore would recommend Neovim.
janoc9 months ago
Emacs.
alrenai9 months ago
The &#x27;custom css and js loader&#x27; extension for vscode is pretty good. since most of the editor is rendered with HTML you can pretty much do anything you want, pairs nicely with the built-in dev console and easier&#x2F;quicker to iterate than doing things the &#x27;proper way&#x27; via extensions&#x2F;api.
rjzzleep9 months ago
The team that built Neovim was actually very focused on python extensibility before they went for Lua IIRC, so the neovim python library works very well I think.<p><a href="https:&#x2F;&#x2F;pynvim.readthedocs.io&#x2F;en&#x2F;latest&#x2F;" rel="nofollow">https:&#x2F;&#x2F;pynvim.readthedocs.io&#x2F;en&#x2F;latest&#x2F;</a>
somat9 months ago
For myself the attraction of the unix operating environment(aka the userland) is that now your operating system is your ide.<p>Now admittedly this is never as sleek or uniform as an actual Integrated Development Environment, but the extensibility, well the extensibility is unmatched. you can even have an ide in your ide.
add-sub-mul-div9 months ago
&quot;Scripts in languages such as Python, PHP and awk can now be used to edit documents&quot;: <a href="https:&#x2F;&#x2F;www.textpad.com&#x2F;relnotes-textpad#v9050" rel="nofollow">https:&#x2F;&#x2F;www.textpad.com&#x2F;relnotes-textpad#v9050</a>
_benj9 months ago
adding a few fun ones that I&#x27;ve used in the past:<p>TextAdept. The API is fully open to Lua and a bunch of stuff can be scripted in it. The author is super responsive on github and has a nice small welcoming community.<p>Lite XL is mostly written in Lua, less documentation than TextAdept but is not terribly hard to jump into the code and figure out how the editor works and modify it.<p>Micro uses Lua for plugins. It&#x27;s a terminal only editor, which is a plus for some people, but still the mouse support is quite nice.
emidln9 months ago
IMO, the language is only a small part of a deeper relationship with your IDE. The IDE needs a good debugger, a good introspection system, and good hooks to modify things (ideally anything). Emacs meets this criteria, but few others do. This is why there is a living corpus of 40+ year old elisp that can be drawn upon for functionality and inspiration.
评论 #41225524 未加载
david15429 months ago
Definitely VS Code is my favourite. I’ve created so far 3 extensions. I really like the SDK and the way you can control every aspect of the IDE.
Teknomancer9 months ago
Emacs ≥ VIM ≥ Neovim<p>Started on Emacs because that was what Prof required, after leaving school with a BS in CS, switched to VIM, years afterwards found a comfy place in Neovim managed in NixOS via Flakes &amp; Home-Manager. A purely scriptable and declarative setup that can be reproduced on nearly any machine one might wish to work on. Scriptable interaction with Language Servers, Linters, Formatters and Debuggers in any language that is needed for work or fun (C, C++, Go, JavaScript, Lua, Python, Ruby, Rust, etc.)<p>Highly recommend.
评论 #41225660 未加载
pantsforbirds9 months ago
Zed is written in Rust: <a href="https:&#x2F;&#x2F;github.com&#x2F;zed-industries&#x2F;zed">https:&#x2F;&#x2F;github.com&#x2F;zed-industries&#x2F;zed</a>. It seems relatively straightforward to write an extension for it, but I&#x27;ve never personally tried (I suck at Rust).<p>I will say that Lua is extremely easy to pick up, and as far as hacking on an IDE I think that simplicity might make it an ideal language.
评论 #41228362 未加载
markhahn9 months ago
I&#x27;m curious about the implications of &quot;deeper relationship&quot;.
david15429 months ago
Definitely VS Code. I’ve created 3 extensions and I really like it.
cultofmetatron9 months ago
emacs is basicly a lisp machine running a descent text editor on top of it. you can&#x27;t get much more scriptable than that.
评论 #41225673 未加载
janoc9 months ago
Emacs
WhereIsTheTruth9 months ago
Sublime Text could have been perfect, it uses python and it is hot-reloadable, but the API is limited, you can&#x27;t extend the interface _at all_, want tabs in the build&#x2F;task panel? nope, want to customize your status bar with clickeable elements? nope<p>VSCode is a joke, you can&#x27;t use javascript, worse, you need to compile your scripts, and you need to restart the editor whenever you change your &quot;scripts&quot;
评论 #41225925 未加载
评论 #41225814 未加载
jvanderbot9 months ago
nvim has excellent lua scripting support.
评论 #41225163 未加载
acedTrex9 months ago
I mean as far as i know the only answer that fits your &quot;no lua&#x2F;lisp&quot; requirement is intellij IDEs, they use java&#x2F;kotlin.