summaryrefslogtreecommitdiff
path: root/runtime/indent
diff options
context:
space:
mode:
Diffstat (limited to 'runtime/indent')
-rw-r--r--runtime/indent/GenericIndent.vim2
-rw-r--r--runtime/indent/ada.vim88
-rw-r--r--runtime/indent/automake.vim2
-rw-r--r--runtime/indent/ch.vim8
-rw-r--r--runtime/indent/cmake.vim4
-rw-r--r--runtime/indent/config.vim10
-rw-r--r--runtime/indent/css.vim18
-rw-r--r--runtime/indent/docbk.vim2
-rw-r--r--runtime/indent/eterm.vim2
-rw-r--r--runtime/indent/html.vim2
-rw-r--r--runtime/indent/make.vim162
-rw-r--r--runtime/indent/mma.vim14
-rw-r--r--runtime/indent/mupad.vim2
-rw-r--r--runtime/indent/ocaml.vim14
-rw-r--r--runtime/indent/php.vim36
-rw-r--r--runtime/indent/python.vim4
-rw-r--r--runtime/indent/readline.vim2
-rw-r--r--runtime/indent/rst.vim4
-rw-r--r--runtime/indent/sh.vim8
-rw-r--r--runtime/indent/sql.vim6
-rw-r--r--runtime/indent/sqlanywhere.vim46
-rw-r--r--runtime/indent/tcl.vim12
-rw-r--r--runtime/indent/xf86conf.vim2
-rw-r--r--runtime/indent/yacc.vim2
-rw-r--r--runtime/indent/zsh.vim2
25 files changed, 227 insertions, 227 deletions
diff --git a/runtime/indent/GenericIndent.vim b/runtime/indent/GenericIndent.vim
index 83523df71..67afd70ce 100644
--- a/runtime/indent/GenericIndent.vim
+++ b/runtime/indent/GenericIndent.vim
@@ -319,4 +319,4 @@ endfunction
"
" BUGS: You tell me! Probably. I just haven't found one yet or haven't been
" told about one.
-"
+"
diff --git a/runtime/indent/ada.vim b/runtime/indent/ada.vim
index 9601181bd..8cf915dc4 100644
--- a/runtime/indent/ada.vim
+++ b/runtime/indent/ada.vim
@@ -1,7 +1,7 @@
" Vim indent file
" Language: Ada
" Maintainer: Neil Bird <neil@fnxweb.com>
-" Last Change: 2004 Nov 23
+" Last Change: 2006 Apr 30
" Version: $Id$
" Look for the latest version at http://vim.sourceforge.net/
"
@@ -44,25 +44,25 @@ function s:MainBlockIndent( prev_indent, prev_lnum, blockstart, stop_at )
let line = substitute( getline(lnum), s:AdaComment, '', '' )
while lnum > 1
if a:stop_at != '' && line =~ '^\s*' . a:stop_at && indent(lnum) < a:prev_indent
- return a:prev_indent
+ return a:prev_indent
elseif line =~ '^\s*' . a:blockstart
- let ind = indent(lnum)
- if ind < a:prev_indent
- return ind
- endif
+ let ind = indent(lnum)
+ if ind < a:prev_indent
+ return ind
+ endif
endif
let lnum = prevnonblank(lnum - 1)
" Get previous non-blank/non-comment-only line
while 1
- let line = substitute( getline(lnum), s:AdaComment, '', '' )
- if line !~ '^\s*$' && line !~ '^\s*#'
- break
- endif
- let lnum = prevnonblank(lnum - 1)
- if lnum <= 0
- return a:prev_indent
- endif
+ let line = substitute( getline(lnum), s:AdaComment, '', '' )
+ if line !~ '^\s*$' && line !~ '^\s*#'
+ break
+ endif
+ let lnum = prevnonblank(lnum - 1)
+ if lnum <= 0
+ return a:prev_indent
+ endif
endwhile
endwhile
" Fallback - just move back one
@@ -82,15 +82,15 @@ function s:EndBlockIndent( prev_indent, prev_lnum, blockstart, blockend )
while lnum > 1
if getline(lnum) =~ '^\s*' . a:blockstart
let ind = indent(lnum)
- if ends <= 0
- if ind < a:prev_indent
+ if ends <= 0
+ if ind < a:prev_indent
return ind
- endif
- else
- let ends = ends - 1
+ endif
+ else
+ let ends = ends - 1
endif
elseif getline(lnum) =~ '^\s*' . a:blockend
- let ends = ends + 1
+ let ends = ends + 1
endif
let lnum = prevnonblank(lnum - 1)
@@ -122,25 +122,25 @@ function s:StatementIndent( current_indent, prev_lnum )
let lnum = prevnonblank(lnum - 1)
" Get previous non-blank/non-comment-only line
while 1
- let line = substitute( getline(lnum), s:AdaComment, '', '' )
- if line !~ '^\s*$' && line !~ '^\s*#'
- break
- endif
- let lnum = prevnonblank(lnum - 1)
- if lnum <= 0
- return a:current_indent
- endif
+ let line = substitute( getline(lnum), s:AdaComment, '', '' )
+ if line !~ '^\s*$' && line !~ '^\s*#'
+ break
+ endif
+ let lnum = prevnonblank(lnum - 1)
+ if lnum <= 0
+ return a:current_indent
+ endif
endwhile
" Leave indent alone if our ';' line is part of a ';'-delineated
" aggregate (e.g., procedure args.) or first line after a block start.
if line =~ s:AdaBlockStart || line =~ '(\s*$'
- return a:current_indent
+ return a:current_indent
endif
if line !~ '[.=(]\s*$'
- let ind = indent(prev_lnum)
- if ind < a:current_indent
- return ind
- endif
+ let ind = indent(prev_lnum)
+ if ind < a:current_indent
+ return ind
+ endif
endif
endwhile
" Fallback - just use current one
@@ -159,11 +159,11 @@ function GetAdaIndent()
while 1
let line = substitute( getline(lnum), s:AdaComment, '', '' )
if line !~ '^\s*$' && line !~ '^\s*#'
- break
+ break
endif
let lnum = prevnonblank(lnum - 1)
if lnum <= 0
- return ind
+ return ind
endif
endwhile
@@ -176,15 +176,15 @@ function GetAdaIndent()
" Check for false matches to AdaBlockStart
let false_match = 0
if line =~ '^\s*\(procedure\|function\|package\)\>.*\<is\s*new\>'
- " Generic instantiation
- let false_match = 1
+ " Generic instantiation
+ let false_match = 1
elseif line =~ ')\s*;\s*$' || line =~ '^\([^(]*([^)]*)\)*[^(]*;\s*$'
- " forward declaration
- let false_match = 1
+ " forward declaration
+ let false_match = 1
endif
" Move indent in
if ! false_match
- let ind = ind + &sw
+ let ind = ind + &sw
endif
elseif line =~ '^\s*\(case\|exception\)\>'
" Move indent in twice (next 'when' will move back)
@@ -198,10 +198,10 @@ function GetAdaIndent()
exe lnum
exe 'normal! $F)%'
if getline('.') =~ '^\s*('
- " Dire layout - use previous indent (could check for AdaComment here)
- let ind = indent( prevnonblank( line('.')-1 ) )
+ " Dire layout - use previous indent (could check for AdaComment here)
+ let ind = indent( prevnonblank( line('.')-1 ) )
else
- let ind = indent('.')
+ let ind = indent('.')
endif
exe v:lnum
elseif line =~ '[.=(]\s*$'
@@ -227,7 +227,7 @@ function GetAdaIndent()
elseif continuation && line =~ '^\s*('
" Don't do this if we've already indented due to the previous line
if ind == initind
- let ind = ind + &sw
+ let ind = ind + &sw
endif
elseif line =~ '^\s*\(begin\|is\)\>'
let ind = s:MainBlockIndent( ind, lnum, '\(procedure\|function\|declare\|package\|task\)\>', 'begin\>' )
diff --git a/runtime/indent/automake.vim b/runtime/indent/automake.vim
index 28d77a814..5fbc222bc 100644
--- a/runtime/indent/automake.vim
+++ b/runtime/indent/automake.vim
@@ -1,5 +1,5 @@
" Vim indent file
-" Language: automake
+" Language: automake
" Maintainer: Nikolai Weibull <now@bitwi.se>
" Latest Revision: 2006-04-19
diff --git a/runtime/indent/ch.vim b/runtime/indent/ch.vim
index 12d583d06..e1bd8a356 100644
--- a/runtime/indent/ch.vim
+++ b/runtime/indent/ch.vim
@@ -1,9 +1,9 @@
" Vim indent file
" Language: Ch
-" Maintainer: SoftIntegration, Inc. <info@softintegration.com>
-" URL: http://www.softintegration.com/download/vim/indent/ch.vim
-" Last change: 2003 Aug 05
-" Created based on cpp.vim
+" Maintainer: SoftIntegration, Inc. <info@softintegration.com>
+" URL: http://www.softintegration.com/download/vim/indent/ch.vim
+" Last change: 2006 Apr 30
+" Created based on cpp.vim
"
" Ch is a C/C++ interpreter with many high level extensions
diff --git a/runtime/indent/cmake.vim b/runtime/indent/cmake.vim
index a1ad832f2..46184c688 100644
--- a/runtime/indent/cmake.vim
+++ b/runtime/indent/cmake.vim
@@ -1,11 +1,11 @@
" =============================================================================
-"
+"
" Program: CMake - Cross-Platform Makefile Generator
" Module: $RCSfile$
" Language: VIM
" Date: $Date$
" Version: $Revision$
-"
+"
" =============================================================================
" Vim indent file
diff --git a/runtime/indent/config.vim b/runtime/indent/config.vim
index d763db0dc..77b4ebf1e 100644
--- a/runtime/indent/config.vim
+++ b/runtime/indent/config.vim
@@ -1,16 +1,16 @@
" Vim indent file
-" Language: Autoconf configure.{ac,in} file
-" Maintainer: Nikolai Weibull <now@bitwi.se>
+" Language: Autoconf configure.{ac,in} file
+" Maintainer: Nikolai Weibull <now@bitwi.se>
" Latest Revision: 2006-04-19
-" TODO: how about nested [()]'s in one line
-" what's wrong with '\\\@!'?
+" TODO: how about nested [()]'s in one line
+" what's wrong with '\\\@!'?
" Only load this indent file when no other was loaded.
if exists("b:did_indent")
finish
endif
-runtime! indent/sh.vim " will set b:did_indent
+runtime! indent/sh.vim " will set b:did_indent
setlocal indentexpr=GetConfigIndent()
setlocal indentkeys=!^F,o,O,=then,=do,=else,=elif,=esac,=fi,=fin,=fil,=done
diff --git a/runtime/indent/css.vim b/runtime/indent/css.vim
index 8c6f114fb..be1c4d73e 100644
--- a/runtime/indent/css.vim
+++ b/runtime/indent/css.vim
@@ -22,12 +22,12 @@ function s:prevnonblanknoncomment(lnum)
let line = getline(lnum)
if line =~ '\*/'
while lnum > 1 && line !~ '/\*'
- let lnum -= 1
+ let lnum -= 1
endwhile
if line =~ '^\s*/\*'
- let lnum -= 1
+ let lnum -= 1
else
- break
+ break
endif
else
break
@@ -45,13 +45,13 @@ function s:count_braces(lnum, count_open)
while i != -1
if synIDattr(synID(a:lnum, i + 1, 0), 'name') !~ 'css\%(Comment\|StringQ\{1,2}\)'
if line[i] == '{'
- let n_open += 1
+ let n_open += 1
elseif line[i] == '}'
- if n_open > 0
- let n_open -= 1
- else
- let n_close += 1
- endif
+ if n_open > 0
+ let n_open -= 1
+ else
+ let n_close += 1
+ endif
endif
endif
let i = match(line, pattern, i + 1)
diff --git a/runtime/indent/docbk.vim b/runtime/indent/docbk.vim
index b8af5f2a1..3fde2a13b 100644
--- a/runtime/indent/docbk.vim
+++ b/runtime/indent/docbk.vim
@@ -1,5 +1,5 @@
" Vim indent file
-" Language: DocBook Documentation Format
+" Language: DocBook Documentation Format
" Maintainer: Nikolai Weibull <now@bitwi.se>
" Latest Revision: 2006-04-19
diff --git a/runtime/indent/eterm.vim b/runtime/indent/eterm.vim
index 730924068..7424d917c 100644
--- a/runtime/indent/eterm.vim
+++ b/runtime/indent/eterm.vim
@@ -1,5 +1,5 @@
" Vim indent file
-" Language: Eterm configuration file
+" Language: Eterm configuration file
" Maintainer: Nikolai Weibull <now@bitwi.se>
" Latest Revision: 2006-04-19
diff --git a/runtime/indent/html.vim b/runtime/indent/html.vim
index 6c2d49942..cfea7d85e 100644
--- a/runtime/indent/html.vim
+++ b/runtime/indent/html.vim
@@ -1,7 +1,7 @@
" Description: html indenter
" Author: Johannes Zellner <johannes@zellner.org>
" Last Change: Tue, 27 Apr 2004 10:28:39 CEST
-" Globals: g:html_indent_tags -- indenting tags
+" Globals: g:html_indent_tags -- indenting tags
" g:html_indent_strict -- inhibit 'O O' elements
" g:html_indent_strict_table -- inhibit 'O -' elements
diff --git a/runtime/indent/make.vim b/runtime/indent/make.vim
index 65670566b..3fe5a493e 100644
--- a/runtime/indent/make.vim
+++ b/runtime/indent/make.vim
@@ -1,6 +1,6 @@
" Vim indent file
-" Language: Makefile
-" Maintainer: Nikolai Weibull <now@bitwi.se>
+" Language: Makefile
+" Maintainer: Nikolai Weibull <now@bitwi.se>
" Latest Revision: 2006-04-26
if exists("b:did_indent")
@@ -22,7 +22,7 @@ let s:assignment_rx = '^\s*\h\w*\s*+\==\s*\zs.*\\$'
" TODO: Deal with comments, string, and all kinds of other crap, e.g., defines.
" TODO: Unwrap the whole logic of this function into something that requires a
-" lot less “return”s.
+" lot less 'return's.
function GetMakeIndent()
let lnum = v:lnum - 1
if lnum == 0
@@ -30,92 +30,92 @@ function GetMakeIndent()
endif
" Figure out if the previous line is part of a rule or not. If it is, then
- " we more or less just indent by a ‘tabstop’, the previous’ lines indent, or
+ " we more or less just indent by a 'tabstop', the previous' lines indent, or
" remove all indent if the current line is itself a rule. Also, if the line
" in question is part of a continuation-line set constituting the rule line
- " itself, we indent by either a ‘shiftwidth’, if the line is the first in the
+ " itself, we indent by either a 'shiftwidth', if the line is the first in the
" continuation, or use the indent of the previous line, if not.
while lnum > 0
let line = getline(lnum)
if line[0] != "\t"
- " We found a non-shell-command line, i.e., one that doesn’t have a
+ " We found a non-shell-command line, i.e., one that doesn't have a
" leading tab.
if line =~ s:rule_rx
- " The line looks like a rule line, so we must therefore either be inside a
- " rule or we are a continuation line to that rule line.
- if line =~ s:continuation_rx
- " Ah, the rule line was continued, so look up the last continuation
- " line that’s above the current line.
- while line =~ s:continuation_rx && lnum < v:lnum
- let lnum += 1
- let line = getline(lnum)
- endwhile
- let lnum -= 1
- let line = getline(lnum)
- endif
+ " The line looks like a rule line, so we must therefore either be inside a
+ " rule or we are a continuation line to that rule line.
+ if line =~ s:continuation_rx
+ " Ah, the rule line was continued, so look up the last continuation
+ " line that's above the current line.
+ while line =~ s:continuation_rx && lnum < v:lnum
+ let lnum += 1
+ let line = getline(lnum)
+ endwhile
+ let lnum -= 1
+ let line = getline(lnum)
+ endif
- " If the line that we’ve found is right above the current line, deal
- " with it specifically.
- if lnum == v:lnum - 1
- " If it was continued, indent the current line by a shiftwidth, as it
- " is the first to follow it. Otherwise, depending on if the current
- " line is a rule line, i.e, a rule line following another rule line,
- " then indent to the left margin. Otherwise, the current line is the
- " first shell-command line in the rule, so indent by a ‘tabstop’
- if line =~ s:continuation_rx
- return &sw
- else
- return getline(v:lnum) =~ s:rule_rx ? 0 : &ts
- endif
- else
- " If the previous line was a continuation line, then unless it was
- " itself a part of a continuation line, add a ‘shiftwidth’’s worth of
- " indent. Otherwise, just use the indent of the previous line.
- " Otherwise, if the previous line wasn’t a continuation line, check
- " if the one above it was. If it was then indent to whatever level
- " the “owning” line had. Otherwise, indent to the previous line’s
- " level.
- let lnum = v:lnum - 1
- let line = getline(lnum)
- if line =~ s:continuation_rx
- let pnum = v:lnum - 2
- let pine = getline(pnum)
- if pine =~ s:continuation_rx
- return indent(lnum)
- else
- return indent(lnum) + &sw
- endif
- else
- let lnum = v:lnum - 2
- let line = getline(lnum)
- if line =~ s:continuation_rx
- while lnum > 0
- if line !~ s:continuation_rx
- let lnum += 1
- let line = getline(lnum)
- break
- endif
- let lnum -= 1
- let line = getline(lnum)
- endwhile
- " We’ve found the owning line. Indent to it’s level.
- return indent(lnum)
- else
- return indent(v:lnum - 1)
- endif
- endif
- endif
+ " If the line that we've found is right above the current line, deal
+ " with it specifically.
+ if lnum == v:lnum - 1
+ " If it was continued, indent the current line by a shiftwidth, as it
+ " is the first to follow it. Otherwise, depending on if the current
+ " line is a rule line, i.e, a rule line following another rule line,
+ " then indent to the left margin. Otherwise, the current line is the
+ " first shell-command line in the rule, so indent by a 'tabstop'
+ if line =~ s:continuation_rx
+ return &sw
+ else
+ return getline(v:lnum) =~ s:rule_rx ? 0 : &ts
+ endif
+ else
+ " If the previous line was a continuation line, then unless it was
+ " itself a part of a continuation line, add a 'shiftwidth''s worth of
+ " indent. Otherwise, just use the indent of the previous line.
+ " Otherwise, if the previous line wasn't a continuation line, check
+ " if the one above it was. If it was then indent to whatever level
+ " the 'owning' line had. Otherwise, indent to the previous line's
+ " level.
+ let lnum = v:lnum - 1
+ let line = getline(lnum)
+ if line =~ s:continuation_rx
+ let pnum = v:lnum - 2
+ let pine = getline(pnum)
+ if pine =~ s:continuation_rx
+ return indent(lnum)
+ else
+ return indent(lnum) + &sw
+ endif
+ else
+ let lnum = v:lnum - 2
+ let line = getline(lnum)
+ if line =~ s:continuation_rx
+ while lnum > 0
+ if line !~ s:continuation_rx
+ let lnum += 1
+ let line = getline(lnum)
+ break
+ endif
+ let lnum -= 1
+ let line = getline(lnum)
+ endwhile
+ " We've found the owning line. Indent to it's level.
+ return indent(lnum)
+ else
+ return indent(v:lnum - 1)
+ endif
+ endif
+ endif
endif
- " The line wasn’t a rule line, so the current line is part of a series
- " of tab-indented lines that don’t belong to any rule.
+ " The line wasn't a rule line, so the current line is part of a series
+ " of tab-indented lines that don't belong to any rule.
break
endif
let lnum -= 1
endwhile
" If the line before the one we are currently indenting ended with a
- " continuation, then try to figure out what “owns” that line and indent
+ " continuation, then try to figure out what 'owns' that line and indent
" appropriately.
let lnum = v:lnum - 1
let line = getline(lnum)
@@ -124,34 +124,34 @@ function GetMakeIndent()
if line =~ s:assignment_rx
" The previous line is a continuation line that begins a variable-
" assignment expression, so set the indent to just beyond the whitespace
- " following the assignment operator (‘=’).
+ " following the assignment operator ('=').
call cursor(lnum, 1)
if search(s:assignment_rx, 'W') != 0
- let indent = virtcol('.') - 1
+ let indent = virtcol('.') - 1
endif
endif
-
- " The previous line didn’t constitute an assignment, so just indent to
+
+ " The previous line didn't constitute an assignment, so just indent to
" whatever level it had.
return indent
endif
" If the line above the line above the current line ended was continued,
" then the line above the current line was part of a continued line. Find
- " the “owning” line and indent to its level.
+ " the 'owning' line and indent to its level.
let lnum = v:lnum - 2
let line = getline(lnum)
if line =~ s:continuation_rx
while lnum > 0
if line !~ s:continuation_rx
- let lnum += 1
- let line = getline(lnum)
- break
+ let lnum += 1
+ let line = getline(lnum)
+ break
endif
let lnum -= 1
let line = getline(lnum)
endwhile
- " We’ve found the owning line. Indent to it’s level.
+ " We've found the owning line. Indent to it's level.
return indent(lnum)
endif
diff --git a/runtime/indent/mma.vim b/runtime/indent/mma.vim
index 703e7dafd..356b87618 100644
--- a/runtime/indent/mma.vim
+++ b/runtime/indent/mma.vim
@@ -12,7 +12,7 @@
" let filetype_m="mma"
"
" Credits:
-" o steve hacked this out of a random indent file in the Vim 6.1
+" o steve hacked this out of a random indent file in the Vim 6.1
" distribution that he no longer remembers...sh.vim? Thanks!
" Only load this indent file when no other was loaded.
@@ -30,7 +30,7 @@ if exists("*GetMmaIndent")
endif
function GetMmaIndent()
-
+
" Hit the start of the file, use zero indent.
if v:lnum == 0
return 0
@@ -38,21 +38,21 @@ function GetMmaIndent()
" Find a non-blank line above the current line.
let lnum = prevnonblank(v:lnum - 1)
-
- " use indenting as a base
+
+ " use indenting as a base
let ind = indent(v:lnum)
let lnum = v:lnum
-
+
" if previous line has an unmatched bracket, or ( indent.
" doesn't do multiple parens/blocks/etc...
-
+
" also, indent only if this line if this line isn't starting a new
" block... TODO - fix this with indentkeys?
if getline(v:lnum-1) =~ '\\\@<!\%(\[[^\]]*\|([^)]*\|{[^}]*\)$' && getline(v:lnum) !~ '\s\+[\[({]'
let ind = ind+&sw
endif
- " if this line had unmatched closing block,
+ " if this line had unmatched closing block,
" indent to the matching opening block
if getline(v:lnum) =~ '[^[]*]\s*$'
" move to the closing bracket
diff --git a/runtime/indent/mupad.vim b/runtime/indent/mupad.vim
index aeef520e6..307aaf047 100644
--- a/runtime/indent/mupad.vim
+++ b/runtime/indent/mupad.vim
@@ -32,4 +32,4 @@ call GenericAllStmts()
"
" BUGS: You tell me! Probably. I just haven't found one yet or haven't been
" told about one.
-"
+"
diff --git a/runtime/indent/ocaml.vim b/runtime/indent/ocaml.vim
index 818b31bbc..1893d84a8 100644
--- a/runtime/indent/ocaml.vim
+++ b/runtime/indent/ocaml.vim
@@ -1,12 +1,12 @@
" Vim indent file
" Language: OCaml
-" Maintainers: Jean-Francois Yuen <jfyuen@happycoders.org>
-" Mike Leary <leary@nwlink.com>
-" Markus Mottl <markus.mottl@gmail.com>
-" URL: http://www.ocaml.info/vim/indent/ocaml.vim
-" Last Change: 2005 Jun 25 - Fixed multiple bugs due to 'else\nreturn ind' working
-" 2005 May 09 - Added an option to not indent OCaml-indents specially (MM)
-" 2005 Apr 11 - Fixed an indentation bug concerning "let" (MM)
+" Maintainers: Jean-Francois Yuen <jfyuen@happycoders.org>
+" Mike Leary <leary@nwlink.com>
+" Markus Mottl <markus.mottl@gmail.com>
+" URL: http://www.ocaml.info/vim/indent/ocaml.vim
+" Last Change: 2006 Apr 30
+" 2005 May 09 - Added an option to not indent OCaml-indents specially (MM)
+" 2005 Apr 11 - Fixed an indentation bug concerning "let" (MM)
" Only load this indent file when no other was loaded.
if exists("b:did_indent")
diff --git a/runtime/indent/php.vim b/runtime/indent/php.vim
index de313814c..0f79fd9d5 100644
--- a/runtime/indent/php.vim
+++ b/runtime/indent/php.vim
@@ -2,7 +2,7 @@
" Language: PHP
" Author: John Wellesz <John.wellesz (AT) teaser (DOT) fr>
" URL: http://www.2072productions.com/vim/indent/php.vim
-" Last Change: 2006 January 15th
+" Last Change: 2006 Apr 30
" Newsletter: http://www.2072productions.com/?to=php-indent-for-vim-newsletter.php
" Version: 1.23
"
@@ -10,7 +10,7 @@
"
" For a complete change log and fully commented code, download the script on
" 2072productions.com at the URI provided above.
-"
+"
" If you find a bug, please e-mail me at John.wellesz (AT) teaser (DOT) fr
" with an example of code that breaks the algorithm.
"
@@ -23,9 +23,9 @@
"
"
" In the case you have syntax errors in your script such as end of HereDoc
-" tags not at col 1 you'll have to indent your file 2 times (This script
+" tags not at col 1 you'll have to indent your file 2 times (This script
" will automatically put HereDoc end tags at col 1).
-"
+"
"
" NOTE: If you are editing file in Unix file format and that (by accident)
" there are '\r' before new lines, this script won't be able to proceed
@@ -41,7 +41,7 @@
" Options: PHP_autoformatcomment = 0 to not enable autoformating of comment by
" default, if set to 0, this script will let the 'formatoptions' setting intact.
-"
+"
" Options: PHP_default_indenting = # of sw (default is 0), # of sw will be
" added to the indent of each line of PHP code.
"
@@ -116,7 +116,7 @@ let b:UserIsTypingComment = 0
let b:optionsset = 0
setlocal nosmartindent
-setlocal noautoindent
+setlocal noautoindent
setlocal nocindent
setlocal nolisp
@@ -141,13 +141,13 @@ let s:PHP_startindenttag = '<?\%(.*?>\)\@!\|<script[^>]*>\%(.*<\/script>\)\@!'
function! GetLastRealCodeLNum(startline) " {{{
-
+
let lnum = a:startline
-
+
if b:GetLastRealCodeLNum_ADD && b:GetLastRealCodeLNum_ADD == lnum + 1
let lnum = b:GetLastRealCodeLNum_ADD
endif
-
+
let old_lnum = lnum
while lnum > 1
@@ -194,7 +194,7 @@ function! GetLastRealCodeLNum(startline) " {{{
let lnum = lnum - 1
endwhile
else
- break
+ break
endif
endwhile
@@ -312,7 +312,7 @@ function! ResetOptions()
if b:PHP_autoformatcomment
setlocal comments=s1:/*,mb:*,ex:*/,://,:#
-
+
setlocal formatoptions-=t
setlocal formatoptions+=q
setlocal formatoptions+=r
@@ -341,7 +341,7 @@ function! GetPhpIndent()
let cline = getline(v:lnum)
- if !b:PHP_indentinghuge && b:PHP_lastindented > b:PHP_indentbeforelast
+ if !b:PHP_indentinghuge && b:PHP_lastindented > b:PHP_indentbeforelast
if b:PHP_indentbeforelast
let b:PHP_indentinghuge = 1
echom 'Large indenting detected, speed optimizations engaged'
@@ -456,7 +456,7 @@ function! GetPhpIndent()
let b:InPHPcode_and_script = 1
endif
- elseif last_line =~? '<<<\a\w*$'
+ elseif last_line =~? '<<<\a\w*$'
let b:InPHPcode = 0
let b:InPHPcode_tofind = substitute( last_line, '^.*<<<\(\a\w*\)\c', '^\\s*\1;$', '')
@@ -470,7 +470,7 @@ function! GetPhpIndent()
endif
endif " }}}
-
+
if !b:InPHPcode && !b:InPHPcode_and_script
return -1
endif
@@ -512,7 +512,7 @@ function! GetPhpIndent()
return 0
endif
- if cline =~ '^\s*?>' && cline !~# '<?'
+ if cline =~ '^\s*?>' && cline !~# '<?'
return 0
endif
@@ -561,7 +561,7 @@ function! GetPhpIndent()
let defaultORcase = '^\s*\%(default\|case\).*:'
- if last_line =~ '[;}]'.endline && last_line !~# defaultORcase
+ if last_line =~ '[;}]'.endline && last_line !~# defaultORcase
if ind==b:PHP_default_indenting
return b:PHP_default_indenting
elseif b:PHP_indentinghuge && ind==b:PHP_CurrentIndentLevel && cline !~# '^\s*\%(else\|\%(case\|default\).*:\|[})];\=\)' && last_line !~# '^\s*\%(\%(}\s*\)\=else\)' && getline(GetLastRealCodeLNum(lnum - 1))=~';'.endline
@@ -592,7 +592,7 @@ function! GetPhpIndent()
let ind = ind + &sw
endif
- return ind
+ return ind
endif
let last_line_num = last_line_num - 1
@@ -644,7 +644,7 @@ function! GetPhpIndent()
break
endif
- if one_ahead_indent == two_ahead_indent || last_line_num < 1
+ if one_ahead_indent == two_ahead_indent || last_line_num < 1
if previous_line =~# '[;}]'.endline || last_line_num < 1
break
endif
diff --git a/runtime/indent/python.vim b/runtime/indent/python.vim
index cda6ec741..3e14afc99 100644
--- a/runtime/indent/python.vim
+++ b/runtime/indent/python.vim
@@ -2,7 +2,7 @@
" Language: Python
" Maintainer: Bram Moolenaar <Bram@vim.org>
" Original Author: David Bustos <bustos@caltech.edu>
-" Last Change: 2006 Apr 22
+" Last Change: 2006 Apr 30
" Only load this indent file when no other was loaded.
if exists("b:did_indent")
@@ -27,7 +27,7 @@ endif
let s:maxoff = 50 " maximum number of lines to look backwards for ()
function GetPythonIndent(lnum)
-
+
" If this line is explicitly joined: If the previous line was also joined,
" line it up with that one, otherwise add two 'shiftwidth'
if getline(a:lnum - 1) =~ '\\$'
diff --git a/runtime/indent/readline.vim b/runtime/indent/readline.vim
index 94e4ea403..45c8ab945 100644
--- a/runtime/indent/readline.vim
+++ b/runtime/indent/readline.vim
@@ -1,5 +1,5 @@
" Vim indent file
-" Language: readline configuration file
+" Language: readline configuration file
" Maintainer: Nikolai Weibull <now@bitwi.se>
" Latest Revision: 2006-04-19
diff --git a/runtime/indent/rst.vim b/runtime/indent/rst.vim
index ac5e9bb5c..e6fe2b554 100644
--- a/runtime/indent/rst.vim
+++ b/runtime/indent/rst.vim
@@ -1,5 +1,5 @@
" Vim indent file
-" Language: reStructuredText Documentation Format
+" Language: reStructuredText Documentation Format
" Maintainer: Nikolai Weibull <now@bitwi.se>
" Latest Revision: 2006-04-19
@@ -40,7 +40,7 @@ function GetRSTIndent()
let ind = ind - 2
elseif line =~ '^\s*\d\+\.\s'
let ind = ind - matchend(substitute(line, '^\s*', '', ''),
- \ '\d\+\.\s\+')
+ \ '\d\+\.\s\+')
elseif line =~ '^\s*\.\.'
let ind = ind - 3
else
diff --git a/runtime/indent/sh.vim b/runtime/indent/sh.vim
index 7919c0960..483e5430e 100644
--- a/runtime/indent/sh.vim
+++ b/runtime/indent/sh.vim
@@ -1,5 +1,5 @@
" Vim indent file
-" Language: Shell Script
+" Language: Shell Script
" Maintainer: Nikolai Weibull <now@bitwi.se>
" Latest Revision: 2006-04-19
@@ -30,8 +30,8 @@ function GetShIndent()
let ind = indent(lnum)
let line = getline(lnum)
if line =~ '^\s*\(if\|then\|do\|else\|elif\|case\|while\|until\|for\)\>'
- \ || line =~ '^\s*\<\k\+\>\s*()\s*{'
- \ || line =~ '^\s*{'
+ \ || line =~ '^\s*\<\k\+\>\s*()\s*{'
+ \ || line =~ '^\s*{'
if line !~ '\(esac\|fi\|done\)\>\s*$' && line !~ '}\s*$'
let ind = ind + &sw
endif
@@ -41,7 +41,7 @@ function GetShIndent()
" Retain the indentation level if line matches fin (for find)
let line = getline(v:lnum)
if (line =~ '^\s*\(then\|do\|else\|elif\|esac\|fi\|done\)\>' || line =~ '^\s*}')
- \ && line !~ '^\s*fi[ln]\>'
+ \ && line !~ '^\s*fi[ln]\>'
let ind = ind - &sw
endif
diff --git a/runtime/indent/sql.vim b/runtime/indent/sql.vim
index 490d652ae..f7cf83470 100644
--- a/runtime/indent/sql.vim
+++ b/runtime/indent/sql.vim
@@ -1,13 +1,13 @@
" Vim indent file loader
-" Language: SQL
+" Language: SQL
" Maintainer: David Fishburn <fishburn at ianywhere dot com>
" Last Change: Thu Sep 15 2005 10:27:51 AM
" Version: 1.0
" Download: http://vim.sourceforge.net/script.php?script_id=495
" Description: Checks for a:
-" buffer local variable,
-" global variable,
+" buffer local variable,
+" global variable,
" If the above exist, it will source the type specified.
" If none exist, it will source the default sqlanywhere.vim file.
diff --git a/runtime/indent/sqlanywhere.vim b/runtime/indent/sqlanywhere.vim
index 65d711383..c2f527ebc 100644
--- a/runtime/indent/sqlanywhere.vim
+++ b/runtime/indent/sqlanywhere.vim
@@ -1,5 +1,5 @@
" Vim indent file
-" Language: SQL
+" Language: SQL
" Maintainer: David Fishburn <fishburn at ianywhere dot com>
" Last Change: Wed Sep 14 2005 10:21:15 PM
" Version: 1.4
@@ -10,7 +10,7 @@
" Anywhere (ASA). Test indenting was done with ASA stored procedures and
" fuctions and Oracle packages which contain stored procedures and
" functions.
-" This has not been tested against Microsoft SQL Server or
+" This has not been tested against Microsoft SQL Server or
" Sybase Adaptive Server Enterprise (ASE) which use the Transact-SQL
" syntax. That syntax does not have end tags for IF's, which makes
" indenting more difficult.
@@ -32,7 +32,7 @@ setlocal indentkeys-=:
setlocal indentkeys-=0#
setlocal indentkeys-=e
-" This indicates formatting should take place when one of these
+" This indicates formatting should take place when one of these
" expressions is used. These expressions would normally be something
" you would type at the BEGINNING of a line
" SQL is generally case insensitive, so this files assumes that
@@ -40,7 +40,7 @@ setlocal indentkeys-=e
" an indent right, since the SQLBlockStart is used for those keywords
setlocal indentkeys+==~end,=~else,=~elseif,=~elsif,0=~when,0=)
-" GetSQLIndent is executed whenever one of the expressions
+" GetSQLIndent is executed whenever one of the expressions
" in the indentkeys is typed
setlocal indentexpr=GetSQLIndent()
@@ -51,7 +51,7 @@ endif
" List of all the statements that start a new block.
" These are typically words that start a line.
-" IS is excluded, since it is difficult to determine when the
+" IS is excluded, since it is difficult to determine when the
" ending block is (especially for procedures/functions).
let s:SQLBlockStart = '^\s*\%('.
\ 'if\|else\|elseif\|elsif\|'.
@@ -114,7 +114,7 @@ function s:CheckToIgnoreRightParan( prev_lnum, num_levels )
break
endif
- if matching_paran == lnum
+ if matching_paran == lnum
" This was not an unmatched parantenses, start the search again
" again after this column
" echom 'CTIRP - same line match, ignoring'
@@ -173,9 +173,9 @@ function s:GetStmtStarterIndent( keyword, curr_lnum )
elseif a:keyword =~? 'when'
exec 'normal! ^'
let matching_lnum = searchpair(
- \ '\%(\<end\s\+\)\@<!\<case\>\|\<exception\>\|\<merge\>',
- \ '',
- \ '\%(\%(\<when\s\+others\>\)\|\%(\<end\s\+case\>\)\)',
+ \ '\%(\<end\s\+\)\@<!\<case\>\|\<exception\>\|\<merge\>',
+ \ '',
+ \ '\%(\%(\<when\s\+others\>\)\|\%(\<end\s\+case\>\)\)',
\ 'bW',
\ 'IsColComment(line("."), col(".")) == 1')
exec 'normal! $'
@@ -193,10 +193,10 @@ endfunction
" Check if the line is a comment
function IsLineComment(lnum)
let rc = synIDattr(
- \ synID(a:lnum,
+ \ synID(a:lnum,
\ match(getline(a:lnum), '\S')+1, 0)
- \ , "name")
- \ =~? "comment"
+ \ , "name")
+ \ =~? "comment"
return rc
endfunction
@@ -204,8 +204,8 @@ endfunction
" Check if the column is a comment
function IsColComment(lnum, cnum)
- let rc = synIDattr(synID(a:lnum, a:cnum, 0), "name")
- \ =~? "comment"
+ let rc = synIDattr(synID(a:lnum, a:cnum, 0), "name")
+ \ =~? "comment"
return rc
endfunction
@@ -214,7 +214,7 @@ endfunction
" Check if the column is a comment
function ModuloIndent(ind)
let ind = a:ind
-
+
if ind > 0
let modulo = ind % &shiftwidth
@@ -229,7 +229,7 @@ endfunction
" Find correct indent of a new line based upon the previous line
function GetSQLIndent()
- let lnum = v:lnum
+ let lnum = v:lnum
let ind = indent(lnum)
" If the current line is a comment, leave the indent as is
@@ -246,7 +246,7 @@ function GetSQLIndent()
return ind
endif
- if IsLineComment(prevlnum) == 1
+ if IsLineComment(prevlnum) == 1
if getline(v:lnum) =~ '^\s*\*'
let ind = ModuloIndent(indent(prevlnum))
return ind + 1
@@ -269,13 +269,13 @@ function GetSQLIndent()
" endif
" endwhile
- " echom 'PREVIOUS INDENT: ' . indent(prevlnum) . ' LINE: ' . getline(prevlnum)
+ " echom 'PREVIOUS INDENT: ' . indent(prevlnum) . ' LINE: ' . getline(prevlnum)
" This is the line you just hit return on, it is not the current line
" which is new and empty
" Based on this line, we can determine how much to indent the new
" line
-
+
" Get default indent (from prev. line)
let ind = indent(prevlnum)
let prevline = getline(prevlnum)
@@ -300,7 +300,7 @@ function GetSQLIndent()
" let num_unmatched_right = s:CountUnbalancedParan( prevline, ')' )
endif
if num_unmatched_left > 0
- " There is a open left paranethesis
+ " There is a open left paranethesis
" increase indent
let ind = ind + ( &sw * num_unmatched_left )
elseif num_unmatched_right > 0
@@ -331,7 +331,7 @@ function GetSQLIndent()
let line = getline(v:lnum)
if line =~? '^\s*els'
- " Any line when you type else will automatically back up one
+ " Any line when you type else will automatically back up one
" ident level (ie else, elseif, elsif)
let ind = ind - &sw
" echom 'curr - else - indent ' . ind
@@ -356,11 +356,11 @@ function GetSQLIndent()
" If the line ends in a ), then reduce the indent
" This catches items like:
" CREATE TABLE T1(
- " c1 int,
+ " c1 int,
" c2 int
" );
" But we do not want to unindent a line like:
- " IF ( c1 = 1
+ " IF ( c1 = 1
" AND c2 = 3 ) THEN
" let num_unmatched_right = s:CountUnbalancedParan( line, ')' )
" if num_unmatched_right > 0
diff --git a/runtime/indent/tcl.vim b/runtime/indent/tcl.vim
index 1b0cc16d5..5a5aa1db6 100644
--- a/runtime/indent/tcl.vim
+++ b/runtime/indent/tcl.vim
@@ -36,13 +36,13 @@ function s:count_braces(lnum, count_open)
while i != -1
if synIDattr(synID(a:lnum, i + 1, 0), 'name') !~ 'tcl\%(Comment\|String\)'
if line[i] == '{'
- let n_open += 1
+ let n_open += 1
elseif line[i] == '}'
- if n_open > 0
- let n_open -= 1
- else
- let n_close += 1
- endif
+ if n_open > 0
+ let n_open -= 1
+ else
+ let n_close += 1
+ endif
endif
endif
let i = match(line, pattern, i + 1)
diff --git a/runtime/indent/xf86conf.vim b/runtime/indent/xf86conf.vim
index 5b2be6d3e..04f54c904 100644
--- a/runtime/indent/xf86conf.vim
+++ b/runtime/indent/xf86conf.vim
@@ -1,5 +1,5 @@
" Vim indent file
-" Language: XFree86 Configuration File
+" Language: XFree86 Configuration File
" Maintainer: Nikolai Weibull <now@bitwi.se>
" Latest Revision: 2006-04-19
diff --git a/runtime/indent/yacc.vim b/runtime/indent/yacc.vim
index d100ceb38..597a2cc83 100644
--- a/runtime/indent/yacc.vim
+++ b/runtime/indent/yacc.vim
@@ -1,5 +1,5 @@
" Vim indent file
-" Language: YACC input file
+" Language: YACC input file
" Maintainer: Nikolai Weibull <now@bitwi.se>
" Latest Revision: 2006-04-19
diff --git a/runtime/indent/zsh.vim b/runtime/indent/zsh.vim
index 5bf231521..c5580a10b 100644
--- a/runtime/indent/zsh.vim
+++ b/runtime/indent/zsh.vim
@@ -1,5 +1,5 @@
" Vim indent file
-" Language: Zsh Shell Script
+" Language: Zsh Shell Script
" Maintainer: Nikolai Weibull <now@bitwi.se>
" Latest Revision: 2006-04-19