在vim中以zip格式打开docx文件

Tan*_*ash 12 vim zip docx

我有一个docx文件,实际上只是一个文件,zip但由于扩展名不是.zip,vim无法识别,并打开原始数据.

我试过打开文件并将文件类型设置为zip,:set filetype=zip我试过打开文件作为目录,:e path/to/file.docx/我试过打开文件

有什么方法可以强迫vim打开docx拉链?

Tan*_*ash 13

当然,在几秒钟之后我会问我做一个:help 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.
Run Code Online (Sandbox Code Playgroud)

我可以使用哪个文件类型添加到该列表,然后也向我展示

 au BufReadCmd *.docx call zip#Browse(expand("<amatch>"))
Run Code Online (Sandbox Code Playgroud)

或者

 call zip#Browse(expand("/path/to/file"))
Run Code Online (Sandbox Code Playgroud)

如果我不想总是打开像这样的docx,我可以明确地使用它.