1
0
mirror of https://github.com/tiyn/dotfiles.git synced 2025-10-10 19:41:15 +02:00

nvim: swapped async tex previewer

This commit is contained in:
2023-08-10 03:48:56 +02:00
parent 6a685bae7a
commit 9e9a73232d
5 changed files with 26 additions and 29 deletions

View File

@@ -19,7 +19,7 @@ vim.filetype.add({
vim.api.nvim_create_autocmd({ 'VimLeave' },
{
pattern = { 'c' },
pattern = { '*.c' },
command = '!cclear'
})
@@ -105,7 +105,7 @@ vim.api.nvim_create_autocmd({ 'BufEnter', 'FileType' },
vim.api.nvim_create_autocmd({ 'VimLeave' },
{
pattern = { 'tex' },
pattern = { '*.tex' },
command = '!texclear %'
})

View File

@@ -42,8 +42,13 @@ vim.api.nvim_set_keymap('n', '<leader>ss', ':%s//gI<Left><Left><Left>', { norema
vim.api.nvim_set_keymap('n', '<leader>is', ':.w >> in<cr>dd', { noremap = true })
-- open corresponding file (pdf/html/...,md)
vim.api.nvim_set_keymap('n', '<leader>p', ':!opout <c-r>%<CR><CR>', { noremap = true })
-- frabjous/knap
vim.api.nvim_create_autocmd('FileType', {
pattern = 'tex',
callback = function()
vim.api.nvim_set_keymap('n', '<leader>p', ':lua require("knap").toggle_autopreviewing()<CR>', { noremap = true })
end,
})
-- iamcco/markdown-preview.nvim
vim.api.nvim_create_autocmd('FileType', {

View File

@@ -67,15 +67,6 @@ return require("lazy").setup({
build = "cd app && yarn install"
},
-- latex asynchronous pdf rendering
{
'donRaphaco/neotex',
ft = { 'tex' },
config = function()
vim.g.neotex_enabled = 2
end
},
-- nim language support
{
'zah/nim.vim',
@@ -420,6 +411,21 @@ return require("lazy").setup({
config = {}
},
-- latex asynchronous pdf rendering
{
'frabjous/knap',
ft = { 'tex' },
config = function()
vim.g.knap_settings = {
texoutputext = "pdf",
textopdf = "pdflatex -synctex=1 -halt-on-error -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%"
}
end
},
-- colorscheme
{
'tiyn/vim-tccs',
@@ -427,6 +433,7 @@ return require("lazy").setup({
vim.cmd('colorscheme tccs')
end
},
},
-- lazy.nvim configuration