commit 106eb6822d018726c2d568c1997f437b8cee06d8 parent 0824df8427c51c8312e8d30a28f5c94308361836 Author: Pablo Cárdenas <pablo.cardenas@imca.edu.pe> Date: Wed, 28 Dec 2022 20:21:12 -0500 Updated thesis session Diffstat:
| M | session/thesis.vim | | | 18 | +++++++++++++++++- |
1 file changed, 17 insertions(+), 1 deletion(-)
diff --git a/session/thesis.vim b/session/thesis.vim @@ -9,5 +9,21 @@ function! Synctex() redraw! endfunction -map <C-j> :call Synctex()<cr> +function! ViewRef() + let match_list = matchlist(getline('.'), "^% \\(\\a\\+\\d\\+\\) \\(\\d\\+\\)") + let ref = $BIB_DATA . "/" . match_list[1] . ".pdf" + let page = match_list[2] + execute "silent !zathura " . ref . " -P " . page . " >/dev/null 2>&1 &" + redraw! +endfunction + +function! Action() + if match(getline('.'), "^\s*%") == -1 + call Synctex() + else + call ViewRef() + endif +endfunction + +map <C-j> :call Action()<cr>