git/list[1] front-page[2] threads[3] people[4] search[5] about
 

[PATCH] docs: add vim syntax modeline [RFC]

From
M Hickford via GitGitGadget <gitgitgadget@gmail.com>
Date
Jan 13, 2025, 21:03 UTC
Message-ID
<pull.1874.git.git.1736802194760.gitgitgadget@gmail.com>
From: M Hickford <mirth.hickford@gmail.com>

Git documentation is written in AsciiDoc. This format is easily mistaken for the pervasive Markdown.

Add a vim modeline to help editors identify the format and provide syntax highlighting, rendering and autocomplete.

This makes editing the documentation easier for prospective contributors. This is particularly important because new contributors often start with documentation changes.

An alternative could be to move the modeline up or down the file (the location is not important).

A simpler alternative could be to rename files *.adoc. This would have the advantage of being recognised by even more tools.

Signed-off-by: M Hickford <mirth.hickford@gmail.com>
---
    docs: add vim syntax modeline [RFC]
Published-As: https://github.com/gitgitgadget/git/releases/tag/pr-git-1874%2Fhickford%2Fasciidoc-v1
Fetch-It-Via: git fetch https://github.com/gitgitgadget/git pr-git-1874/hickford/asciidoc-v1
Pull-Request: https://github.com/git/git/pull/1874
 Documentation/git-add.txt | 1 +
 1 file changed, 1 insertion(+)
diff --git a/Documentation/git-add.txt b/Documentation/git-add.txt
index 5f2c3592b8d..123c98541b1 100644
--- a/Documentation/git-add.txt
+++ b/Documentation/git-add.txt
@@ -1,5 +1,6 @@
 git-add(1)
 ==========
+// vim: syntax=asciidoc
 
 NAME
 ----

base-commit: fbe8d3079d4a96aeb4e4529cc93cc0043b759a05
-- 
gitgitgadget
Next: brian m. carlson
Message 1 of 6 in “docs: add vim syntax modeline [RFC]”
  1. docs: add vim syntax modeline [RFC]M Hickford via GitGitGadget, Jan 13, 2025
  2. brian m. carlsonJan 13, 2025
  3. M HickfordJan 13, 2025
  4. Junio C HamanoJan 13, 2025
  5. M HickfordJan 16, 2025
  6. D. Ben KnobleJan 13, 2025

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.