我有一个 docx
文件,这真的只是一个 zip
但由于延期不是 .zip
,vim无法识别,并打开原始数据。
我试过打开文件并将文件类型设置为zip, :set filetype=zip
,我试过打开文件作为目录, :e path/to/file.docx/
我试过打开文件
有什么方法可以强迫vim打开docx拉链?
我有一个 docx
文件,这真的只是一个 zip
但由于延期不是 .zip
,vim无法识别,并打开原始数据。
我试过打开文件并将文件类型设置为zip, :set filetype=zip
,我试过打开文件作为目录, :e path/to/file.docx/
我试过打开文件
有什么方法可以强迫vim打开docx拉链?
当然,在要求我做几秒钟之内 :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.
我可以使用哪个文件类型添加到该列表,然后也向我展示
au BufReadCmd *.docx call zip#Browse(expand("<amatch>"))
或者
call zip#Browse(expand("/path/to/file"))
如果我不想总是打开像这样的docx,我可以明确地使用它。