mirror of
https://github.com/tiyn/dotfiles.git
synced 2026-08-25 21:41:36 +02:00
Compare commits
4 Commits
fcacf19aad
...
master
| Author | SHA1 | Date | |
|---|---|---|---|
| 44526a1830 | |||
| fb6df8ad34 | |||
| 731ba1b0f4 | |||
| 52521ae0d1 |
@@ -1,3 +1,4 @@
|
||||
dockerized
|
||||
keymap
|
||||
spectogram
|
||||
synaptics
|
||||
|
||||
@@ -3,6 +3,8 @@ APV
|
||||
Abdulkarim
|
||||
Accuracy
|
||||
Agentic
|
||||
Airsonic
|
||||
Airsonic-Advanced
|
||||
Akallabêth
|
||||
Altisaur
|
||||
An
|
||||
@@ -46,6 +48,8 @@ Color
|
||||
Combi
|
||||
Commander
|
||||
Crusader
|
||||
DAW
|
||||
DAWs
|
||||
DFKI
|
||||
DFKIs
|
||||
DPU
|
||||
@@ -55,6 +59,7 @@ DeepSeek
|
||||
Dekarldent
|
||||
Delivery
|
||||
Destiny
|
||||
Discogs
|
||||
Distrobox
|
||||
Doom
|
||||
Doyma
|
||||
@@ -73,14 +78,17 @@ FIDO
|
||||
Face
|
||||
Fischerhude
|
||||
Flac
|
||||
FluidSynth
|
||||
Forest
|
||||
Forgejo
|
||||
Französischmodul
|
||||
Freizeitkarte
|
||||
Frevert
|
||||
Freverts
|
||||
Friedl
|
||||
Friesenturnier
|
||||
Gathering
|
||||
Geofabrik
|
||||
GitNex
|
||||
Glaive
|
||||
Glenn
|
||||
@@ -111,6 +119,7 @@ Ikigai
|
||||
Immich
|
||||
Int
|
||||
Ira
|
||||
Ironman
|
||||
JT
|
||||
Jacobin
|
||||
Jeanine
|
||||
@@ -141,6 +150,7 @@ LightDM-GTK-Greeter
|
||||
LightDM-Mini-Greeter
|
||||
LilyPond
|
||||
Line Dance
|
||||
Linuxize
|
||||
Loafer
|
||||
Lounge
|
||||
MEVIS
|
||||
@@ -153,6 +163,7 @@ Marten
|
||||
Mathis
|
||||
Matvey
|
||||
Mauli
|
||||
MediaInfo
|
||||
Mentos
|
||||
Meret
|
||||
Meshtastic
|
||||
@@ -160,6 +171,7 @@ Metzener
|
||||
MiiMii
|
||||
Mint
|
||||
Mukluk
|
||||
MusicBrainz
|
||||
MusikAka
|
||||
MusikAkademie
|
||||
NVIM
|
||||
@@ -181,6 +193,7 @@ Oberhausern
|
||||
Oberweseler
|
||||
Odysee
|
||||
Opam
|
||||
OpenAudible
|
||||
OpenCloud
|
||||
Ove
|
||||
Overwatch
|
||||
@@ -194,6 +207,7 @@ PfingstAka
|
||||
PfingstAkademie
|
||||
Pillion
|
||||
Pluribus
|
||||
Podgrab
|
||||
PopOS
|
||||
Portainer
|
||||
Power
|
||||
@@ -202,6 +216,8 @@ Precision
|
||||
Precon
|
||||
Precons
|
||||
PyEnv
|
||||
QMapShack
|
||||
Qobuz
|
||||
RStudio
|
||||
Rebowl
|
||||
Reed
|
||||
@@ -209,6 +225,7 @@ Reeves
|
||||
Reichenecker
|
||||
Rida
|
||||
Rocq
|
||||
Routino
|
||||
Ruschenbaum
|
||||
SDS
|
||||
SPM
|
||||
@@ -230,7 +247,9 @@ SommerAka
|
||||
SommerAkademie
|
||||
Souleyman
|
||||
SpotiFLAC
|
||||
Spotlistr
|
||||
Sprave
|
||||
StackOverflow
|
||||
Stina
|
||||
Stud.IP
|
||||
Study
|
||||
@@ -245,6 +264,7 @@ Tornow
|
||||
TrackPoint
|
||||
Traefik
|
||||
UDEV
|
||||
UDEV
|
||||
UMAP
|
||||
Umbar
|
||||
V1del
|
||||
@@ -264,17 +284,33 @@ Years
|
||||
Yorma
|
||||
Ziegeleiweg
|
||||
Zimin
|
||||
aac
|
||||
aiff
|
||||
alac
|
||||
and
|
||||
baseimage-gui
|
||||
ctop
|
||||
dts
|
||||
eKiwi
|
||||
flac
|
||||
fre:ac
|
||||
glaive
|
||||
inf
|
||||
jlesages
|
||||
jupytext
|
||||
liquidctl
|
||||
matplotlib
|
||||
metaflac
|
||||
notedown
|
||||
npy
|
||||
pip
|
||||
ramdisk
|
||||
rembg
|
||||
scikit-learn
|
||||
systemd
|
||||
venv
|
||||
wav
|
||||
wma
|
||||
xinput
|
||||
yt-dl
|
||||
zedbraxmen
|
||||
|
||||
@@ -4,48 +4,68 @@ return {
|
||||
keys = {
|
||||
{
|
||||
"<leader>p",
|
||||
function() require("knap").toggle_autopreviewing() end,
|
||||
function()
|
||||
require("knap").toggle_autopreviewing()
|
||||
end,
|
||||
desc = "Knap: toggle autopreview",
|
||||
},
|
||||
},
|
||||
config = function()
|
||||
local knap = require("knap")
|
||||
local function detect_engine()
|
||||
local first_line = vim.api.nvim_buf_get_lines(0, 0, 1, false)[1] or ""
|
||||
if first_line:match("^%%%s*xelatex") then
|
||||
return "xelatex"
|
||||
else
|
||||
return "pdflatex"
|
||||
end
|
||||
end
|
||||
local function set_engine()
|
||||
local engine = detect_engine()
|
||||
if engine == "xelatex" then
|
||||
vim.g.knap_settings.textopdf = "xelatex -synctex=1 -interaction=batchmode %docroot%"
|
||||
else
|
||||
vim.g.knap_settings.textopdf = "pdflatex --shell-escape -synctex=1 -interaction=batchmode %docroot%"
|
||||
end
|
||||
end
|
||||
vim.g.knap_settings = {
|
||||
delay = 100,
|
||||
texoutputext = "pdf",
|
||||
-- textopdf = "pdflatex --shell-escape -synctex=1 -interaction=batchmode %docroot%",
|
||||
textopdf = "xelatex -synctex=1 -interaction=batchmode %docroot%",
|
||||
textopdfviewerlaunch = "zathura --synctex-editor-command 'nvim --headless -es --cmd \"lua require('\"'\"'knaphelper'\"'\"').relayjump('\"'\"'%servername%'\"'\"','\"'\"'%{input}'\"'\"',%{line},0)\"' ./%outputfile%",
|
||||
textopdfviewerrefresh = "reload",
|
||||
textopdf = "pdflatex --shell-escape -synctex=1 -interaction=batchmode %docroot%",
|
||||
textopdfviewerlaunch = "zathura --synctex-editor-command "
|
||||
.. "'nvim --headless -es --cmd "
|
||||
.. "\"lua require('\"'\"'knaphelper'\"'\"').relayjump("
|
||||
.. "'\"'\"'%servername%'\"'\"',"
|
||||
.. "'\"'\"'%{input}'\"'\"',%{line},0)\"' "
|
||||
.. "%outputfile%",
|
||||
textopdfviewerrefresh = "none",
|
||||
textopdfforwardjump = "zathura --synctex-forward=%line%:%column%:%srcfile% %outputfile%",
|
||||
}
|
||||
vim.api.nvim_create_autocmd("User", {
|
||||
pattern = "KnapShowView",
|
||||
callback = set_engine,
|
||||
})
|
||||
vim.api.nvim_create_autocmd("User", {
|
||||
pattern = "KnapCompile",
|
||||
callback = set_engine,
|
||||
})
|
||||
vim.api.nvim_create_autocmd("BufWritePost", {
|
||||
local function set_tex_engine(bufnr)
|
||||
bufnr = bufnr or vim.api.nvim_get_current_buf()
|
||||
if not vim.api.nvim_buf_is_valid(bufnr) then
|
||||
return
|
||||
end
|
||||
local lines = vim.api.nvim_buf_get_lines(bufnr, 0, 15, false)
|
||||
local use_xelatex = false
|
||||
for _, line in ipairs(lines) do
|
||||
local lower = line:lower()
|
||||
-- Detect XeLaTeX from the first 15 lines. Supported forms include the following.
|
||||
-- % !TeX program = xelatex
|
||||
-- % xelatex
|
||||
-- and packages which require or commonly imply XeLaTeX.
|
||||
if
|
||||
lower:match("^%%+%s*!tex%s+program%s*=%s*xelatex")
|
||||
or lower:match("^%%+%s*xelatex%s*$")
|
||||
or lower:match("\\usepackage[^}]*{fontspec}")
|
||||
or lower:match("\\usepackage[^}]*{unicode%-math}")
|
||||
or lower:match("\\usepackage[^}]*{mathspec}")
|
||||
then
|
||||
use_xelatex = true
|
||||
break
|
||||
end
|
||||
end
|
||||
local settings = vim.b[bufnr].knap_settings or {}
|
||||
if use_xelatex then
|
||||
settings.textopdf = "xelatex --shell-escape -synctex=1 -interaction=batchmode %docroot%"
|
||||
else
|
||||
settings.textopdf = "pdflatex --shell-escape -synctex=1 -interaction=batchmode %docroot%"
|
||||
end
|
||||
vim.b[bufnr].knap_settings = settings
|
||||
end
|
||||
vim.api.nvim_create_autocmd({
|
||||
"BufReadPost",
|
||||
"BufNewFile",
|
||||
"BufWritePost",
|
||||
}, {
|
||||
pattern = "*.tex",
|
||||
callback = set_engine,
|
||||
callback = function(args)
|
||||
set_tex_engine(args.buf)
|
||||
end,
|
||||
})
|
||||
vim.api.nvim_create_autocmd("FileType", {
|
||||
pattern = { "tex", "markdown" },
|
||||
@@ -58,6 +78,7 @@ return {
|
||||
desc = "Knap: jump to cursor",
|
||||
})
|
||||
if vim.bo[bufnr].filetype == "tex" then
|
||||
set_tex_engine(bufnr)
|
||||
knap.toggle_autopreviewing()
|
||||
end
|
||||
end,
|
||||
|
||||
29
.local/bin/etc/nvim/compiler
Executable file → Normal file
29
.local/bin/etc/nvim/compiler
Executable file → Normal file
@@ -27,13 +27,28 @@ has_python_version() {
|
||||
|
||||
textype() {
|
||||
command="pdflatex --shell-escape"
|
||||
(sed 5q "$file" | grep -i -q 'xelatex') && command="xelatex"
|
||||
$command --output-directory="$dir" "$base" &&
|
||||
grep -i addbibresource "$file" >/dev/null &&
|
||||
biber --input-directory "$dir" "$base" &&
|
||||
$command --output-directory="$dir" "$base" &&
|
||||
makeglossaries "$basenodir" &&
|
||||
$command --output-directory="$dir" "$base"
|
||||
# Detect XeLaTeX from the first 15 lines. Supported forms include:
|
||||
# % !TeX program = xelatex
|
||||
# % xelatex
|
||||
# and packages which require or commonly imply XeLaTeX.
|
||||
if sed -n '1,15p' "$file" | grep -Eiq \
|
||||
'(^%+[[:space:]]*!tex[[:space:]]+program[[:space:]]*=[[:space:]]*xelatex)|(^%+[[:space:]]*xelatex[[:space:]]*$)|(\\usepackage[^}]*\{(fontspec|unicode-math|mathspec)\})'; then
|
||||
command="xelatex"
|
||||
fi
|
||||
|
||||
$command --output-directory="$dir" "$base" || return 1
|
||||
|
||||
if grep -iq '\\addbibresource' "$file"; then
|
||||
biber --input-directory "$dir" "$base" || return 1
|
||||
$command --output-directory="$dir" "$base" || return 1
|
||||
fi
|
||||
|
||||
if grep -iq '\\makeglossaries' "$file"; then
|
||||
makeglossaries "$basenodir" || return 1
|
||||
$command --output-directory="$dir" "$base" || return 1
|
||||
fi
|
||||
|
||||
return 0
|
||||
}
|
||||
|
||||
case "$file" in
|
||||
|
||||
Reference in New Issue
Block a user