From 27903c5b8656c796564ef073c1ebe77a2f0154e1 Mon Sep 17 00:00:00 2001 From: Adam Stankiewicz Date: Thu, 28 Sep 2017 22:18:09 +0200 Subject: Revert inlining basic language pack --- indent/rpl.vim | 67 ---------------------------------------------------------- 1 file changed, 67 deletions(-) delete mode 100644 indent/rpl.vim (limited to 'indent/rpl.vim') diff --git a/indent/rpl.vim b/indent/rpl.vim deleted file mode 100644 index a963363f..00000000 --- a/indent/rpl.vim +++ /dev/null @@ -1,67 +0,0 @@ -if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'vim') == -1 - -" Vim indent file -" Language: RPL/2 -" Version: 0.2 -" Last Change: 2017 Jun 13 -" Maintainer: BERTRAND Joël - -" Only load this indent file when no other was loaded. -if exists("b:did_indent") - finish -endif -let b:did_indent = 1 - -setlocal autoindent -setlocal indentkeys+==~end,=~case,=~if,=~then,=~else,=~do,=~until,=~while,=~repeat,=~select,=~default,=~for,=~start,=~next,=~step,<<>,<>> - -" Define the appropriate indent function but only once -setlocal indentexpr=RplGetFreeIndent() -if exists("*RplGetFreeIndent") - finish -endif - -let b:undo_indent = "set ai< indentkeys< indentexpr<" - -function RplGetIndent(lnum) - let ind = indent(a:lnum) - let prevline=getline(a:lnum) - " Strip tail comment - let prevstat=substitute(prevline, '!.*$', '', '') - - " Add a shiftwidth to statements following if, iferr, then, else, elseif, - " case, select, default, do, until, while, repeat, for, start - if prevstat =~? '\<\(if\|iferr\|do\|while\)\>' && prevstat =~? '\' - elseif prevstat =~? '\(^\|\s\+\)<<\($\|\s\+\)' && prevstat =~? '\s\+>>\($\|\s\+\)' - elseif prevstat =~? '\<\(if\|iferr\|then\|else\|elseif\|select\|case\|do\|until\|while\|repeat\|for\|start\|default\)\>' || prevstat =~? '\(^\|\s\+\)<<\($\|\s\+\)' - let ind = ind + shiftwidth() - endif - - " Subtract a shiftwidth from then, else, elseif, end, until, repeat, next, - " step - let line = getline(v:lnum) - if line =~? '^\s*\(then\|else\|elseif\|until\|repeat\|next\|step\|default\|end\)\>' - let ind = ind - shiftwidth() - elseif line =~? '^\s*>>\($\|\s\+\)' - let ind = ind - shiftwidth() - endif - - return ind -endfunction - -function RplGetFreeIndent() - " Find the previous non-blank line - let lnum = prevnonblank(v:lnum - 1) - - " Use zero indent at the top of the file - if lnum == 0 - return 0 - endif - - let ind=RplGetIndent(lnum) - return ind -endfunction - -" vim:sw=2 tw=130 - -endif -- cgit v1.2.3