Ask HN: What code editors or IDEs are easily scriptable?
41–50 of 68 posts
Re: Ask HN: What code editors or IDEs are easily scriptable?
#42Re: Ask HN: What code editors or IDEs are easily scriptable?
#43Emacs ≥ 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…
Re: Ask HN: What code editors or IDEs are easily scriptable?
#44Re: Ask HN: What code editors or IDEs are easily scriptable?
#45emacs is basicly a lisp machine running a descent text editor on top of it. you can't get much more scriptable than that.
Re: Ask HN: What code editors or IDEs are easily scriptable?
#46What 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.
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?
#47Re: Ask HN: What code editors or IDEs are easily scriptable?
#48Earlier 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.
Re: Ask HN: What code editors or IDEs are easily scriptable?
#49Emacs 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?
#50Sublime 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"