Pony of Shadows

Uncertainty is Fascinating.


note on vimtex

Document

Filetype

:echo &filetype

To prevent the unexpected behaviour where .tex files by default will be recognized as the filetype plaintex (|ft-plaintex-syntax|) for e.g. empty documents, VimTeX overrides the filetype detection for .tex.

one document

With navigation and folding, You don’t need spilt your paper to several parts anymone, just one tex file for one project!

Motions vimtex-motions

  • Move between section boundaries with [[, [], ][, and ]]
  • Move between environment boundaries with [m, [M, ]m, and ]M
  • Move between math environment boundaries with [n, [N, ]n, and ]N
  • Move between frame environment boundaries with [r, [R, ]r, and ]R
  • Move between comment boundaries with [* and ]*
  • Move between matching delimiters with %

Folding

  • config:???
vim.g.vimtex_fold_enabled = 1
vim.o.foldmethod = "expr"
vim.o.foldexpr = "vimtex#fold#level()"
  • command:
    • zc 折叠当前对象
    • zo 展开当前对象。
    • za 切换折叠状态。

Wordcount

:VimtexCountWords

Other mappings

  • Delete the surrounding command, environment or delimiter with dsc/dse/ds$/dsd
  • Change the surrounding command, environment or delimiter with csc/cse/cs$/csd
  • Toggle between complementary environments with tse
  • Toggle starred command or environment with tsc/tss
  • Toggle inline and displaymath with ts$
  • Toggle between e.g. () and \left(\right) with tsd/tsD
  • Toggle (inline) fractions with tsf
  • Toggle line-break macro \\ with tsb
  • Close the current environment/delimiter in insert mode with ]]
  • Add \left ... \right) modifiers to surrounding delimiters with <F8>
  • Insert new command with <F7>
  • Convenient insert mode mappings for faster typing of e.g. maths
  • Context menu on citations (e.g. \cite{...}) mapped to <cr>