问题标签 [ftplugin]
For questions regarding programming in ECMAScript (JavaScript/JS) and its various dialects/implementations (excluding ActionScript). Note JavaScript is NOT the same as Java! Please include all relevant tags on your question; e.g., [node.js], [jquery], [json], [reactjs], [angular], [ember.js], [vue.js], [typescript], [svelte], etc.
vim - perlomni.vim 使用病原体或 vundle 安装失败
我很想安装 perlomni.vim,这样我就可以在 gvim 窗口中使用自动功能查找。
我尝试使用 pathhogen 和 vundle 来尝试配置此捆绑包。
我认为我遇到的问题是我如何安装 perlomni.vim
我有一个目录设置 ~/.vim/bundle/vundle 和 ~/.vim/bundle
病原体途径
然后因为我在 tcsh shell 中运行,所以我将路径变量设置为 set path=($path\:$home/.vim/bin)
我是否应该尝试在 .vim/bundle 目录下安装此文件.....当我运行 make install 命令时,它会尝试将其安装到 .vim/ 目录中,并将它使用的所有 .vim 文件放入 .vim/ ftplugin .vim/plugin .vim/bin 目录.......所以也许我的 .vimrc 文件中没有其他正确的设置来包含以这种方式安装的包。
VUNDLE WAY 我已经安装了 vundle,这是我的 .vimrc 的片段
vim - Vim 运行所有以相同名称开头的 Filetype-Plugins
刚刚发现,vim 运行所有以相同名称开头的 ftplugin。
例如:
检测到的文件类型 = ocr
这些文件有不同的版本。因此我有不同的ftplugins:
ocr => Base(检查文件版本并设置正确的文件类型) ocr_01 => 版本 01 ... ocr_n => 版本 n
打开 ocr 文件时,文件类型被检测为 'ocr' -> 将加载 ocr-Base-ftplugin。它检查文件的版本(例如 01)=> 文件类型将设置为 ocr_01。
我希望,只有文件类型插件 ocr_01 加载,但所有以 'ocr' 开头的 ftplugin 都是:ocr_01,ocr_02 ....
如何禁用此功能?
python - MacVim 没有加载 ftplugins
在过去的几天里,我一直在使用 ftplugin 与 macvim 搏斗。尽管进行了多次尝试,但我似乎无法解决我的问题。
MacVim 安装在我的电脑上(通过 Homebrew),并且使用了正确的 python。
我有一个简单的 .vimrc filetype plugin on
。.vimrc
我的;没有别的东西 如果那是我的问题,我尝试使用干净的文件。
如果相关,我正在尝试使用该vim-rst-tables
插件(https://github.com/nvie/vim-rst-tables)。
我 pip 安装了 vim_bridge 并且可以:python import vim_bridge
在 vim 内完成,没有任何问题。
无论如何,如果我保留文件名,rst-tables.vim
在~/.vim/ftplugin/
- 的返回:scriptnames
不会显示任何与~/.vim/ftplugin/*
. 如果我将插件名称从 更改rst-tables.vim
为rst.vim
,我会看到36: ~/.vim/ftplugin/rst.vim
。这似乎是一件好事,但仍然没有任何功能有效 - 即,,c
和,,f
.
如果有人有任何见解或更多信息,我可以提供有助于调试的信息,我们将不胜感激。谢谢!
vim - Vim ftplugin 对 C++ 文件执行 c.vim 而不是 cpp.vim
我正在学习 Vim,我想通过将 F5 键映射到由文件类型决定的编译命令来将其设置为 IDE。
我的~/.vim/ftplugin/c.vim
:
我的~/.vim/ftplugin/cpp.vim
:
当我打开一个 C++ 文件(带.cpp
扩展名)并按 F5 时,将执行来自的命令c.vim
。为什么会这样?
当我删除文件c.vim
时,Vim 会加载cpp.vim
并按预期工作。
html - 为什么vim默认markdown ftplugin source html ftplugins?有什么办法可以避免吗?
一切都在标题中...我做了一个 ftplugin 以使用浏览器实时预览 html 文件(也包括 php 和 css),但是现在,当我打开 markdown 文件时,浏览器也打开了...我明白了原因:那里这是默认 ftplugin/markdown.vim 中的这一行:
所以第一个问题,为什么markdown source html ftplugin?这对我来说似乎无关紧要,但也许有很好的理由我很高兴知道。
那么,有没有办法不为markdown文件提供html ftplugins?
vim - Autocommand for new file of specific filetype
I want to run some vim commands anytime I create a new file of a specific file type, sort of combination of the BufNewFile
and FileType
autocommand events.
I have BufNewFile
autocommands setup in filetype.vim to set the filetype based on the file extension, but I have multiple extensions that all correspond to the same filetype. I'd like to encapsulate the information about which file-extensions correspond to a particular file-type just in this one place, and then have other autocommands run based just on the filetype. However, I can't just use the FileType
event, because I only want to perform the commands for new files, not when editing existing files.
For instance, in filetype.vim, I have:
I thought maybe I could add a BufNewFile
autocommand in the ftplugin file for this filetype, like this:
But when I create a new file, e.g., "test.cir", it doesn't run the auto-command. It runs other commands in the ftplugin file (for instance, I get the "Spice file." echo) but not the autocommand.
Alternatively, if there's some way in vimscript that I can tell whether or not a file is new, then I could run the commands directly in the ftplugin, conditioned on whether or not it is new.
vim - 使用文件类型插件的通用代码
我有一组通用的命令,我想在几个不同的 Vim 文件类型插件中运行。例如,对于html
、xml
和xhtml
,有几个我想共同使用的设置。放置此通用代码的最佳位置在哪里,如何将其加载到各个插件文件中?
windows - 寻找 vim windows .inf ftplugin 文件
vim *.inf 文件的 ftplugin 默认通知哪个是关于 Z 机器的。不用说,这为 windows .inf 设备驱动程序文件提供了错误的语法突出显示等。
- 有人知道 Windows .inf(设备驱动程序)文件的 vim 语法高亮文件吗?
- 在适当的时候自动加载这个文件怎么样(相对于 z-machine 通知文件......)
vim - VIM - ftplugin 似乎不起作用
我正在使用 spf13 的 vim 发行版https://github.com/spf13/spf13-vim。我一直在尝试为.js
文件使用 2 个空格而不是 4 个空格,因此我创建了一个js.vim
in ~/.vim/ftplugin
. 我做错了吗?
js.vim
vim - Vim:默认拆分特定文件类型
在 Vim 中编辑 Git 提交时,我想自动拆分打开的窗口,以便我可以在顶部窗格中编辑提交消息,同时将提交更改列表保留在底部面板中。
我有一个带有 gitcommit.vim 文件的 ftplugin,用于设置其他一些特定于 Git 提交的选项,但是当我添加split
到它时,我得到了 3 个窗格(大概是因为第二个窗格也分裂了,然后有什么东西阻止了进一步递归到无穷大? )。
我还希望它切换到第二个面板并将显示的行移动# Changes to be committed:
到缓冲区的顶部,以便在我进行提交修改并且消息已经很长时。然后,我希望它移回顶部缓冲区。我知道要输入什么来做到这一点,但如果可能的话,我希望它自动发生。