Skip to content
This repository has been archived by the owner on Aug 21, 2023. It is now read-only.

editorconfig doesn't override clojure indent #43

Open
agriffis opened this issue Feb 19, 2019 · 4 comments
Open

editorconfig doesn't override clojure indent #43

agriffis opened this issue Feb 19, 2019 · 4 comments

Comments

@agriffis
Copy link

agriffis commented Feb 19, 2019

vim-clojure-static (distributed with vim) sets shiftwidth=2 and it seems like my .editorconfig isn't overriding that

@arp242
Copy link

arp242 commented Mar 12, 2019

I am not seeing this behaviour. I confirmed that /usr/share/vim/vim81/indent/clojure.vim contains:

setlocal softtabstop=2 shiftwidth=2 expandtab

And in a.clj it works as expected:

:verbose set sw?
  shiftwidth=2
        Last set from /usr/share/vim/vim81/indent/clojure.vim line 22

I then created a .editorconfig:

[*.cjl]
indent_size = 15

Which seems to work as expected:

:verbose set sw?
  shiftwidth=15
        Last set from ~/.vim/pack/plugins/start/vim-editorconfig/autoload/editorconfig/indent_size.vim line 16

@agriffis
Copy link
Author

Did your test really use *.cjl instead of *.clj?

I've tried this a few times, even with very minimal .vimrc and I can't make it work...

set nocompatible
set runtimepath+=~/.vim  " for neovim

call plug#begin('~/.vim/plugged')
Plug 'sgur/vim-editorconfig'
call plug#end()

with

[*.{bash,java,js,json,py,rb,xml,clj}]
indent_size = 4

and I get

:verbose set sw
  shiftwidth=2
        Last set from /usr/share/vim/vim81/indent/clojure.vim line 22

from vim, and

:verbose set sw
  shiftwidth=2                                                                                                                                                                                                      
        Last set from /usr/share/nvim/runtime/indent/clojure.vim

from neovim

@arp242
Copy link

arp242 commented Mar 12, 2019

I typo'd .clj as .cjl; do'h >_< I thought I had double-checked it but must have messed up regardless. How silly. In my defence, three consonants in a row is hard, and two of them being so similar doesn't help. Not a Clojure user so "clj" is not in the muscle memory.

I can reproduce the issue without the typo.

@agriffis agriffis changed the title functions to look up editorconfig settings editorconfig doesn't override clojure indent Mar 13, 2019
@agriffis
Copy link
Author

Experimenting...

This works:

[*]
indent_size = 4

This does not:

[*.clj]
indent_size = 4

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants