Skip to content
This repository has been archived by the owner on Apr 9, 2022. It is now read-only.
/ tex.nvim Public archive

[ARCHIVED] A Neovim plugin for TeX written in Lua

License

Notifications You must be signed in to change notification settings

aspeddro/tex.nvim

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 

Repository files navigation

2022-04-08: This plugin was archived because most of the resources it implements are available on the language server https://github.com/latex-lsp/texlab

tex.nvim

A Neovim plugin for TeX written in Lua.

Requirements

  • Neovim >= 0.5.0

Features

  • Switch between engines, pdflatex, xelatex, lualatex, latexmk and tectonic
  • Watch multiple files
  • Compile in specific events
  • PDF viewers

Recomendations

Installation

use {
  'aspeddro/tex.nvim',
  config = function()
    require'tex'.setup{
      engine = 'tectonic',
      viewer = 'evince' -- your pdf viewer or 'xdg-open' to open default viewer
    }
  end
}
require "paq" {
  'aspeddro/tex.nvim';
}
require'tex'.setup{
  engine = 'tectonic',
  viewer = 'evince'
}
Plug 'aspeddro/tex.nvim'

Configuration

-- default config
require'tex'.setup{
  engine = 'latexmk', -- tex engine
  compile = {
    events = { 'BufWritePost' }, -- compile when buffer is saved
    watchlist = true -- enable feature to compile file when any file from watch list is changed
  },
  viewer = nil,
  engines = { -- engines config
    tectonic = {},
    latexmk = {
      args = {
        '-pdf',
        ['-interaction'] = 'nonstopmode'
      }
    },
    pdflatex = {
      args = {
        ['-interaction'] = 'nonstopmode'
      }
    },
    xelatex = {
      args = {
        ['-interaction'] = 'nonstopmode'
      }
    },
    lualatex = {
      args = {
        ['-interaction'] = 'nonstopmode'
      }
    }
  }

}

Usage

Use Tab key for completion.

Make file the index. If index is set then :TexCompile only compile the index.

:TexSwitchIndex

Switch TeX engine:

:TexSwitchEngine

Print the index file:

:TexCurrentIndex

Add file to watch list:

:TexAdd

Remove file from watch list:

:TexRemove

Print watch list:

:TexWatching

Compile the index file:

:TexCompile

For specific file :TexCompile path/to/some.tex

Kill job:

:TexKill

Open PDF viewer:

:TexViewer

Keymapping

vim.api.nvim_set_keymap('n', '<leader>rr', ':TexCompile<CR>', { noremap = true, silent = true })
vim.api.nvim_set_keymap('n', '<leader>aa', ':TexAdd<CR>', { noremap = true, silent = true })
vim.api.nvim_set_keymap('n', '<leader>dd', ':TexRemove<CR>', { noremap = true, silent = true })

TODO

  • Open log file
  • Scan dir with vim.loop
  • Short file name
  • Save session status

About

[ARCHIVED] A Neovim plugin for TeX written in Lua

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages