diff options
| author | Paul Buetow <paul@buetow.org> | 2023-08-12 22:47:34 +0300 |
|---|---|---|
| committer | Paul Buetow <paul@buetow.org> | 2023-08-12 22:47:34 +0300 |
| commit | 2281309165e34b9e35eae9e31acaa080ca49e10f (patch) | |
| tree | 0a110cb02ba393ab19028190bc3f4252e30b8aaa /gemfeed | |
| parent | 63118cff0ba9b3a199e181a02db64c2a497d6541 (diff) | |
Update content for md
Diffstat (limited to 'gemfeed')
| -rw-r--r-- | gemfeed/2022-11-24-i-tried-emacs-but-i-switched-back-to-neovim.md | 65 |
1 files changed, 0 insertions, 65 deletions
diff --git a/gemfeed/2022-11-24-i-tried-emacs-but-i-switched-back-to-neovim.md b/gemfeed/2022-11-24-i-tried-emacs-but-i-switched-back-to-neovim.md index 3381c0d2..6e3ed2da 100644 --- a/gemfeed/2022-11-24-i-tried-emacs-but-i-switched-back-to-neovim.md +++ b/gemfeed/2022-11-24-i-tried-emacs-but-i-switched-back-to-neovim.md @@ -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("<cword>") - 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("<cWORD>") - echom s:metaFilePath - - 1/MetaOffset:/ - normal! 3w - let s:metaOffset = expand("<cword>") - echom s:metaOffset - - 1/MetaPageAtOffset:/ - normal! 3w - let s:metaPageAtOffset = expand("<cword>") - echom s:metaPageAtOffset - - 1/MetaPagesPerScan:/ - normal! 3w - let s:metaPagesPerScan = expand("<cword>") - 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()<CR> -``` - -[Back to the main site](../) |
