Live data from Hacker News

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

news.ycombinator.com

41–50 of 68 posts

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

#43

Emacs ≥ VIM ≥ Neovim 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 & 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 an…

Are your signs backwards?

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

#45

emacs is basicly a lisp machine running a descent text editor on top of it. you can't get much more scriptable than that.

"Lisp machine" means a CPU or a computer specialized for running Lisp (which stopped being made in the 1980s or 1990s). You mean "a Lisp implementation" or "a Lisp language processor".

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

#46
post #15

What kind of things do you want to script? Personally I use macros in an editor for "text manipulation", and drop to Python/sed/awk for "text processing". I don't find I have a need for anything in-between.

Here's an example of extending an IDE (IntelliJ/PyCharm/RubyMine/WebStorm) by driving it externally:

I used just a little bit of code to make it so when I command-click a filepath anywhere, it opens in IntelliJ. This works in the browser, on chrome links, (github, gitlab, jenkins, error pages, etc) and also in iTerm on stack traces, spec/test paths. I made a chrome plugin, a shell script, and used the remote control plugin (not mine). The result was super-satisfying. I'll probably open source the bits soon. Now, I didn't script the IDE myself--the Remote Control Plugin did that work, but for an open source solution, I wouldn't mind building a remote control plugin myself.

Making this work got me wondering about doing the same with an open-source editor. I also would like to drive things internally, but I want it to be easy so I get a good return on the effort.

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

#47
The 'custom css and js loader' 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/quicker to iterate than doing things the 'proper way' via extensions/api.

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

#48
post #27

Earlier quoted context omitted.

In my experience, VS Code’s extension system really shines here. There are also boilerplate repos out there to get started.

> There are also boilerplate repos out there to get started. Should be unnecessary (and might be outdated unless meticulously maintained) IF one chooses to just follow the VSC API docs' `yo code` approach. Which generates the project structure with a simple hello `extension.ts` IIRC.

They are meticulously maintained, and far more comprehensive than yo code.

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

#49
Emacs, as has been mentioned multiple times in this thread, but I wanted to share a bit more about why.

Emacs is a text manipulation environment, and it'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:

  (defun my-org-toggle-checkbox-and-move-right ()
    "Toggle checkbox and move cursor 2 spaces to the right."
    (interactive)
    (org-toggle-checkbox)
    (forward-char 2))

  ;; Bind the function to a key if desired
  ;; (global-set-key (kbd "C-c t") 'my-org-toggle-checkbox-and-move-right)

Other examples: https://www.reddit.com/r/emacs/comments/1bgyq3y/wrote_my_fir... or https://blog.thomasheartman.com/posts/my-first-emacs-lisp or https://emacs.stackexchange.com/questions/54602/how-do-i-def...

And of course, because your config is text/code you can version control it, which allows rollbacks if you make a mistake ;)

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

#50

Sublime Text could have been perfect, it uses python and it is hot-reloadable, but the API is limited, you can't extend the interface _at all_, want tabs in the build/task panel? nope, want to customize your status bar with clickeable elements? nope VSCode is a joke, you can't use javascript, worse, you need to compile your scripts, and you need to restart the editor whenever you change your "scripts"

[flagged]
Post reply on HN