Hello. I'm new to Clojure and I want to set up clj-kondo and async-clj-omni. I saw that clj-kondo comes with the ALE plugin so I just installed that
Plug 'dense-analysis/ale'
let g:ale_linters = {'clojure': ['clj-kondo']}
I also installed
Plug 'clojure-vim/async-clj-omni'
let g:async_clj_omni_source = ['cljs', 'clj', 'cljc']
au FileType clojure,scheme set omnifunc=async_clj_omni#omnifunc
But when I'm editing a clj file I don't get the linting or autocompletion.
when I run :set omnifunc? I get omnifunc=fireplace#omnicomplete so seems like vim fireplace keeps overriding the omnifunc. Any suggestions on how to solve this?
I'm using WSL, in case that is relevant.If you want to have completions based on what clj-kondo analyses, you might as well go directly with clojure-lsp :) @rahul080327 can probably tell you more about how to set that up
(if it's neovim at least)
i think this is vim+fireplace?
@borkdude I'm using Vim. I went with Ale because it seemed to also support linters for other languages. @rahul080327 Yes, that's one of the plugins I'm using.
ale is a good choice if you want to have just clj-kondo
yeah, cant help much with vim and the autocompletion. nvim i can help out much better with its lsp setup. its very different unfortunately
maybe @dominicm can?
@evgi88 you could maybe try https://github.com/neoclide/coc.nvim too, should run on vim and uses the lsp route
but that's the extent of my standard vim lsp knowledge
Here's docs for both ale + coc.nvim https://github.com/clj-kondo/clj-kondo/blob/master/doc/editor-integration.md#vim--neovim
and even a vanilla vim script way
(not sure if that script language is still supported since they had introduced a different language or so?)
@rahul080327 Can you help me understand what's the purpose of coc.nvim? And what is lsp route? @borkdude That's what I used (see my first code block).
@evgi88 are you familiar with the Language Server Protocol?
No. I'd be grateful if you could educate me on that but could we do it in a PM, please?
sure!
I'm not sure why you've set up async-clj-omni with those settings. You don't need to touch omnifunc at all.
Have you installed one of the completion engines mentioned in the readme?
async_clj_omni_source isn't even a setting as far as I recall. Did AI write this config?
You can indeed use ALE for linting, this is one thing.
You can configure your completion plugin to use completion sources. It seems that you want to use async-clj-omni as a source (which must obviously be compatible with your completion plugin). This plugin will merely call the 'omni-completion' function set in your vim, and fireplace is conveniently setting this function to help you complete when in a Clojure context.