I have used both vim and emacs for SC at various times, now back to using IDE. When I used scvim I had been doing a job working on remote web servers via ssh/vim and had the vim key commands in my fingers so it felt easier / more seamless. When I used emacs I was into the scripting and the macros and the idea that you can live your entire digital life within the text editor. Since I returned to the IDE about 6 years ago I have noticed I spend a lot less time trying to fix problems with my text editor.
Neovim with SCNvim is just a fantastic environment for SC, a joy. You can write scripts that send semantically meaningful sections of code to sclang - or pipe bits of text to other programs… and sclang can insert or otherwise process text in your buffer via Lua as well. check out this thread for more SCNVim - A NeoVim frontend for SuperCollider
Vim provides marks, folding, registers, macros, proper search and replace and many other productivity enhancers - and with nvim you get tree-sitter and snippets and auto-aligning and telescope who knows what else… at the cost of lots of learning and configuration. I have spent many hours hacking my nvim setup, true, but then I simply could not build the kind of big project I’m currently working on in the IDE…
And of course you need to take the time to learn the vim way of moving and acting in the first place - its a steep learning curve but can be very fast and pleasant in the end.
Interesting. So the scripting language is basically Lua, just like emacs-lisp is for emacs? (I don’t know Lua, but I understand it’s a minimalist language) I’ve played around with evil mode in emacs (vim keybidings emacs mode), and started to get used to it (although I turned it off now… ). I would give NeoVim a try eventually, specially if there were a detailed guide and documentation not just how to install, but how to configure the features you mentioned.
As far as emacs is concerned, there is nothing very special re supercollider coding. I like to use the concept of “project” or “workspace”, which is absent in scide; having everything accessible in that project. Opening other frames (windows) in any arrangement. And, in general, the code is much more organized. But I don’t think the editor makes that much of a difference.
I opened a random old project to show what I mean, see the treemacs window on the side. That’ s what I mean. Also, somehow, indentation works much better in emacs. Other things that you would like are snippets. LSP servers are available for other languages, not for sclang yet. All sorts of things not specific to supercollider are also available (even github copilot, which seems to be trendy now, but less useful than what people say)
Yes, you end up using the mouse a lot less. This also happens when you use a tiling window manager like XMonad (my case).
Impressive! This would be possible only in Emacs and too difficult to do with VIM? Or is it only a “syntax” difference?
If I am understanding it correctly, one + for nvim is to allow a SC workflow which is more like a professional software engineering context, right? searching in different files, seeing the project as a whole thing, accurate track of your changes, etc. Does this imply that your SC/VIM projects are more like algorithmic compositions, with big and complex code, that you run at once but take a long time editing? Also, that you don’t make GUI or interactive elements?
Can you say more specifically or with examples which scvim features helped you doing that?
I came across this video recently. Although it is Csound - and I don’t have any strong skill on it - I was trying to guess how emacs was used in this context.
As far as I can understand, emacs is being used here to allow a realtime interaction with the synthesis server, make faster indentation, evaluate small blocks of code, make bigger leaps with the cursor (between blocks or groups of code blocks) and enabling auto-completion.
This is more or less the default setting for interpreted languages like Sclang. It changes slightly between modes, but it is basically like this. You can choose the keyboard shortcuts (emacs also allows you to use vim shortcuts, for example). Many people find emacs default keybindings quite odd, because it was created years before the CUA bindings (Ctrl-C, Ctr-V etc), but you also have the option to use it if you prefer. Others find it challenging to grasp all Vim key sequences, but the basic ones are quite easy. You can try both.
Skipping blocks is just one of those shortcuts. Evaluate code blocks on both editors, too
If you want some visual effects while evaluating the code block, you can write your own function, for example:
(defun evaluate-code-block ()
"Evaluate the code block at point and highlight it with a pulsing effect."
(let ((start (progn (backward-up-list) (point)))
(end (progn (forward-sexp) (point))))
(pulse-momentary-highlight-region start end)
(eval-region start end)))
(global-set-key (kbd "<S-return>") 'evaluate-code-block)
I never hear this discussed but… I have a terrible memory for keyboard shortcuts, I don’t have good recall for more than maybe 6-8 common ones at any given time. This makes editors like vim and emacs completely unusable for me. Conversely, the command palette in VSCode was a huge leap forward for me, as I can type some text fragment for a command that I want, and usually find it immediately.
This is not to knock these text editors - I’ve watch people who work well with them, and the workflows are very cool & inspiring! But I’m always surprised that they’re organized around what I imagine to be a pretty particular and narrow sort of capacity (e,g, remembering a large number of letter and key combinations). Curious if anyone else has this problem?
FWIW I’ve never been a very fluid terminal terminal user because I have the same problem with command line flags - I’ve gotten shit for this from hardcore dev people once in a while, but ofc it’s no faster to use command line git if you have to read the man page every time you run any command…
nvim has a lively plugin ecosystem - I use which-key and Telescope for menus and fuzzy finding - and these are all hackable and configurable via Lua.
I’d also point out for those who haven’t tried it that basic vim is quite few key commands. - single letters are used for movements, copy paste, and selection and they are composed in a common sense way. so j is down - 4j is down 4 lines v is select v4j is select four lines below. y is copy - y4j is copy next four lines.
its not for everyone but it is super fast if you take the trouble to learn
my recent project is kind of like building a DAW - building the work environment at the same time as with building the piece - and the “app” is the editor. A lot of it is just ergonomics - making it possible to build out the piece in a reasonable amount of time! A scriptable editor just seems like a necessity
I used to use sclang-mode, and wanderlust for e-mail, and org-mode for calendar/todo.
Now, in Emacs, I use only org-mode (which is also a nice user-friendly front-end for LaTeX).
I would really like a colorizer for my live-coding dialect in SC, and SC-IDE is never going to support that… but the time it would take to get (back?) up to speed on Emacs-lisp is time I should be spending on Chinese vocabulary. So that ain’t gonna happen either.