summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPhilipp Erhardt <Philipp.Erhardt@informatik.stud.uni-erlangen.de>2018-08-09 21:30:08 +0200
committerChristoph Egger <christoph@debian.org>2021-03-20 17:40:23 +0100
commit52b6fe0f8354975494114b3d5a05d138125ba678 (patch)
tree61e7f37da9b363abeb47c035c4aa1997d011c9b9
parent2d3aed4b71063b45224648e5b29a4662f87fd6df (diff)
[PATCH 1/5] Modernize synctex-katarakt-vim
Gbp-Pq: Name 0001-Modernize-synctex-katarakt-vim.patch
-rwxr-xr-xshare/synctex-katarakt-vim.py17
1 files changed, 7 insertions, 10 deletions
diff --git a/share/synctex-katarakt-vim.py b/share/synctex-katarakt-vim.py
index 7b09f95..a2310d3 100755
--- a/share/synctex-katarakt-vim.py
+++ b/share/synctex-katarakt-vim.py
@@ -1,9 +1,9 @@
#!/usr/bin/env python3
-# Dependencies:
+# Dependencies (Debian/Ubuntu package names):
#
-# python-gobject2
-# python-dbus
+# python3-gi
+# python3-dbus
#
# Thorsten Wißmann, 2015
@@ -47,14 +47,14 @@ 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>"
+ au BufRead *.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>"
+ au BufRead *.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.
@@ -63,7 +63,7 @@ Hint: VIM configuration:
-import gobject
+from gi.repository import GLib
import sys
import dbus
import dbus.service
@@ -78,7 +78,7 @@ from dbus.mainloop.glib import DBusGMainLoop
# tell dbus that we use the gobject main loop
DBusGMainLoop(set_as_default=True)
-loop = gobject.MainLoop()
+loop = GLib.MainLoop()
#########################################
@@ -200,8 +200,5 @@ def quit_if_pdf_exits():
thread = threading.Thread(target=quit_if_pdf_exits, args=())
thread.start()
-# enable threads again, otherwise the quit_if_pdf_exits-thread will not be
-# executed
-gobject.threads_init()
loop.run()