Skip to content
Open
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@ The EditorConfig Vim plugin supports the following EditorConfig [properties][]:
or [PreserveNoEOL][] is required for this property)
* `trim_trailing_whitespace`
* `max_line_length`
* `spelling_language`
* `root` (only used by EditorConfig core)

## Selected Options
Expand Down
10 changes: 10 additions & 0 deletions plugin/editorconfig.vim
Original file line number Diff line number Diff line change
Expand Up @@ -519,6 +519,10 @@ function! s:ApplyConfig(config) abort " Set the buffer options {{{1
endif
endif

if s:IsRuleActive('spelling_language', a:config)
let &l:spelllang=s:ConvertLanguage(a:config['spelling_language'])
endif

call editorconfig#ApplyHooks(a:config)
endfunction

Expand All @@ -544,4 +548,10 @@ endfunction "}}}1
let &cpo = s:saved_cpo
unlet! s:saved_cpo

" {{{
function! s:ConvertLanguage(language)
" Change en-GB (from the editorconfig specification) to en_gb (
return tolower(substitute(a:language, "-", "_", ""))
endfunction
" }}}
" vim: fdm=marker fdc=3