-
Notifications
You must be signed in to change notification settings - Fork 407
Contribute visual examples of VimTeX's motions and text-editing mappings #2362
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
90d456f
c8e441a
2c57a48
ae3bd30
f2e9a28
3525f34
dc1e67c
128f742
1f8da67
5138052
3a3ce56
58e704a
a977f6b
d09f77e
b53690b
6429f84
175558d
c8a9086
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,196 @@ | ||
| # VimTeX Visualized | ||
|
Owner
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is excellent! I like the title :) One thing, though: I don't feel quite "up to the task" of maintaining this particular file. In case there are changes or new features that someone wants "visualized", then I would need community help to update. Perhaps that should be clarified here?
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Agreed. If you have an idea about phrasing this disclaimer/notice-to-the-community, please go ahead. I am also happy to take responsibility for helping maintain this file, just not sure how that would work in practice. |
||
|
|
||
| This page contains animated GIFs demonstrating many of the core VimTeX editing | ||
| features listed in `:help vimtex-features` and documented in more detail at | ||
| `:help vimtex-mappings`. The GIFs and accompanying descriptions are used with | ||
| permission from [@ejmastnak](https://github.com/ejmastnak)'s guide to [Getting | ||
| started with the VimTeX | ||
| plugin](https://ejmastnak.github.io/tutorials/vim-latex/vimtex.html). | ||
|
|
||
| Hopefully the animations can give you a clearer mental image of what these | ||
| mappings do and how you might use them. You may want to scroll through this page | ||
| while simultaneously looking through `:help vimtex-features`—the animations | ||
| should nicely complement the plain-text documentation. | ||
|
|
||
| #### This page is community-maintained | ||
|
|
||
| * This page is made possible only with help from the community. | ||
| [@ejmastnak](https://github.com/ejmastnak), not | ||
| [@lervag](https://github.com/lervag), takes primary responsibility for | ||
| maintaining it, but contributions from all VimTeX users are welcome. | ||
|
|
||
| * If you notice mistakes or outdated content (following a VimTeX update, say) | ||
| feel free to open a PR to fix it yourself, or alternatively contact | ||
| [@ejmastnak](https://github.com/ejmastnak) at | ||
| [ejmastnak@gmail.com](mailto:ejmastnak@gmail.com), who will be happy to | ||
| help fix it. | ||
|
|
||
| ## Table of contents | ||
| <!-- vim-markdown-toc GFM --> | ||
|
|
||
| * [Motion commands](#motion-commands) | ||
| * [Navigating sections](#navigating-sections) | ||
| * [Navigating environments](#navigating-environments) | ||
| * [Navigating math zones](#navigating-math-zones) | ||
| * [Navigating frames](#navigating-frames) | ||
| * [Navigating matching delimiters](#navigating-matching-delimiters) | ||
| * [Text objects](#text-objects) | ||
| * [The delimiter and environment objects](#the-delimiter-and-environment-objects) | ||
| * [Deleting surrounding LaTeX content](#deleting-surrounding-latex-content) | ||
| * [Delete surrounding commands](#delete-surrounding-commands) | ||
| * [Delete surrounding environments](#delete-surrounding-environments) | ||
| * [Delete surrounding math zones](#delete-surrounding-math-zones) | ||
| * [Delete surrounding delimiters](#delete-surrounding-delimiters) | ||
| * [Changing surrounding LaTeX content](#changing-surrounding-latex-content) | ||
| * [Change surrounding commands](#change-surrounding-commands) | ||
| * [Change surrounding environments](#change-surrounding-environments) | ||
| * [Change surrounding math zones](#change-surrounding-math-zones) | ||
| * [Change surrounding delimiters](#change-surrounding-delimiters) | ||
| * [Toggling commands](#toggling-commands) | ||
| * [Toggling starred commands and environments](#toggling-starred-commands-and-environments) | ||
| * [Toggling delimiter modifiers](#toggling-delimiter-modifiers) | ||
| * [Toggling fractions](#toggling-fractions) | ||
|
|
||
| <!-- vim-markdown-toc --> | ||
|
|
||
| ## Motion commands | ||
|
|
||
| ### Navigating sections | ||
|
|
||
| Use `]]` to jump to the beginning of the next `\section`, `\subsection` or | ||
| `\subsubsection`, whichever comes first. Use `[[` to jump backward through | ||
| sections, and see the similar shortcuts `][` and `[]` in the VimTeX | ||
| documentation at `:help <Plug>(vimtex-][)` and `:help <Plug>(vimtex-[])`. | ||
|
|
||
|  | ||
|
|
||
| ### Navigating environments | ||
|
|
||
| Use `]m` and `[m` to jump to the next or previous environment `\begin{}` | ||
| command. See the VimTeX documentation for the similar shortcuts `]M` and `[M`, | ||
| described in `:help <Plug>(vimtex-]M)` and `:help <Plug>(vimtex-[M)`. | ||
|
|
||
|  | ||
|
|
||
| ### Navigating math zones | ||
|
|
||
| Use `]n` and `[n` to jump to the beginning of the next or previous math zone. | ||
| See the VimTeX documentation for the similar shortcuts `]N` and `[N`, | ||
| described in `:help <Plug>(vimtex-]N)` and `:help <Plug>(vimtex-[N)`. | ||
|
|
||
|  | ||
|
|
||
| ### Navigating frames | ||
|
|
||
| Use `]r` and `[r` to jump to the beginning of the next or previous Beamer | ||
| `frame` environment. See the VimTeX documentation for the similar shortcuts | ||
| `]R` and `[R`, described in `:help <Plug>(vimtex-]R)` and `:help | ||
| <Plug>(vimtex-[R)`. | ||
|
|
||
|  | ||
|
|
||
| ### Navigating matching delimiters | ||
|
|
||
| Use `%` to move between matching delimiters, inline-math `$` delimiters, and LaTeX environments. | ||
|
|
||
|  | ||
|
|
||
| ## Text objects | ||
|
|
||
| VimTeX provides text objects for commands, delimiters, environments, math zones, | ||
| sections, and items. Currently only delimiters and environments have a GIF. | ||
|
|
||
| ### The delimiter and environment objects | ||
|
|
||
| The following GIF uses Vim's visual mode to show highlight the scope of the | ||
| `id`, `ad`, `ie`, and `ae` text objects. | ||
|
|
||
|  | ||
|
|
||
| ## Deleting surrounding LaTeX content | ||
|
|
||
| ### Delete surrounding commands | ||
|
|
||
| Use `dsc` to delete a LaTeX command while preserving the command's argument(s); | ||
| the `dsc` mapping also recognizes and correctly deletes parameters inside square | ||
| brackets. | ||
|
|
||
|  | ||
|
|
||
| ### Delete surrounding environments | ||
|
|
||
| Use `dse` to delete the `\begin{}` and `\end{}` declaration surrounding a LaTeX | ||
| environment without changing the environment contents. | ||
|
|
||
|  | ||
|
|
||
| ### Delete surrounding math zones | ||
|
|
||
| Use `ds$` to delete surrounding math zones (display math, standard environments, | ||
| and inline math) without changing the math contents. | ||
|
|
||
|  | ||
|
|
||
| ### Delete surrounding delimiters | ||
|
|
||
| Use `dsd` to delete delimiters (e.g. `()`, `[]`, `{}`, *and* any of their `\left | ||
| \right`, `\big \big` variants) without changing the enclosed content. | ||
|
|
||
|  | ||
|
|
||
|
|
||
| ## Changing surrounding LaTeX content | ||
|
|
||
| ### Change surrounding commands | ||
|
|
||
| Use `csc` to change a LaTeX command while preserving the command's argument(s). | ||
|
|
||
|  | ||
|
|
||
| ### Change surrounding environments | ||
|
|
||
| Use `cse` to change the type of a LaTeX environment without changing the | ||
| environment contents. | ||
|
|
||
|  | ||
|
|
||
| ### Change surrounding math zones | ||
|
|
||
| Use `cs$` to change the type of surrounding math zone without changing the math | ||
| contents. You can switch between display math, standard environments, and inline | ||
| math. | ||
|
|
||
|  | ||
|
|
||
| ### Change surrounding delimiters | ||
|
|
||
| Use `csd` to change delimiters (e.g. `()`, `[]`, `{}`, and any of their `\left | ||
| \right`, `\big \big` variants) without changing the enclosed content; the `csd` | ||
| command is "smart" and correctly recognizes and preserves `\left \right`-style | ||
| modifiers. | ||
|
|
||
|  | ||
|
|
||
| ## Toggling commands | ||
|
|
||
| ### Toggling starred commands and environments | ||
|
|
||
| Use `tsc` and `tse` to toggle between starred and un-starred versions of | ||
| commands and environments, respectively. | ||
|
|
||
|  | ||
|
|
||
| ### Toggling delimiter modifiers | ||
|
|
||
| Use `tsd` to change between plain and `\left`/`\right` versions of delimiters. | ||
| Use the `g:vimtex_delim_toggle_mod_list` variable to add more modifiers to the | ||
| delimiter toggle list. (e.g. `\big` as in the GIF below) | ||
|
|
||
|  | ||
|
|
||
| ### Toggling fractions | ||
|
|
||
| Use `tsf` to toggle between inline and `\frac{}{}` versions of fractions. | ||
|
|
||
|  | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.