Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Philipp Erhardt
katarakt
Commits
09ca4193
Commit
09ca4193
authored
Oct 07, 2015
by
Thorsten Wißmann
🎸
Committed by
Philipp Erhardt
Oct 08, 2015
Browse files
Make vim key in synctex bridge configurable
Furthermore, add documentation on how to configure vim.
parent
98171e76
Changes
1
Hide whitespace changes
Inline
Side-by-side
share/synctex-katarakt-vim.py
View file @
09ca4193
...
...
@@ -26,7 +26,8 @@ Behaviour:
file in the current directory).
It registers a keybinding in vim (per default "ZE"), to jump to the
corresponding page in katarakt.
corresponding page in katarakt. The vim keybinding can be overwritten by the
VIM_KEY environment variable.
If Katarakt emits the edit signal (usually on Ctrl+LeftMouse), then it
opens the corresponding tex file in vim and jumps to the corresponding
...
...
@@ -40,7 +41,25 @@ Behaviour:
Requirements:
You need to compile the latex document using the option -synctex=1 in order to
obtain the required .synctex.gz file."""
.
format
(
sys
.
argv
[
0
]))
obtain the required .synctex.gz file.
Hint: VIM configuration:
Add the following line to your vimrc:
au VimEnter *.tex execute "nmap ZE :! synctex-katarakt-vim " . v:servername . " 2>/dev/null >/dev/null &<LEFT><LEFT>"
When typing ZE the first time, it automatically calls this script, overwrites
the ZE keybinding, and opens a katarakt instance. After typing ZE the first
time, you are prompted such that you can specify an alternate PDF file. If
you want an alternate vim keybinding (e.g. <Leader>f), add this line:
au VimEnter *.tex execute "nmap ZF :! VIM_KEY='ZF' synctex-katarakt-vim " . v:servername . " 2>/dev/null >/dev/null &<LEFT><LEFT>"
If your key contains something like <Leader> (or other keys containing "<"),
escape it properly in the VIM_KEY= assignment.
"""
.
format
(
sys
.
argv
[
0
]))
...
...
@@ -98,7 +117,7 @@ except IndexError:
die
(
"no *.synctex.gz file found in current directory"
)
vim_session
=
session_name
vim_view_keybind
=
"ZE"
vim_view_keybind
=
os
.
getenv
(
'VIM_KEY'
,
'ZE'
)
pdfprocess
=
subprocess
.
Popen
([
'katarakt'
,
'--single-instance'
,
'false'
,
pdf_filename
])
pdf_pid
=
pdfprocess
.
pid
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment