我想列出Vim从其运行时路径识别的所有文件类型。
例如:
ada
arc
c
clojure
common-lisp
elisp
go
python
我该怎么做?
我想列出Vim从其运行时路径识别的所有文件类型。
例如:
ada
arc
c
clojure
common-lisp
elisp
go
python
我该怎么做?
Answers:
如果您需要带有文件类型参数的自定义命令,则可以使用:command -complete=filetype
。另外,您可以globpath()
自己通过函数来导出列表:
echo join(map(split(globpath(&rtp, 'ftplugin/*.vim'), '\n'), 'fnamemodify(v:val, ":t:r")'), "\n")
这将从运行时路径中获取所有ftplugin脚本,然后通过修改filespec fnamemodify()
以仅列出文件名的根目录。split()
转换为列表,然后join()
返回行以进行:echo
ing。
after/ftplugin
,是的,因为它们包含在中&rtp
。
ftplugin/after
吗?