Mercurial > vim
annotate runtime/ftplugin/rnoweb.vim @ 32997:3ee505e381ec
Added tag v9.0.1790 for changeset dd8da8f1c2bcb9ece8c7f05528e37f4b0bae6e48
author | Christian Brabandt <cb@256bit.org> |
---|---|
date | Sun, 27 Aug 2023 11:15:05 +0200 |
parents | b2e8663e6dcc |
children | 8ae680be2a51 |
rev | line source |
---|---|
6051 | 1 " Vim filetype plugin file |
2 " Language: Rnoweb | |
3 " Maintainer: Jakson Alves de Aquino <jalvesaq@gmail.com> | |
8497
da01d5da2cfa
commit https://github.com/vim/vim/commit/77cdfd10382e01cc51f4ba1a9177032351843151
Christian Brabandt <cb@256bit.org>
parents:
6051
diff
changeset
|
4 " Homepage: https://github.com/jalvesaq/R-Vim-runtime |
32294 | 5 " Last Change: Mon Feb 27, 2023 07:16PM |
6051 | 6 |
7 " Only do this when not yet done for this buffer | |
8 if exists("b:did_ftplugin") | |
9 finish | |
10 endif | |
11 | |
12 let s:cpo_save = &cpo | |
13 set cpo&vim | |
14 | |
15 runtime! ftplugin/tex.vim | |
16 | |
17 " Don't load another plugin for this buffer | |
18 let b:did_ftplugin = 1 | |
19 | |
20 " Enables Vim-Latex-Suite, LaTeX-Box if installed | |
21 runtime ftplugin/tex_*.vim | |
22 | |
23 setlocal iskeyword=@,48-57,_,. | |
24 setlocal suffixesadd=.bib,.tex | |
25 setlocal comments=b:%,b:#,b:##,b:###,b:#' | |
26 | |
24520 | 27 if (has("gui_win32") || has("gui_gtk")) && !exists("b:browsefilter") |
32061 | 28 let b:browsefilter = "R Source Files (*.R *.Rnw *.Rd *.Rmd *.Rrst *.qmd)\t*.R;*.Rnw;*.Rd;*.Rmd;*.Rrst;*.qmd\n" . |
6051 | 29 \ "All Files (*.*)\t*.*\n" |
30 endif | |
31 | |
32294 | 32 function SetRnwCommentStr() |
32061 | 33 if (search("^\s*<<.*>>=", "bncW") > search("^@", "bncW")) |
34 set commentstring=#\ %s | |
35 else | |
36 set commentstring=%\ %s | |
37 endif | |
38 endfunction | |
39 | |
40 " If you do not want both 'comments' and 'commentstring' dynamically defined, | |
41 " put in your vimrc: let g:rnw_dynamic_comments = 0 | |
42 if !exists("g:rnw_dynamic_comments") || (exists("g:rnw_dynamic_comments") && g:rnw_dynamic_comments == 1) | |
43 augroup RnwCStr | |
44 autocmd! | |
45 autocmd CursorMoved <buffer> call SetRnwCommentStr() | |
46 augroup END | |
47 endif | |
48 | |
6051 | 49 if exists('b:undo_ftplugin') |
32294 | 50 let b:undo_ftplugin .= " | setl isk< sua< com< cms< | unlet! b:browsefilter" |
6051 | 51 else |
32294 | 52 let b:undo_ftplugin = "setl isk< sua< com< cms< | unlet! b:browsefilter" |
6051 | 53 endif |
54 | |
55 let &cpo = s:cpo_save | |
56 unlet s:cpo_save | |
57 | |
58 " vim: sw=2 |