summaryrefslogtreecommitdiff
path: root/gemfeed/2022-11-24-i-tried-emacs-but-i-switched-back-to-neovim.gmi
diff options
context:
space:
mode:
authorPaul Buetow <paul@buetow.org>2023-08-05 12:41:10 +0300
committerPaul Buetow <paul@buetow.org>2023-08-05 12:41:10 +0300
commitb376dde9b9e83847419e69f6a66449ad7e298393 (patch)
tree86f2325c3106b9f01f8e4e808a6aa49a6e548727 /gemfeed/2022-11-24-i-tried-emacs-but-i-switched-back-to-neovim.gmi
parentb9fd35d5d9f4c6021d8f444a1dfbe635941a51af (diff)
remove the vimscript
Diffstat (limited to 'gemfeed/2022-11-24-i-tried-emacs-but-i-switched-back-to-neovim.gmi')
-rw-r--r--gemfeed/2022-11-24-i-tried-emacs-but-i-switched-back-to-neovim.gmi65
1 files changed, 0 insertions, 65 deletions
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("<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