diff --git a/documentation/content/en/books/fdp-primer/editor-config/_index.adoc b/documentation/content/en/books/fdp-primer/editor-config/_index.adoc --- a/documentation/content/en/books/fdp-primer/editor-config/_index.adoc +++ b/documentation/content/en/books/fdp-primer/editor-config/_index.adoc @@ -62,6 +62,34 @@ * Press kbd:[P] to reformat paragraphs or text that has been selected in Visual mode. * Press kbd:[T] to replace groups of eight spaces with a tab. +A linter named link:https://vale.sh[Vale] has been introduced to check grammatical and cosmetic errors on the documents. +Vale has support for various editors and IDEs. + +Install package:textproc/vale[] + +[source,shell] +.... +$ pkg install vale +.... + +Install link:https://github.com/dense-analysis/ale[Ale] to integrate into package:editors/vim[], for using package:textproc/vale[] + +[source,shell] +.... +% mkdir -p ~/.vim/pack/vendor/start +% git clone --depth 1 https://github.com/dense-analysis/ale.git ~/.vim/pack/vendor/start/ale +.... + +Users who are using plugin managers for package:editors/vim[] do not need the above and should follow the instructions of the plugin manager to install link:https://github.com/dense-analysis/ale[Ale] + +At this moment due to a bug in the link:https://vale.sh[Vale] it is necessary to copy the link:https://vale.sh[Vale] configurations to the home directory. +Considering the repository was cloned into [.filename]#~/doc# copy as following: + +[source,shell] +.... +% cp -R ~/doc/.vale* ~/ +.... + [[editor-config-vim-config]] === Configuration @@ -123,8 +151,22 @@ call Set_Highlights_MAN() return 0 endfunction " Set_Man() + +let g:ale_fixers = { +\ '*': ['remove_trailing_lines', 'trim_whitespace'], +\} +let g:ale_linters = { +\ 'asciidoc': ['vale'], +\} +let g:ale_fix_on_save = 1 .... +[IMPORTANT] +====== +Above configuration will automatically remove trailing line, trailing space and multiple spaces which might display additional unwanted changes in `git diff` output. +In such cases properly mention that in the commit log. +====== + [[editor-config-emacs]] == Emacs