doc*_*orG 6 vim r vim-plugin r-markdown
我刚刚安装了 vim-rmarkdown、vim-pandoc 和 vim-pandoc-syntax 插件以及 Vundle(最新的 github 版本)。
当我在 vim 中打开 RMarkdown 文件 (.Rmd) 时,正如预期的那样,它检测到文件类型为 rmarkdown;正如我在示例 vim-rmarkdown 屏幕截图中看到的那样,它用 lambda 符号等标记了 R 代码块的开始(替换了 ```)。
让我抓狂的是 vim 决定突出显示一些字符串(无益地完全模糊文本,好像它被编辑了一样)。我通常会点击空格来清除搜索词的突出显示;不是这样。它还隐藏了 R 块的终止```;只有当您将光标移到该行上时,它们才可见。
任何人都可以帮助:
根据可用的 vim-rmarkdown 文档,我在 .vimrc 的开头添加了以下内容
set nocompatible " be iMproved, required
filetype off " required
" set the runtime path to include Vundle and initialize
set rtp+=~/.vim/bundle/Vundle.vim
call vundle#begin()
" alternatively, pass a path where Vundle should install plugins
"call vundle#begin('~/some/path/here')
" let Vundle manage Vundle, required
Plugin 'VundleVim/Vundle.vim'
" The following are examples of different formats supported.
" Keep Plugin commands between vundle#begin/end.
" plugin on GitHub repo
Plugin 'vim-pandoc/vim-pandoc'
Plugin 'vim-pandoc/vim-pandoc-syntax'
Plugin 'vim-pandoc/vim-rmarkdown'
" All of your Plugins must be added before the following line
call vundle#end() " required
filetype plugin indent on " required
" To ignore plugin indent changes, instead use:
"filetype plugin on
"
" Brief help
" :PluginList - lists configured plugins
" :PluginInstall - installs plugins; append `!` to update or just :PluginUpdate
" :PluginSearch foo - searches for foo; append `!` to refresh local cache
" :PluginClean - confirms removal of unused plugins; append `!` to auto-approve removal
"
" see :h vundle for more details or wiki for FAQ
" Put your non-Plugin stuff after this line
Run Code Online (Sandbox Code Playgroud)
小智 6
感谢您发布问题,我想我遇到了同样的问题。
- 指向 vim-rmarkdown 常见问题解答/文档的指针(:h rmarkdown 只调用您在 github 页面上获得的相同基本信息),
据我所知,vim-rmarkdown 插件只是为 R 代码块和:RMarkdown帮助文档中描述的命令添加了语法突出显示。大多数的文件,你可能寻找关系到VIM-pandoc和VIM-pandoc语法模块,所以:help vim-pandoc和:help vim-pandoc-syntax覆盖大部分的问题。
- 为什么它会覆盖(用纯色突出显示)一些文本以及如何阻止它,
我不知道您是否遇到了与我相同的问题,但我看到了这种行为,因为拼写检查和我在终端中使用的特定配色方案(带有深色方案的 iTerm)遮挡了文本。通过关闭拼写检查let g:pandoc#modules#disabled = ["spell"]或修改配色方案为我解决了这个问题(在我的情况下,增加 iTerm 中的最小对比度设置有帮助)
- 如何显示 R 代码块 (```) 的结尾,或者更好地区分“文本”和 R 代码块。
我对这个问题的解决方案是关闭隐藏,无论如何它只是让我感到困惑。(我不够聪明,无法处理编辑对我隐藏的东西,所以我也关闭了折叠)对于想要隐藏的人来说,可能有更好的方法来处理这个问题,但我不知道。
我添加到我的 .vimrc 来管理我的 vim-rmarkdown 问题的行:
" configuration for vim-pandoc and vim-rmarkdown
let g:pandoc#modules#disabled = ["folding", "spell"]
let g:pandoc#syntax#conceal#use = 0
Run Code Online (Sandbox Code Playgroud)