Fork me on GitHub
#vim
<
2021-05-25
>
tylerw01:05:13

Has anyone gotten the clojure-lsp execute_commands to work under neovim's built-in lsp?

tylerw21:05:42

For posterity, I did get it working. My issue was that the cursor position tuple returned by vim.api.nvim_win_get_cursor() was different than what the standard vimscript col() and line() functions give.

Aron06:05:18

I haven't gotten any lsp or even good autocomplete working yet. If I use something once, it works, but only then.

Aron06:05:36

otoh, I have a more concrete question about using key bindings and movements, sexp or not: Imagine you are in the middle of your code, you write a call to another namespace for a helper function or maybe you use a piece of data and now you have to add a new require. I used to just go up, copy a line, change 2 words, done. Now it seems to be much more complicated, and I wonder how other people do it, what is an easy/fast way?

Aron10:05:18

Today I noticed that indentation is still broken in one of my files, but it's consistently broken, basically it resets to 0 and starts indenting from the beginning of the line as if we weren't inside deeply nested structure. I have zero idea how to debug this. Otherwise the =- shortcut works fine, produces a nicer output than what I had before.

Noah Bogart10:05:37

Do you have a code example for that behavior?

Aron10:05:51

I will have to clear up the code from unrelated stuff that might contain sensitive info for work. Not sure when I will have time, but if it persists, I will definitely do it before I try anything else.

Noah Bogart11:05:08

No worries, just hard to envision exactly what’s happening

jkrasnay11:05:05

By default the Clojure formatter in Vim breaks if the form is more than 100 lines. Try let g:clojure_maxlines = 200

noisesmith16:05:34

or stop writing 101 line monstrosities :D

😂 3
Aron17:05:42

it's a react app, it's a flat list of a dozen components

Aron17:05:18

I use lots of whitespace and don't like long lines, could be much shorter otherwise

noisesmith18:05:37

I'm just teasing, I just fixed a 48 line function myself (finding all neighbors for an index when treating a flat array of length n*n as a modulo grid of dimension m)

Aron19:05:14

sounds like an esoteric problem that requires special library support : )