mirror of
https://github.com/tiyn/dotfiles.git
synced 2026-01-10 02:49:45 +01:00
Compare commits
3 Commits
dc038976e3
...
09c6f7edc3
| Author | SHA1 | Date | |
|---|---|---|---|
| 09c6f7edc3 | |||
| b6b8d96789 | |||
| 331b40be61 |
@@ -1,27 +1,55 @@
|
|||||||
return {
|
return {
|
||||||
-- latex asynchronous pdf rendering
|
|
||||||
{
|
{
|
||||||
'frabjous/knap',
|
'frabjous/knap',
|
||||||
ft = { 'tex' },
|
ft = { 'tex' },
|
||||||
config = function()
|
config = function()
|
||||||
|
|
||||||
|
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 -synctex=1 -interaction=batchmode %docroot%"
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
vim.g.knap_settings = {
|
vim.g.knap_settings = {
|
||||||
delay = 100,
|
delay = 100,
|
||||||
-- tex
|
|
||||||
texoutputext = "pdf",
|
texoutputext = "pdf",
|
||||||
textopdf = "pdflatex -synctex=1 -halt-on-error -interaction=batchmode %docroot%",
|
textopdf = "xelatex -synctex=1 -interaction=batchmode %docroot%",
|
||||||
textopdfviewerlaunch =
|
textopdfviewerlaunch =
|
||||||
"zathura --synctex-editor-command 'nvim --headless -es --cmd \"lua require('\"'\"'knaphelper'\"'\"').relayjump('\"'\"'%servername%'\"'\"','\"'\"'%{input}'\"'\"',%{line},0)\"' ./%outputfile%",
|
"zathura --synctex-editor-command 'nvim --headless -es --cmd \"lua require('\"'\"'knaphelper'\"'\"').relayjump('\"'\"'%servername%'\"'\"','\"'\"'%{input}'\"'\"',%{line},0)\"' ./%outputfile%",
|
||||||
textopdfviewerrefresh = "none",
|
textopdfviewerrefresh = "reload",
|
||||||
textopdfforwardjump = "zathura --synctex-forward=%line%:%column%:%srcfile% %outputfile%",
|
textopdfforwardjump =
|
||||||
-- markdown
|
"zathura --synctex-forward=%line%:%column%:%srcfile% %outputfile%",
|
||||||
mdoutputext = "pdf",
|
|
||||||
mdtopdf = "pandoc %docroot% --pdf-engine=xelatex -H ~/.config/nvim/lua/resources/header.tex --toc --toc-depth=5 -V colorlinks=true -V linkcolor=blue -V urlcolor=red -V toccolor=gray -o %outputfile%",
|
|
||||||
mdtopdfviewerlaunch = "zathura ./%outputfile%",
|
|
||||||
mdtohtml = "pandoc --standalone %docroot% -o %outputfile%",
|
|
||||||
mdtohtmlviewerlaunch = "firefox --kiosk --new-window %outputfile%",
|
|
||||||
mdtohtmlviewerrefresh = "none",
|
|
||||||
mdtopdfviewerrefresh = "none",
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
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", {
|
||||||
|
pattern = "*.tex",
|
||||||
|
callback = set_engine
|
||||||
|
})
|
||||||
end
|
end
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -191,17 +191,20 @@ setopt autocd autopushd
|
|||||||
autoload -Uz compinit && compinit
|
autoload -Uz compinit && compinit
|
||||||
|
|
||||||
# Plugin: command not found notice
|
# Plugin: command not found notice
|
||||||
source /usr/share/doc/pkgfile/command-not-found.zsh
|
[ -f "/usr/share/doc/pkgfile/command-not-found.zsh" ] && source /usr/share/doc/pkgfile/command-not-found.zsh
|
||||||
|
|
||||||
# Plugin: fuzzy completion
|
# Plugin: fuzzy completion
|
||||||
source /usr/share/zsh/plugins/fzf-tab-git/fzf-tab.plugin.zsh
|
[ -f "/usr/share/zsh/plugins/fzf-tab-git/fzf-tab.plugin.zsh" ] && source /usr/share/zsh/plugins/fzf-tab-git/fzf-tab.plugin.zsh
|
||||||
|
|
||||||
# Plugin: autosuggestions
|
# Plugin: autosuggestions
|
||||||
source /usr/share/zsh/plugins/zsh-autosuggestions/zsh-autosuggestions.zsh
|
[ -f "/usr/share/zsh/plugins/zsh-autosuggestions/zsh-autosuggestions.zsh" ] && source /usr/share/zsh/plugins/zsh-autosuggestions/zsh-autosuggestions.zsh && bindkey '^ ' autosuggest-accept
|
||||||
bindkey '^ ' autosuggest-accept
|
|
||||||
|
|
||||||
# Plugin: syntax highlighting
|
# Plugin: syntax highlighting
|
||||||
source /usr/share/zsh/plugins/fast-syntax-highlighting/fast-syntax-highlighting.plugin.zsh
|
[ -f "/usr/share/zsh/plugins/fast-syntax-highlighting/fast-syntax-highlighting.plugin.zsh" ] && source /usr/share/zsh/plugins/fast-syntax-highlighting/fast-syntax-highlighting.plugin.zsh
|
||||||
|
|
||||||
|
# Plugin: Autopair
|
||||||
|
|
||||||
|
[ -f "/usr/share/zsh/plugins/zsh-autopair/zsh-autopair.plugin.zsh" ] && source /usr/share/zsh/plugins/zsh-autopair/zsh-autopair.plugin.zsh
|
||||||
|
|
||||||
# Open shell with tmux always
|
# Open shell with tmux always
|
||||||
if [[ -n "$PS1" ]] && [[ -z "$TMUX" ]] && [[ -n "$SSH_CONNECTION" ]]; then
|
if [[ -n "$PS1" ]] && [[ -z "$TMUX" ]] && [[ -n "$SSH_CONNECTION" ]]; then
|
||||||
|
|||||||
2
.profile
2
.profile
@@ -68,6 +68,8 @@ export PATH="${HOME}/.nimble/bin:${PATH}"
|
|||||||
export PYENV_ROOT="$HOME/.pyenv"
|
export PYENV_ROOT="$HOME/.pyenv"
|
||||||
export PATH="$PYENV_ROOT/bin:$PATH"
|
export PATH="$PYENV_ROOT/bin:$PATH"
|
||||||
|
|
||||||
|
eval "$(pyenv init --path)"
|
||||||
|
|
||||||
# less/man colors
|
# less/man colors
|
||||||
export LESS=-R
|
export LESS=-R
|
||||||
export LESS_TERMCAP_mb="$(printf '%b' '[1;31m')"; a="${a%_}"
|
export LESS_TERMCAP_mb="$(printf '%b' '[1;31m')"; a="${a%_}"
|
||||||
|
|||||||
Reference in New Issue
Block a user