Fork me on GitHub
#vim
<
2022-06-01
>
reborg09:06:05

Installed https://github.com/neoclide/coc.nvim, the clojure-lsp server and using https://github.com/snoe/dotfiles/blob/master/home/.vimrc. Impressive so far, will keep digging :) 🤞

dharrigan09:06:52

Also, if you want it, this is my vimconfig (that uses coc and coc-clojure and conjure)

reborg10:06:05

Thanks, very useful bits there, including the neat organisation.

dharrigan09:06:35

Hi @reborg I would encourage a good look at as a nice wrapper

reborg09:06:14

Is this a replacement for the list of shortcuts I have in my .vimrc? E.g., I currently have an explicit: `nnoremap <silent> crcn :call CocRequest('clojure-lsp', 'workspace/executeCommand', {'command': 'clean-ns', 'arguments': [Expand('%:p'), line('.') - 1, col('.') - 1]})<CR> ` to clean namespaces. If I install coc-clojure I should then remove them? Or is the plugin doing something else as well?

Noah Bogart21:06:10

Hey there! Missed this. you could remove those and rely on the commands that coc-clojure automatically creates, providing your own prefix in CocConfig with “clojure.keymaps.shortcut”: “cr”

👍 1
Ngoc Khuat11:06:29

has anybody experienced slowness when inserting a new line? especially when the file is large. I’m editing a 2000 lines file and when I insert a new line, it has a 7 seconds delay…

Ngoc Khuat12:06:26

I’m using neovim 7.0

dave12:06:07

I experience that too. I'd love to know why it's happening and ideally fix it

Ngoc Khuat12:06:50

this seems work for me: filetype plugin indent off

dave12:06:19

Hmm, but then does your cursor go to the right place when you go to the next line?

Ngoc Khuat12:06:15

let g:clojure_maxlines = 100 should works 🙂

Noah Bogart13:06:37

Looks like it's trying to consider the entirety of the file when determining indentation, which causes the slowdown

dave13:06:32

Aha! It turns out that I set it to let g:clojure_maxlines = 0 back in 2017 for some reason that I don't remember. Maybe I didn't have to deal with large Clojure files at that time.

dave13:06:46

I just removed that line and it's much faster now. I read that the default value is 300 lines, which seems like a good default.

Ngoc Khuat13:06:14

yea, I set it to 0 too haha.

😂 2
dave13:06:20

I believe that is the number of lines of code around your cursor that it will parse?

Ngoc Khuat13:06:41

yea it seems

dave13:06:44

0 means unbounded, i.e. parse the entire file

juhoteperi13:06:38

If you are adding a new line inside some form, it needs to parse the current form to find the correct indentation. There normally shouldn't be a need the whole file. The option will stop the parsing if you have e.g. 500 line map form.

Ngoc Khuat13:06:38

well, then it’s weird, I got the worst performance when I add a blank new line