git: b52e5e46b6 - main - fdp-primer: vim configuration for vale
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Sun, 13 Nov 2022 12:28:29 UTC
The branch main has been updated by bofh: URL: https://cgit.FreeBSD.org/doc/commit/?id=b52e5e46b6b4e1397ef14fe8b24b0f13812479b9 commit b52e5e46b6b4e1397ef14fe8b24b0f13812479b9 Author: Muhammad Moinur Rahman <bofh@FreeBSD.org> AuthorDate: 2022-11-13 12:26:57 +0000 Commit: Muhammad Moinur Rahman <bofh@FreeBSD.org> CommitDate: 2022-11-13 12:26:57 +0000 fdp-primer: vim configuration for vale Update vim configuration details for using with vale. Approved by: bcr Differential Revision: https://reviews.freebsd.org/D37377 --- .../en/books/fdp-primer/editor-config/_index.adoc | 42 ++++++++++++++++++++++ 1 file changed, 42 insertions(+) diff --git a/documentation/content/en/books/fdp-primer/editor-config/_index.adoc b/documentation/content/en/books/fdp-primer/editor-config/_index.adoc index e6218dfb88..1b0797132a 100644 --- 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 @@ Manual page writers can use the following keyboard shortcuts to reformat: * 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 @@ function Set_MAN() 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