# [PATCH] Easier setup for the vim contribs.

4 messages from 2008-03-20 to 2008-03-21. Participants: Victor Bogado da Silva Lins, Samuel Tardieu, Jeff King.
Thread: https://gitlist.dev/t/12776

## Victor Bogado da Silva Lins, 2008-03-20 16:42

Subject: [PATCH] Easier setup for the vim contribs.
Message-ID: <1206031364.1717.11.camel@omicron.ep.petrobras.com.br>
URL: https://gitlist.dev/e/1206031364.1717.11.camel%40omicron.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

```

## Samuel Tardieu, 2008-03-20 16:56

Subject: Re: [PATCH] Easier setup for the vim contribs.
Message-ID: <2008-03-20-17-56-01+trackit+sam@rfc1149.net>
URL: https://gitlist.dev/e/2008-03-20-17-56-01%2Btrackit%2Bsam%40rfc1149.net
In-Reply-To: <1206031364.1717.11.camel@omicron.ep.petrobras.com.br>

```
>>>>> "Victor" == Victor Bogado da Silva Lins <victor@bogado.net> writes:

Victor> Just copy all files in the vim contrib directory to your .vim
Victor> and it will configure the syntax.

Do you know if it has been submitted for inclusion in vim?

  Sam
-- 
Samuel Tardieu -- sam@rfc1149.net -- http://www.rfc1149.net/

```

## Jeff King, 2008-03-21 01:46

Subject: Re: [PATCH] Easier setup for the vim contribs.
Message-ID: <20080321014627.GB1613@coredump.intra.peff.net>
URL: https://gitlist.dev/e/20080321014627.GB1613%40coredump.intra.peff.net
In-Reply-To: <1206031364.1717.11.camel@omicron.ep.petrobras.com.br>

```
On Thu, Mar 20, 2008 at 01:42:44PM -0300, Victor Bogado da Silva Lins wrote:

> Just copy all files in the vim contrib directory to your .vim and it
> will configure the syntax.

I think this is a good change, but...

> +  2.  Auto-detect the editing of git commit files:
> +      $ mkdir -p $HOME/.vim/ftdetect
> +	  $ cp ftdetect/gitcommit.vim $HOME/.vim/ftdetect

There is a slight tabs vs spaces indentation error here.

-Peff

```

## Jeff King, 2008-03-21 01:56

Subject: Re: [PATCH] Easier setup for the vim contribs.
Message-ID: <20080321015621.GC1613@coredump.intra.peff.net>
URL: https://gitlist.dev/e/20080321015621.GC1613%40coredump.intra.peff.net
In-Reply-To: <2008-03-20-17-56-01+trackit+sam@rfc1149.net>

```
On Thu, Mar 20, 2008 at 05:56:01PM +0100, Samuel Tardieu wrote:

> Victor> Just copy all files in the vim contrib directory to your .vim
> Victor> and it will configure the syntax.
> 
> Do you know if it has been submitted for inclusion in vim?

No, but there is an alternate and much fancier vim package (which
includes syntax highlighting) that is going to be in vim 7.2:

http://lists.alioth.debian.org/pipermail/pkg-vim-maintainers/2008-February/005169.html

Once that is out, we should probably either remove our contrib/vim or
add a note saying "better stuff is now in 7.2" (for those who are on
older versions). We could also maybe just start pointing people to that
version now:

  http://git.tpope.net/?p=vim-git.git;a=summary

-Peff

```
