Fork me on GitHub
#vim
<
2022-04-30
>
jkrasnay12:04:17

I’ve just started using tools.build and Neovim is doing some weird things with indentation when I edit build.clj

(ns build)

(defn hello
        [_]
        (println "Hello, world!")) 
The filetype shows as clojure and indentation works fine on other Clojure files under src in the same project. Does anyone have an idea of what could be going wrong here?

jkrasnay12:04:56

Very weird, it’s something about the file itself. If I copy one of my existing (properly indenting) source files over to build.clj in the project root the indentation works properly. So everything is working fine for me now, but I’m still curious how a file could get into such a state.

dave12:04:27

That indentation definitely looks very funky. :thinking_face: Is it possible that there are tabs in the file? There is probably a better way to check than this, but what I usually do is use this plugin's ga binding to inspect each "space" to see if it's a space or a tab. https://github.com/chrisbra/unicode.vim

jkrasnay20:04:34

I had a look at the bytes with xxd. Everything looks normal: no tabs, no byte-order marks… I’ll keep playing with it and post an update if I figure it out.