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

[PATCH] Easier setup for the vim contribs.

From
Victor Bogado da Silva Lins <victor@bogado.net>
Date
Mar 20, 2008, 16:42 UTC
Message-ID
<1206031364.1717.11.camel@omicron.ep.petrobras.com.br>
Just copy all files in the vim contrib directory to your .vim and it will configure the syntax.
---
 contrib/vim/README                 |   15 ++++++++-------
 contrib/vim/ftdetect/gitcommit.vim |    1 +
 2 files changed, 9 insertions(+), 7 deletions(-)
 create mode 100644 contrib/vim/ftdetect/gitcommit.vim
diff --git a/contrib/vim/README b/contrib/vim/README
index 9e7881f..7981765 100644
--- a/contrib/vim/README
+++ b/contrib/vim/README
@@ -1,8 +1,9 @@
 To syntax highlight git's commit messages, you need to:
-  1. Copy syntax/gitcommit.vim to vim's syntax directory:
-     $ mkdir -p $HOME/.vim/syntax
-     $ cp syntax/gitcommit.vim $HOME/.vim/syntax
-  2. Auto-detect the editing of git commit files:
-     $ cat >>$HOME/.vimrc <<'EOF'
-     autocmd BufNewFile,BufRead COMMIT_EDITMSG set filetype=gitcommit
-     EOF
+  1.  Copy syntax/gitcommit.vim to vim's syntax directory:
+      $ mkdir -p $HOME/.vim/syntax
+      $ cp syntax/gitcommit.vim $HOME/.vim/syntax
+  2.  Auto-detect the editing of git commit files:
+      $ mkdir -p $HOME/.vim/ftdetect
+	  $ cp ftdetect/gitcommit.vim $HOME/.vim/ftdetect
+  2b. Alternatively you can add the detection code to your vimrc file
+	  $ cat ftdetect/gitcommit.vim >> $HOME/.vimrc
diff --git a/contrib/vim/ftdetect/gitcommit.vim b/contrib/vim/ftdetect/gitcommit.vim
new file mode 100644
index 0000000..fed4684
--- /dev/null
+++ b/contrib/vim/ftdetect/gitcommit.vim
@@ -0,0 +1 @@
+autocmd BufNewFile,BufRead COMMIT_EDITMSG set filetype=gitcommit
-- 
1.5.5.rc0
Next: Samuel Tardieu
Message 1 of 4 in “Easier setup for the vim contribs.”
  1. Easier setup for the vim contribs.Victor Bogado da Silva Lins, Mar 20, 2008
  2. Samuel TardieuMar 20, 2008
  3. Jeff KingMar 21, 2008
  4. Jeff KingMar 21, 2008

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.