vifm: Add pdf, docx viewer options
Added opening of docx files from vifm through either pandoc interpretation as markdown if installed, or docx2txt invocation as a fallback. (pandoc generally interprets the layout better than docx2txt, especially contained tables). Similarly, added option to open pdfs with pdftotext program in neovim, to edit/grep/view only the text without pdf markup in neovim. Changed key binding to open selected file in neovim from `o` to `e`, mimicking the edit command found in some other file viewers.
This commit is contained in:
parent
da52dad3d7
commit
3d742a0503
1 changed files with 15 additions and 5 deletions
|
@ -111,8 +111,10 @@ set timeoutlen=5000
|
||||||
mark h ~/
|
mark h ~/
|
||||||
mark d ~/downloads/
|
mark d ~/downloads/
|
||||||
mark p ~/projects/
|
mark p ~/projects/
|
||||||
|
mark s ~/projects/studentassistant/
|
||||||
mark i ~/pictures/
|
mark i ~/pictures/
|
||||||
mark n ~/documents/notes/
|
mark n ~/documents/notes/
|
||||||
|
mark N ~/Nextcloud/
|
||||||
mark l ~/documents/library/academia/pdf/
|
mark l ~/documents/library/academia/pdf/
|
||||||
mark t ~/.local/share/vifm/Trash/
|
mark t ~/.local/share/vifm/Trash/
|
||||||
|
|
||||||
|
@ -172,7 +174,11 @@ command! reload :write | restart
|
||||||
" program.
|
" program.
|
||||||
|
|
||||||
" Pdf
|
" Pdf
|
||||||
filextype *.pdf zathura %c %i &, apvlv %c, xpdf %c
|
filextype *.pdf
|
||||||
|
\ { view as rich file }
|
||||||
|
\ zathura %c %i &, apvlv %c, xpdf %c,
|
||||||
|
\ { edit text content }
|
||||||
|
\ pdftotext -nopgbrk %c - | nvim
|
||||||
fileviewer *.pdf pdftotext -nopgbrk %c -
|
fileviewer *.pdf pdftotext -nopgbrk %c -
|
||||||
|
|
||||||
" PostScript
|
" PostScript
|
||||||
|
@ -334,10 +340,14 @@ fileviewer *.7z 7z l %c
|
||||||
|
|
||||||
" Office files
|
" Office files
|
||||||
filextype *.odt,*.doc,*.docx,*.xls,*.xlsx,*.odp,*.pptx libreoffice %f &
|
filextype *.odt,*.doc,*.docx,*.xls,*.xlsx,*.odp,*.pptx libreoffice %f &
|
||||||
fileviewer *.doc catdoc %c | nvim
|
filetype *.doc catdoc %c | nvim
|
||||||
fileviewer *.doc catdoc %c
|
fileviewer *.doc catdoc %c
|
||||||
filextype *.docx docx2txt %f - | nvim
|
filetype *.docx
|
||||||
fileviewer *.docx docx2txt %f -
|
\ pandoc -s -t markdown %f | nvim,
|
||||||
|
\ docx2txt %f - | nvim
|
||||||
|
fileviewer *.docx
|
||||||
|
\ pandoc -s -t markdown %f,
|
||||||
|
\ docx2txt %f -
|
||||||
|
|
||||||
" TuDu files
|
" TuDu files
|
||||||
filetype *.tudu tudu -f %c
|
filetype *.tudu tudu -f %c
|
||||||
|
@ -431,7 +441,7 @@ nnoremap w :view<cr>
|
||||||
vnoremap w :view<cr>gv
|
vnoremap w :view<cr>gv
|
||||||
|
|
||||||
" Open file in existing instance of nvim
|
" Open file in existing instance of nvim
|
||||||
nnoremap o :!nvim <cr>
|
nnoremap e :!nvim %f<cr>
|
||||||
|
|
||||||
" Open file in the background using its default program
|
" Open file in the background using its default program
|
||||||
nnoremap gb :file &<cr>l
|
nnoremap gb :file &<cr>l
|
||||||
|
|
Loading…
Reference in a new issue