From b376dde9b9e83847419e69f6a66449ad7e298393 Mon Sep 17 00:00:00 2001 From: Paul Buetow Date: Sat, 5 Aug 2023 12:41:10 +0300 Subject: remove the vimscript --- ...i-tried-emacs-but-i-switched-back-to-neovim.gmi | 65 ---------------------- 1 file changed, 65 deletions(-) (limited to 'gemfeed/2022-11-24-i-tried-emacs-but-i-switched-back-to-neovim.gmi') diff --git a/gemfeed/2022-11-24-i-tried-emacs-but-i-switched-back-to-neovim.gmi b/gemfeed/2022-11-24-i-tried-emacs-but-i-switched-back-to-neovim.gmi index ba10d476..4c8876a3 100644 --- a/gemfeed/2022-11-24-i-tried-emacs-but-i-switched-back-to-neovim.gmi +++ b/gemfeed/2022-11-24-i-tried-emacs-but-i-switched-back-to-neovim.gmi @@ -113,68 +113,3 @@ Vim/NeoVim also comes with a very high degree of customization options, but to a E-Mail your comments to paul at buetow.org :-) => ../ Back to the main site - -# Appendix - -This is the VimScript I mentioned earlier, which parses a table of contents index of my scanned paper journals and opens the corresponding PDF at the right page in `zathura`: - -```vim -function! ReadJournalPageNumber() - let page = expand("") - if page !~# '^\d\+$' - for str in split(getline("."), "[ ,]") - if str =~# '^\d\+$' - let page = str - break - end - endfor - endif - return page -endfunction - -function! ReadJournalMeta() - normal! mj - - 1/MetaFilePath:/ - normal! 3w - let s:metaFilePath = expand("") - echom s:metaFilePath - - 1/MetaOffset:/ - normal! 3w - let s:metaOffset = expand("") - echom s:metaOffset - - 1/MetaPageAtOffset:/ - normal! 3w - let s:metaPageAtOffset = expand("") - echom s:metaPageAtOffset - - 1/MetaPagesPerScan:/ - normal! 3w - let s:metaPagesPerScan = expand("") - echom s:metaPagesPerScan - - normal! `j -endfunction - -function! GetPdfPage(page) - return s:metaOffset + (a:page - s:metaPageAtOffset) / s:metaPagesPerScan -endfunction - -function! OpenJournalPage() - let page = ReadJournalPageNumber() - if page !~# '^\d\+$' - echoerr "Could not identify Journal page number" - end - call ReadJournalMeta() - let pdfPage = GetPdfPage(page) - echon "Location is " . s:metaFilePath . ":" . pdfPage - call system("zathura --mode fullscreen -P " . pdfPage . " " . s:metaFilePath) - " call system("evince -p " . pdfPage . " " . s:metaFilePath) -endfunction - -nmap ,j :call OpenJournalPage() -``` - -=> ../ Back to the main site -- cgit v1.2.3