我有一个docx文件,这真的只是一个zip,但由于扩展名不是.zip,vim无法识别,并打开原始数据.
我已经尝试打开文件并将filetype设置为zip:set filetype = zip,我尝试将文件打开为目录:e path / to / file.docx /我已经尝试打开文件
有什么办法可以强制vim打开docx作为zip吗?
自然地,在几秒钟内询问我做一个:帮助zip并找到明确告诉我的pi_zip插件:
Apparently there are a number of archivers which generate zip files that don't use the .zip extension (.jar,.xpi,etc). To handle such files,place a line in your <.vimrc> file: > au BufReadCmd *.jar,*.xpi call zip#Browse(expand("<amatch>")) One can simply extend this line to accommodate additional extensions that should be treated as zip files.
au BufReadCmd *.docx call zip#Browse(expand("<amatch>"))
或者替代地
call zip#Browse(expand("/path/to/file"))
如果我不想总是打开一个这样的docx,我可以明确使用它.