Closed martinklepsch closed 6 months ago
I ended up getting this to work by adding it to ~/.config/nvim/autoload/cljstyle.vim
. I found the instructions not super clear, would you be open for a PR improving them?
Ah, good to know - I use it in the autoload fashion, so maybe there's something special about the function hash name syntax? 🤔 Definitely open to a PR to clarify the instructions!
I think my suggested edit would be something similar to the below but maybe that's just because I don't really understand what any of the above is about 😅
Place the following in ~/.config/nvim/autoload/cljstyle.vim
function cljstyle#fix()
let cwd = getcwd()
let winsave = winsaveview()
execute "cd" . expand('%:p:h')
:%!cljstyle pipe
execute "cd" . cwd
call winrestview(winsave)
endfunction
" Example shortcut to fix the current file
nnoremap <leader>cs :call cljstyle#fix()<cr>
Huh, this does appear to be an issue with the hash-separated function name. https://neovim.io/doc/user/userfunc.html#autoload
Maybe this is related to Conjure, I'll dig in a bit and try to find a way to make it work but just wanted to flag this.
I added the following to
~/.config/nvim/after/ftplugin/clojure.vim
as described in the integrations doc.