Mercurial > vim
view runtime/indent/gitconfig.vim @ 10147:65afd399ffa7 v7.4.2344
commit https://github.com/vim/vim/commit/169ebb080454357279ad5ad21ac532deaec605e8
Author: Bram Moolenaar <Bram@vim.org>
Date: Wed Sep 7 23:32:23 2016 +0200
patch 7.4.2344
Problem: The "Reading from channel output..." message can be unwanted.
Appending to a buffer leaves an empty first line behind.
Solution: Add the "out_msg" and "err_msg" options. Writing the first line
overwrites the first, empty line.
author | Christian Brabandt <cb@256bit.org> |
---|---|
date | Wed, 07 Sep 2016 23:45:05 +0200 |
parents | 43efa4f5a8ea |
children | 63b0b7b79b25 |
line wrap: on
line source
" Vim indent file " Language: git config file " Maintainer: Tim Pope <vimNOSPAM@tpope.org> " Last Change: 2016 Aug 29 if exists("b:did_indent") finish endif let b:did_indent = 1 setlocal autoindent setlocal indentexpr=GetGitconfigIndent() setlocal indentkeys=o,O,*<Return>,0[,],0;,0#,=,!^F let b:undo_indent = 'setl ai< inde< indk<' " Only define the function once. if exists("*GetGitconfigIndent") finish endif function! GetGitconfigIndent() let sw = exists('*shiftwidth') ? shiftwidth() : &sw let line = getline(prevnonblank(v:lnum-1)) let cline = getline(v:lnum) if line =~ '\\\@<!\%(\\\\\)*\\$' " odd number of slashes, in a line continuation return 2 * sw elseif cline =~ '^\s*\[' return 0 elseif cline =~ '^\s*\a' return sw elseif cline == '' && line =~ '^\[' return sw else return -1 endif endfunction