How to avoid zip.vim being used when docx2txt is installed to open docx files?

classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|

How to avoid zip.vim being used when docx2txt is installed to open docx files?

Peng Yu
Hi,

http://docx2txt.sourceforge.net/

I installed docx2txt. And added the following code to my ~/.vimrc.

"use docx2txt.pl to allow VIm to view the text content of a .docx file directly.
autocmd BufReadPre *.docx set ro
autocmd BufReadPost *.docx %!docx2txt.pl


But unfortunately, zip.vim is still being used when open docx files. Does anybody know to disable it?

Regards,
Peng

--
--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

---
You received this message because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: How to avoid zip.vim being used when docx2txt is installed to open docx files?

Charles Campbell

On Mar 14, 2015, at 5:01 PM, Peng Yu <[hidden email]> wrote:

> Hi,
>
> http://docx2txt.sourceforge.net/
>
> I installed docx2txt. And added the following code to my ~/.vimrc.
>
> "use docx2txt.pl to allow VIm to view the text content of a .docx file directly.
> autocmd BufReadPre *.docx set ro
> autocmd BufReadPost *.docx %!docx2txt.pl
>
>
> But unfortunately, zip.vim is still being used when open docx files. Does anybody know to disable it?

Modify g:zipPlugin_ext to hold whichever suffices you want zip.vim to handle and put it into your .vimrc.  This change will take effect only in subsequent instances of vim, not a currently running one.

Regards,
C Campbell

--
--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

---
You received this message because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: How to avoid zip.vim being used when docx2txt is installed to open docx files?

Peng Yu
> Modify g:zipPlugin_ext to hold whichever suffices you want zip.vim to handle and put it into your .vimrc.  This change will take effect only in subsequent instances of vim, not a currently running one.

What is the syntax for multiple suffixes? Should it be something like this?

let g:zipPlugin_ext = '.gz,.zip'

--
Regards,
Peng

--
--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

---
You received this message because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: How to avoid zip.vim being used when docx2txt is installed to open docx files?

Charles Campbell
Peng Yu wrote:
>> Modify g:zipPlugin_ext to hold whichever suffices you want zip.vim to handle and put it into your .vimrc.  This change will take effect only in subsequent instances of vim, not a currently running one.
> What is the syntax for multiple suffixes? Should it be something like this?
>
> let g:zipPlugin_ext = '.gz,.zip'
>
Its set up in plugin/zipPlugin.vim (by default):  let g:zipPlugin_ext=
'*.zip,*.jar,*.xpi,*.ja,*.war,*.ear,*.celzip,*.oxt,*.kmz,*.wsz,*.xap,*.docx,*.docm,*.dotx,*.dotm,*.potx,*.potm,*.ppsx,*.ppsm,*.pptx,*.pptm,*.ppam,*.sldx,*.thmx,*.xlam,*.xlsx,*.xlsm,*.xlsb,*.xltx,*.xltm,*.xlam,*.crtx,*.vdw,*.glox,*.gcsx,*.gqsx'

Sorry about not getting back to you sooner; I've been out a lot lately.

Regards,
Chip Campbell


--
--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

---
You received this message because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: How to avoid zip.vim being used when docx2txt is installed to open docx files?

Enno
Le mardi 24 mars 2015 16:09:09 UTC+1, Charles Campbell a écrit :

> Peng Yu wrote:
> >> Modify g:zipPlugin_ext to hold whichever suffices you want zip.vim to handle and put it into your .vimrc.  This change will take effect only in subsequent instances of vim, not a currently running one.
> > What is the syntax for multiple suffixes? Should it be something like this?
> >
> > let g:zipPlugin_ext = '.gz,.zip'
> >
> Its set up in plugin/zipPlugin.vim (by default):  let g:zipPlugin_ext=
> '*.zip,*.jar,*.xpi,*.ja,*.war,*.ear,*.celzip,*.oxt,*.kmz,*.wsz,*.xap,*.docx,*.docm,*.dotx,*.dotm,*.potx,*.potm,*.ppsx,*.ppsm,*.pptx,*.pptm,*.ppam,*.sldx,*.thmx,*.xlam,*.xlsx,*.xlsm,*.xlsb,*.xltx,*.xltm,*.xlam,*.crtx,*.vdw,*.glox,*.gcsx,*.gqsx'
>
> Sorry about not getting back to you sooner; I've been out a lot lately.
>
> Regards,
> Chip Campbell
If zipPlugin set the autocmd

exe "au BufReadCmd ".g:zipPlugin_ext.' call zip#Browse(expand("<amatch>"))'

after .vimrc is read, then a command that only excludes triggering zipPlugin for *.docx files, such as

let g:zipPlugin_ext = substitute(g:zipPlugin_ext, '\*\.docx', '', '')

could work, too.

--
--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

---
You received this message because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: How to avoid zip.vim being used when docx2txt is installed to open docx files?

Enno
Le jeudi 29 octobre 2015 23:41:43 UTC+1, Enno a écrit :

> Le mardi 24 mars 2015 16:09:09 UTC+1, Charles Campbell a écrit :
> > Peng Yu wrote:
> > >> Modify g:zipPlugin_ext to hold whichever suffices you want zip.vim to handle and put it into your .vimrc.  This change will take effect only in subsequent instances of vim, not a currently running one.
> > > What is the syntax for multiple suffixes? Should it be something like this?
> > >
> > > let g:zipPlugin_ext = '.gz,.zip'
> > >
> > Its set up in plugin/zipPlugin.vim (by default):  let g:zipPlugin_ext=
> > '*.zip,*.jar,*.xpi,*.ja,*.war,*.ear,*.celzip,*.oxt,*.kmz,*.wsz,*.xap,*.docx,*.docm,*.dotx,*.dotm,*.potx,*.potm,*.ppsx,*.ppsm,*.pptx,*.pptm,*.ppam,*.sldx,*.thmx,*.xlam,*.xlsx,*.xlsm,*.xlsb,*.xltx,*.xltm,*.xlam,*.crtx,*.vdw,*.glox,*.gcsx,*.gqsx'
> >
> > Sorry about not getting back to you sooner; I've been out a lot lately.
> >
> > Regards,
> > Chip Campbell
>
> If zipPlugin set the autocmd
>
> exe "au BufReadCmd ".g:zipPlugin_ext.' call zip#Browse(expand("<amatch>"))'
>
> after .vimrc is read, then a command that only excludes triggering zipPlugin for *.docx files, such as
>
> let g:zipPlugin_ext = substitute(g:zipPlugin_ext, '\*\.docx', '', '')
>
> could work, too.
That was not correct: The autocmd is set after .vimrc is read.

If it would be set on VimEnter, then a change of g:zipPlugin_ext in .vimrc by

autocmd VimEnter * let g:zipPlugin_ext = substitute(g:zipPlugin_ext, '\*\.docx', '', '')

would also change the pattern of the autocmd (because that of the plugin is set later, and hence loads later).

--
--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

---
You received this message because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.