vim-office : read common binary files, such as PDFs or those for Libre or Microsoft Office
| script karma
Downloaded by 353
Comments, bugs, improvements
script versions (upload new version)
|This plug-in enables Vim to read text documents of type PDF, Microsoft Office
such as Word (doc(x)), Excel (xls(x)) or Powerpoint (ppt(x)), LibreOffice
(odt), EPUB .... To go even further, for example, among many others file
formats, to read media files in Vim, add the Vimscript snippet from the Wiki
https://github.com/wofr06/lesspipe/wiki/vim of lesspipe.sh to your vimrc!
For the text extraction, it depends on external tools, but most use cases are
covered by an installation of
- LibreOffice and a common text browser (such as `lynx`), and
It prefers, whenever available, appropriate external converters such as
pandoc, odt2txt, docx2txt.pl, pptx2md, ... to do so, but will fall back to:
- Either LibreOffice which is an office suite that can handle all those formats
listed above, except PDFs. (To use it on Microsoft Windows, ensure after its
installation that its path is added to the %PATH% environment variable,
say by Rapidee.)
- Or Tika which is a content extractor that can handle all those formats listed
above and many more. To use it:
1. Download the latest runnable tika-app-...jar from
https://tika.apache.org/download.html to ~/bin/tika.jar (on Linux)
respectively %USERPROFILE%\bin (on Microsoft Windows).
- on Linux, a shell script ~/bin/tika that reads
exec java -jar "$HOME/bin/tika.jar" "$@" 2>/dev/null
and mark it executable (by chmod a+x ~/bin/tika).
- on Microsoft Windows, a batch script %USERPROFILE%\bin\tika.bat that
java -jar "%USERPROFILE%\bin\tika.jar" %*
3. Add the folder of the newly created tika executable to your environment
variable $PATH (on Linux) respectively %PATH% (on Microsoft Windows):
- on Linux, if you use bash or zsh by adding to ~/.profile or ~/.zshenv
- on Microsoft Windows, a convenient program to update %PATH% is
vim-office is developed at https://github.com/Konfekt/vim-office where issues can be filed.
|Unzip vim-office.zip into ~/.vim on Linux respectively MacOS or %USERPROFILE%\vimfiles on Windows.|
Click on the package to download.
ip used for rating: 22.214.171.124