Mercurial > vim
comparison runtime/indent/rmd.vim @ 32061:b2412874362f
Update runtime files
Commit: https://github.com/vim/vim/commit/dd60c365cd2630794be84d63c4fe287124a30b97
Author: Bram Moolenaar <Bram@vim.org>
Date: Mon Feb 27 15:49:53 2023 +0000
Update runtime files
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Mon, 27 Feb 2023 17:00:08 +0100 |
parents | 5bda4653aced |
children | 02bd0fe77c68 |
comparison
equal
deleted
inserted
replaced
32060:038d32f87ebf | 32061:b2412874362f |
---|---|
1 " Vim indent file | 1 " Vim indent file |
2 " Language: Rmd | 2 " Language: Rmd |
3 " Author: Jakson Alves de Aquino <jalvesaq@gmail.com> | 3 " Author: Jakson Alves de Aquino <jalvesaq@gmail.com> |
4 " Homepage: https://github.com/jalvesaq/R-Vim-runtime | 4 " Homepage: https://github.com/jalvesaq/R-Vim-runtime |
5 " Last Change: Sun Mar 28, 2021 08:05PM | 5 " Last Change: Wed Nov 09, 2022 09:44PM |
6 | 6 |
7 | 7 |
8 " Only load this indent file when no other was loaded. | 8 " Only load this indent file when no other was loaded. |
9 if exists("b:did_indent") | 9 if exists("b:did_indent") |
10 finish | 10 finish |
13 let s:RIndent = function(substitute(&indentexpr, "()", "", "")) | 13 let s:RIndent = function(substitute(&indentexpr, "()", "", "")) |
14 let b:did_indent = 1 | 14 let b:did_indent = 1 |
15 | 15 |
16 setlocal indentkeys=0{,0},<:>,!^F,o,O,e | 16 setlocal indentkeys=0{,0},<:>,!^F,o,O,e |
17 setlocal indentexpr=GetRmdIndent() | 17 setlocal indentexpr=GetRmdIndent() |
18 | |
19 let b:undo_indent = "setl inde< indk<" | |
18 | 20 |
19 if exists("*GetRmdIndent") | 21 if exists("*GetRmdIndent") |
20 finish | 22 finish |
21 endif | 23 endif |
22 | 24 |
45 return indent(v:lnum) | 47 return indent(v:lnum) |
46 elseif pline =~ '^\s*[-\+\*]\s' | 48 elseif pline =~ '^\s*[-\+\*]\s' |
47 return indent(v:lnum - 1) + 2 | 49 return indent(v:lnum - 1) + 2 |
48 elseif pline =~ '^\s*\d\+\.\s\+' | 50 elseif pline =~ '^\s*\d\+\.\s\+' |
49 return indent(v:lnum - 1) + 3 | 51 return indent(v:lnum - 1) + 3 |
52 elseif pline =~ '^\[\^\S\+\]: ' | |
53 return indent(v:lnum - 1) + shiftwidth() | |
50 endif | 54 endif |
51 return indent(prevnonblank(v:lnum - 1)) | 55 return indent(prevnonblank(v:lnum - 1)) |
52 endfunction | 56 endfunction |
53 | 57 |
54 function s:GetYamlIndent() | 58 function s:GetYamlIndent() |