editorconfig / editorconfig-vim

EditorConfig plugin for Vim
http://editorconfig.org
Other
3.13k stars 137 forks source link

Does it work with nvim? #163

Open stepancheg opened 3 years ago

stepancheg commented 3 years ago

I see from issues, it is supposed to work with NeoVim. Can you clarify it in readme?

GiancarloAparicio commented 3 years ago

It works normally in neovim, even in android with termux it also works fine :), although I have only used the supported properties that are in the README

cxw42 commented 3 years ago

@stepancheg I would welcome a PR to update the README :)

desdic commented 2 years ago

Well using neovim 0.6.0 it seems to load and set the autocmd but it dosn't seem to work .. like the load is done before the default of nvim. I haven't figured it out yet but it seems that it broke when 0.6.0 was released.

Anyhow once reloaded it works fine so

augroup _editorconfig
autocmd BufEnter * :EditorConfigReload
augroup END

does the trick for me

twnaing commented 2 years ago

I have the same problem here. I am not very proficient at vimscript, but the plugin tries to do it here.

# https://github.com/editorconfig/editorconfig-vim/blob/master/plugin/editorconfig.vim#L259
function! s:EditorConfigEnable(should_enable)
    augroup editorconfig
        autocmd!
        if a:should_enable
            autocmd BufNewFile,BufReadPost,BufFilePost * call s:UseConfigFiles()
        endif
    augroup END
endfunction

@desdic's trick works for me.

duck-rh commented 2 years ago

Quack,

I just installed the plugin on neovim 0.6.0-1 (on Debian unstable) and tested with a project with different settings for different extensions (especially different indent_style/indent_size) and it is working fine without any trick. I use vim-plug and the plugin iis loaded quite early after theming plugins and before anything else. I only set g:EditorConfig_exclude_patterns for fugitive/scp as recommended.

\_o<

herrbischoff commented 2 years ago

For me, it used to work. Using Neovim 0.7.2 it does not any more. Switched over to https://github.com/gpanders/editorconfig.nvim, works out of the box, no config. It has less configurability but I just need a simple plugin that works. Maybe interesting to someone else as well.

nyngwang commented 1 year ago

FYI: gpanders/editorconfig.nvim has been merged into NeoVim 0.9. See: https://github.com/neovim/neovim/pull/21633