sponsor Vim development Vim logo Vim Book Ad

vim-gitmodeline : Store modelines in git config

 script karma  Rating 6/3, Downloaded by 779  Comments, bugs, improvements  Vim wiki

created by
Andreas Schneider
 
script type
ftplugin
 
description
This is a vim plugin which reads modelines from the git config and sets it to the current buffer.
To set a modeline in the git config you can do it with the following command:

  git config --add vim.modeline "tabstop=8 shiftwidth=8 noexpandtab cindent"

The allowed modelines are defined in a variable and can be overwritten and
extended by setting the following in your .vimrc:

  let g:git_modeline_allowed_items = [
              \ "textwidth",   "tw",
              \ "softtabstop", "sts",
              \ "tabstop",     "ts",
              \ "shiftwidth",  "sw",
              \ "expandtab",   "et",   "noexpandtab", "noet",
              \ "filetype",    "ft",
              \ "foldmethod",  "fdm",
              \ "readonly",    "ro",   "noreadonly", "noro",
              \ "rightleft",   "rl",   "norightleft", "norl",
              \ "cindent",     "cin",  "nocindent", "nocin",
              \ "smartindent", "si",   "nosmartindent", "nosi",
              \ "autoindent",  "ai",   "noautoindent", "noai",
              \ "spell",
              \ "spelllang"
              \ ]

The git repository can be found here: https://github.com/cryptomilk/git-modeline.vim/
 
install details
Use a bundle installer like dein.
 

rate this script Life Changing Helpful Unfulfilling 
script versions (upload new version)

Click on the package to download.

package script version date Vim version user release notes
git_modeline.vim 0.1 2013-04-22 7.3 Andreas Schneider Initial upload
ip used for rating: 3.149.251.154

If you have questions or remarks about this site, visit the vimonline development pages. Please use this site responsibly.
Questions about Vim should go to the maillist. Help Bram help Uganda.
   
Vim at Github