Skip to content

Instantly share code, notes, and snippets.

@vext01
Last active November 9, 2024 10:33
Show Gist options
  • Select an option

  • Save vext01/16df5bd48019d451e078 to your computer and use it in GitHub Desktop.

Select an option

Save vext01/16df5bd48019d451e078 to your computer and use it in GitHub Desktop.

Revisions

  1. vext01 revised this gist Nov 24, 2014. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion vimura.md
    Original file line number Diff line number Diff line change
    @@ -5,7 +5,7 @@
    ```
    #!/bin/sh
    echo $1
    zathura -s -x "gvim -c \"let g:syncpdf='$1'\" --remote +%{line} %{input}" $*
    zathura -s -x "gvim --servername $1 -c \"let g:syncpdf='$1'\" --remote +%{line} %{input}" $*
    ```

    For zathura >= 0.3.2 remove `-s`.
  2. vext01 revised this gist Nov 24, 2014. 1 changed file with 2 additions and 0 deletions.
    2 changes: 2 additions & 0 deletions vimura.md
    Original file line number Diff line number Diff line change
    @@ -8,6 +8,8 @@ echo $1
    zathura -s -x "gvim -c \"let g:syncpdf='$1'\" --remote +%{line} %{input}" $*
    ```

    For zathura >= 0.3.2 remove `-s`.

    * In your vimrc:

    ```
  3. vext01 renamed this gist Nov 19, 2014. 1 changed file with 0 additions and 0 deletions.
    File renamed without changes.
  4. vext01 created this gist Nov 19, 2014.
    31 changes: 31 additions & 0 deletions gistfile1.txt
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,31 @@
    # Vim+Zathura+Synctex

    * In a script called 'vimura':

    ```
    #!/bin/sh
    echo $1
    zathura -s -x "gvim -c \"let g:syncpdf='$1'\" --remote +%{line} %{input}" $*
    ```

    * In your vimrc:

    ```
    function! Synctex()
    " remove 'silent' for debugging
    execute "silent !zathura --synctex-forward " . line('.') . ":" . col('.') . ":" . bufname('%') . " " . g:syncpdf
    endfunction
    map <C-enter> :call Synctex()<cr>
    ```

    * Build your latex doc with synctex enabled

    ```
    pdflatex -synctex=1 ...
    ```

    * Open PDF with vimura script.

    * `CTRL+Click` in Zathura jumps to source in vim.

    * `CTRL+Enter` in vim jumps to corresponding position in PDF.