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

Vim's gitconfig filetype (and folding)

From
Ted Pavlic <ted@tedpavlic.com>
Date
Jan 28, 2009, 16:56 UTC
Message-ID
<49808E56.3090300@tedpavlic.com>

I don't know who is responsible for maintaining the git-related files distributed with Vim, but it would be nice if folding was enable for the gitconfig filetype.

I've attached a sample set of folding rules that works well for me... Right now I have the attached file in ~/.vim/ftplugin/gitconfig.vim.

I'll paste those rules here (but beware of word wrap):

:set foldexpr=getline(v:lnum)=~'^[;#]\\s*\\(ex\\\|vi\\\|vim\\):'?\">1\":((getline(v:lnum)=~\"^#\\\\=[\")?\">1\":\"1\") :set fdm=expr

--Ted
-- 
Ted Pavlic <ted@tedpavlic.com>

   Please visit my ALS association page:
         http://web.alsa.org/goto/tedpavlic
   My family appreciates your support in the fight to defeat ALS.

--~--~---------~--~----~------------~-------~--~----~
You received this message from the "vim_use" maillist.
For more information, visit http://www.vim.org/maillist.php
-~----------~----~----~----~------~----~------~--~---



:set foldexpr=getline(v:lnum)=~'^[;#]\\s*\\(ex\\\|vi\\\|vim\\):'?\">1\":((getline(v:lnum)=~\"^#\\\\=[\")?\">1\":\"1\")
:set fdm=expr
Message 1 of 1 in “Vim's gitconfig filetype (and folding)”
  1. Ted PavlicJan 28, 2009

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.