Debugging Clojure Dev Environment in Vim
Yesterday, during my IPM my mentors noticed that my Vim setup wasn’t auto-indenting .clj files, and said this is something that I should really fix. I had been so focused on learning the syntax and writing functional code that I hadn’t even picked up that it should have been auto-indenting.
I started googling, and saw that a Vim Plugin that I already had installed, vim-clojure-static, should be handling the indentation. I uninstalled it and reinstalled it and it would still not auto-indent.
I uninstalled it and installed VimClojure and tried, and it would not work. I looked at both my Mentors’ .vimrc files on their Githubs and couldn’t figure it out.
I googled every search term that I could think of and I couldn’t find anything.
I uninstalled every single vim plugin that I have, and removed everything from my .vimrc file, and started reintroducing things one at a time, but it would still not indent.
Then I went and spoke to one of the Crafters here, Mollie, and she showed me her .vimrc file and gave me a few debugging steps, but I couldn’t find it. She published her .vimrc file to Github and I deleted mine and installed hers, and it still would not work! Then she kindly offered to come over and help debug, and we spent a good 40 minutes looking through everything.
We noticed that I had a /.vim/indent/clojure.vim file that she didn’t have, so tried deleting that and boom — everything worked.
It turns out that file was overriding vim-clojure-static’s settings, and I didn’t even know that file wasn’t supposed to be there.
Moral of the story — if you use someone else’s .vimrc files, there can be things that you don’t even think to look for causing you issues.
