From nobody Tue Jun 28 07:44:25 2022 X-Original-To: dev-commits-doc-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id CCD6C8655CB for ; Tue, 28 Jun 2022 07:44:25 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4LXGnj5GNrz4f1n; Tue, 28 Jun 2022 07:44:25 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1656402265; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=PNzZWyyt3szIAfY6duOlbR0lx/AWW11BMcbmLCWHUbY=; b=Ch6HSKYThNeAAiPxCQ82xnPRuqPsgFnbHfD9R/op/bCr5aFLFAsvHN/xyosVKN1O1zDsX/ xXxfudqbLFh4o3yFYa3mf6SICwBSSW5a3F0tIFx+wMTc2etnh7lAVJ2v/VCNj/Sd6N2WSV XCTcmqsrbTyopiOEvnfgQBEewAZTSJUi8PojjL39Xf1XmXXJfgKVNLurKF2B7WxDN2YmPC AFU3zBQ5nsqK0iEFDDIDjWIirWOKvEGhfuhx0MENT9uWQFD5S9Mf4B/mVFmoqSVXh3cffw nbcBG6WuPaQJ2QNtC8mZez0DjdqACq35L0Spa0UjtadErUtuUMboi7ajgxP+wA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 92F2318C4A; Tue, 28 Jun 2022 07:44:25 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 25S7iPbA015605; Tue, 28 Jun 2022 07:44:25 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 25S7iPgq015604; Tue, 28 Jun 2022 07:44:25 GMT (envelope-from git) Date: Tue, 28 Jun 2022 07:44:25 GMT Message-Id: <202206280744.25S7iPgq015604@gitrepo.freebsd.org> To: doc-committers@FreeBSD.org, dev-commits-doc-all@FreeBSD.org From: Muhammad Moinur Rahman Subject: git: cab164f987 - main - Update vim config for adoc files List-Id: Commit messages for all branches of the doc repository List-Archive: https://lists.freebsd.org/archives/dev-commits-doc-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-doc-all@freebsd.org X-BeenThere: dev-commits-doc-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: bofh X-Git-Repository: doc X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: cab164f9878a93df4fb10f49939a991c46fb283e Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1656402265; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=PNzZWyyt3szIAfY6duOlbR0lx/AWW11BMcbmLCWHUbY=; b=IZXjZxvGbZSMzJYfoG4OfsfuMsmjgs/JqJe4yh5kAtg+oQmHrikckL+STdCCcFPSNSZh0s eEjt6vLDI/07dHYLRyWIRCodWYHxjw0RIlsI/nV4F0te8WSbHDwNKbyoj8Lx77CpHj9pV9 EjySSeBe1cdf+GtNBJuxX/9WFd/hg9Rc8UOvdPo/Ezuqq9n0BNQPCTvFYmtVTkgWlgewME mYbxZl9b+DagN1/oBDag9b0puCbJJ1id3j1K3bdHkdWsr3y73w70xu2OltOppvYDBt8yCO bZ14AceQ8vZYWFejjmLX7M0RZozldzahUZtyjNFEE6rj8pCBtJUx8fAFrdZ5xw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1656402265; a=rsa-sha256; cv=none; b=pyR92XH25v9ixMOAQbCEpn60GwVLQq+bqwenKtiS8zpIlTVwFRdWlYN9hZi6Vt1pN0PPal MHwgn7EU7rt0h015m3tP+cK7Bsst8U5BKlvcgaKBN8ji0nszCQKvvrieCd6ra1WcnWtlz/ vfZkvnoMC2iB1zNG7dsJKCkRC8uWJ78zUlmvVFWUAWqBF8evPsbLSzY0FwVdev4s1KiMxp jkG0D0eH1ZcGElZ0aFHNUqKzZr0qJ0KKKW1zBkSMZDTgrBkDp4Paw5KLHkK9lTLySPeB5u +H6LZIZEc7rQNhOoxtev/EebpS0t+PgR8CAwkTx5pzHemTCOJ/JXvhlMveXrWw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by bofh (ports committer): URL: https://cgit.FreeBSD.org/doc/commit/?id=cab164f9878a93df4fb10f49939a991c46fb283e commit cab164f9878a93df4fb10f49939a991c46fb283e Author: Muhammad Moinur Rahman AuthorDate: 2022-06-28 07:40:09 +0000 Commit: Muhammad Moinur Rahman CommitDate: 2022-06-28 07:40:09 +0000 Update vim config for adoc files In the en/books/fdp-primer/book/#editor-config-vim section the vim configuration is outdated and misinformed: - vim-tiny do not come with syntax highlighting files so recommending that might be counter-productive - For advanced users advise ale linter - Split the functions for two different purposes: adoc and man - There is no concept of wrapping in adoc as we are following the rule "one sentence one line". On the other hand man pages should have a wrap at around 72 considering the historical purpose. So remove wrapping(Press[P]) from adoc and use only for man - There is also no usage of TAB too in adoc so accompany the(Press[T]) only for man and remove from adoc - Extra White Spaces should be applicable for both adoc and man while OverLength marker should be only for man - Use appropriate syntax and filetype for asciidoc and man PR: 264921 Approved by: crees --- .../en/books/fdp-primer/editor-config/_index.adoc | 84 +++++++++++++--------- 1 file changed, 51 insertions(+), 33 deletions(-) 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 d034d87737..bb3314bee6 100644 --- a/documentation/content/en/books/fdp-primer/editor-config/_index.adoc +++ b/documentation/content/en/books/fdp-primer/editor-config/_index.adoc @@ -52,13 +52,15 @@ Adjusting your text editor configuration can make working on document files quic [[editor-config-vim]] == Vim -Install from package:editors/vim[], package:editors/vim-console[], or package:editors/vim-tiny[] then follow the configuration instructions in <>. +Install from package:editors/vim[], or package:editors/vim-console[], then follow the configuration instructions in <>. +More advanced users can use a proper linter like link:https://github.com/dense-analysis/ale[Ale] which can also act as a Vim link:https://langserver.org/[Language Server Protocol] client. [[editor-config-vim-use]] === Use -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. +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. [[editor-config-vim-config]] === Configuration @@ -68,43 +70,59 @@ Edit [.filename]#~/.vimrc#, adding these lines to the end of the file: [.programlisting] .... if has("autocmd") - au BufNewFile,BufRead *.sgml,*.ent,*.xsl,*.xml call Set_SGML() - au BufNewFile,BufRead *.[1-9] call ShowSpecial() + au BufNewFile,BufRead *.adoc call Set_ADOC() + au BufNewFile,BufRead *.[1-9] call Set_MAN() endif " has(autocmd) function Set_Highlights() - "match ExtraWhitespace /^\s* \s*\|\s\+$/ - highlight default link OverLength ErrorMsg - match OverLength /\%71v.\+/ - return 0 -endfunction " Set_Highlights() + "match ExtraWhitespace /^\s* \s*\|\s\+$/ + return 0 +endfunction " Set_Highlights_Adoc() + +function Set_Highlights_MAN() + highlight default link OverLength ErrorMsg + match OverLength /\%71v.\+/ + return 0 +endfunction " Set_Highlights_MAN() function ShowSpecial() - setlocal list listchars=tab:>>,trail:*,eol:$ - hi def link nontext ErrorMsg - return 0 + setlocal list listchars=tab:>>,trail:*,eol:$ + hi def link nontext ErrorMsg + return 0 endfunction " ShowSpecial() -function Set_SGML() - setlocal number - syn match sgmlSpecial "&[^;]*;" - setlocal syntax=sgml - setlocal filetype=xml - setlocal shiftwidth=2 - setlocal textwidth=70 - setlocal tabstop=8 - setlocal softtabstop=2 - setlocal formatprg="fmt -p" - setlocal autoindent - setlocal smartindent - " Rewrap paragraphs - noremap P gqj - " Replace spaces with tabs - noremap T :s/ /\t/ - call ShowSpecial() - call Set_Highlights() - return 0 -endfunction " Set_SGML() +function Set_COMMON() + setlocal number + setlocal shiftwidth=2 + setlocal tabstop=8 + setlocal softtabstop=2 + setlocal formatprg="fmt -p" + setlocal autoindent + setlocal smartindent + call ShowSpecial() + call Set_Highlights() + return 0 +endfunction " Set_COMMON() + +function Set_ADOC() + setlocal syntax=asciidoc + setlocal filetype=asciidoc + call Set_COMMON() + return 0 +endfunction " Set_ADOC() + +function Set_MAN() + setlocal syntax=man + setlocal filetype=man + setlocal textwidth=70 + " Rewrap paragraphs + noremap P gqj + " Replace spaces with tabs + noremap T :s/ /\t/ + call Set_COMMON() + call Set_Highlights_MAN() + return 0 +endfunction " Set_Man() .... [[editor-config-emacs]]