Hacker News new | ask | show | jobs
by djha-skin 1386 days ago
All that stuff still exists, it just exists in the multiplexer instead of the editor. That's my point. I don't need it in the editor. I just need it.

Even better! It's not useful for just Lisp! It works for python, bash, whatever. That's not a bug, that's a feature. It's simple, lets the editor be the editor and the multiplexer be the multiplexer. It's much more "vim zen" than importing an entire repl process into the editor.

I've always known about slimv, I just like vim-slime better. My only complaint is that when it copies and paste texts around it's slower using interprocess communication than it is using TCP. But the nice thing I can see exactly what's happening instead of having it all hid from me. Makes debugging problems much easier.

Even describing slimv as a "mode" belies its emacs-ness. Vim doesn't have major and minor modes. It has insert mode and normal mode, that's it.

I don't even use fugitive. Why do it when the git CLI is faster? I've already learned the cli, why do I have to learn an entirely new set of commands to do the same things I already know how to do? Especially when I'm using vim inside GNU screen? C-a 2, boom, I'm in a CLI. Switching back and forth is a breeze. I have a few key bindings in vim that allow me to see the git blame line of a particular line, that's it.

Don't turn vim into a user interface for $x. Embed vim into other user interfaces. Vim plugin for intellij, vscode, vim inside a multiplexer, ... This works much better in my opinion.

1 comments

Thanks for the reply. I do have some questions to understand how far vim-slime can go in providing a good lisp interaction environment. For instance,

1. Can I select an s-expression (along with all the nested s-expressions within it) and send it to the REPL? When I checked vim-slime I saw that it has no understanding of s-expressions. The onus of carefully selecting the s-expression and sending it to REPL relied on the user. If I selected what amounts to nonsense and send it to the REPL, vim-slime sends that nonsense for evaluation. vim-slime did not seem to help with these things. Is that your experience too?

2. Does vim-slime use the compiled functions for autocompletion/suggestions? SLIME and I think SLIMV too helps with autocompletion, shows the valid arguments of a function automatically in the status line, and such things as I type code. SLIME/SLIMV make use of the compiled functions to provide IDE like completion/suggestion features. Can vim-slime do this?

SLIMV or real SLIME do have key-bindings to send any s-expression the cursor is on, or send a top level form automatically and send it to the REPL. Seeing the valid arguments in the status line as I type code is useful for functions where it is easy to forget which argument goes first and which goes second. Just some of the many small features I rely on while using the real SLIME with Emacs. Can vim-slime do these too? When I checked vim-slime it could not do these things and it could not do a bunch of other things that I consider essential for lisp interaction.

Sorry for all the edits, just want to write all my thoughts down in one place.

1. Various interactions I frequently have:

- `va(C-cC-c`. Select the current parentheses text object (s-expression) and send it to the repl.

-`C-aC-a`, switch to repl to view output, interact with debugger, etc.

- `ggVGC-cC-c`, select the entire file and send it to the repl.

- I've never done this one but since you mentioned it as useful to you: `?^(<CR>va(C-cC-c`, evaluate a top level form. Not perfect, but probably good enough especially if a line formatter is used to enforce sane indenting like this one for Clojure[6]. If a line formatter does not exist, the usual `ggVG=` built-in vim indenting works just fine.

- `:set makeprg=<command to run unit tests with line numbers>:make`. Batch error reporting and fixing, very useful[1]. In Clojure, e.g. `lein test` with some additions to set error format might be the `make` program.

vim-slime does not have an understanding of s expressions but vim itself does, using the parentheses object. See `:help text-objects`. I like that vim-slime does not have this understanding because what if I'm using it with Ruby or something. But vim support of text objects is good enough that it's never a problem. While I'm on the subject, `])` and `[(` searching for parens in vim is awesome.

Vim operates using an entirely different set of values than emacs. Selecting and searching for text should not be the purview of a plug-in, it should be built into the editor. Compiling code should be delegated to compilers. Vim does a great job of this kind of separation of concerns, it is the Zen of vim, its core philosophy. Emacs is great and it works fantastically, it just operates using a different philosophy.

2. I work more in Clojure but I'm trying to get more into common lisp. Clojure has suggestions in neovim via language server protocol[2]. The suggestions are very good[3]. This is not as developed for the common lisp story[4] but I'll try it out and see how good it is.

I've never had much patience for autocompletion. I don't even like it when the editor puts in pairs of parentheses when I've only typed the first left parentheses. Vim does have autocomplete through the language server protocol, but I don't use it.

Regarding suggestions as I type, there's ale[5], but I think I would find suggestions as I type a little too distracting and might slow me down. I find the normal LSP stuff to be good enough.

1: https://vim.fandom.com/wiki/Errorformat_and_makeprg

2: https://blog.inkdrop.app/how-to-set-up-neovim-0-5-modern-plu...

3: https://github.com/clojure-lsp/clojure-lsp

4: https://github.com/cxxxr/cl-lsp

5: https://github.com/dense-analysis/ale

6: https://github.com/venantius/vim-cljfmt