All Projects → brennier → quicktex

brennier / quicktex

Licence: MIT license
A vim plugin for writing Latex quickly.

Programming Languages

Vim Script
2826 projects

Projects that are alternatives of or similar to quicktex

vim-phpstan
A Vim plugin for PHPStan - https://github.com/phpstan/phpstan. It calls `phpstan` to do static analysis of your PHP code and displays the errors in Vim's quickfix list.
Stars: ✭ 26 (-76.36%)
Mutual labels:  vim-plugins
gotests-vim
Vim plugin for https://github.com/cweill/gotests
Stars: ✭ 129 (+17.27%)
Mutual labels:  vim-plugins
vim-hdl
Vim plugin to aid VHDL development (for LSP, see https://github.com/suoto/hdl_checker)
Stars: ✭ 59 (-46.36%)
Mutual labels:  vim-plugins
vim-debugstring
Debug printf()-style at the speed of light
Stars: ✭ 30 (-72.73%)
Mutual labels:  vim-plugins
vim-UT
Unit Testing plugin for Vim
Stars: ✭ 18 (-83.64%)
Mutual labels:  vim-plugins
filestyle
filestyle is a Vim plugin that highlights unwanted whitespace and characters.
Stars: ✭ 30 (-72.73%)
Mutual labels:  vim-plugins
writable search.vim
Grep for something, then write the original files directly through the search results.
Stars: ✭ 47 (-57.27%)
Mutual labels:  vim-plugins
neomake-multiprocess
A vim plugin for running multiple process asynchronously base on neomake.
Stars: ✭ 36 (-67.27%)
Mutual labels:  vim-plugins
ranger-explorer.vim
Vim plugin to use ranger as a file explorer. Seamless switching between vim and ranger.
Stars: ✭ 30 (-72.73%)
Mutual labels:  vim-plugins
alternate-lite
a.vim rewriting
Stars: ✭ 21 (-80.91%)
Mutual labels:  vim-plugins
name-assign.vim
Vim plugin to automate replacing expressions with assigned variables in any programming language
Stars: ✭ 45 (-59.09%)
Mutual labels:  vim-plugins
swifty-vim
⌨️ A Vim plugin for Swift which provides file detection, syntax highlighting, support for compiling and running tests, and optional support for formatting and linting tools.
Stars: ✭ 18 (-83.64%)
Mutual labels:  vim-plugins
vim-build-tools-wrapper
Projects building plugin for Vim
Stars: ✭ 23 (-79.09%)
Mutual labels:  vim-plugins
vimapt
A package manager for vim (VimApt => Vim's Advanced Package Tools)
Stars: ✭ 16 (-85.45%)
Mutual labels:  vim-plugins
dotfiles
NeoVim + git + zsh + tmux bliss
Stars: ✭ 19 (-82.73%)
Mutual labels:  vim-plugins
dotfiles
My hand crafted .dotfiles 🤚🛠❤️
Stars: ✭ 49 (-55.45%)
Mutual labels:  vim-plugins
vim-SystemVerilog
SystemVerilog syntax highlight/indent support in vim
Stars: ✭ 37 (-66.36%)
Mutual labels:  vim-plugins
vim-gitbranch
Provides the branch name of the current git repository
Stars: ✭ 171 (+55.45%)
Mutual labels:  vim-plugins
vim-find-files
🔎 Search for files and show results in a quickfix list, new buffer, or populate the argument list.
Stars: ✭ 25 (-77.27%)
Mutual labels:  vim-plugins
nv-ide
Neovim custom configuration, oriented for full stack developers (rails, ruby, php, html, css, SCSS, javascript)
Stars: ✭ 363 (+230%)
Mutual labels:  vim-plugins

QuickTex is a template expander for quickly writing LaTeX

Before anything else, here's a real-time demonstration of what QuickTex can do:

Basically, QuickTex allows you to set keywords which activate arbitrary Vim code whenever they are typed in insert mode. The expansions are filetype specific and are triggered by pressing space. In most respects, you can think of it like a much-improved version of Vim abbreviations.

How is QuickTex different from UltiSnips or Vim abbreviations?

The main points are simply

  1. QuickTex has a separate namespace for math mode expansions. This will help you type math in Latex faster than you ever thought possible. My math mode dictionary has hundreds of keywords in it, which allow me to pratically type in English and have it converted into pure Latex in real-time.

  2. QuickTex keywords are automatically triggered after a space. This allows you to have seamless expansions that don't slow you down and allow you to type keyword after keyword in rapid sucession.

  3. QuickTex is very fast. Since the code is written completely in Vimscript, QuickTex expands keywords instanteously. Programming similar functionality into a snippets plugin would be significantly slower, especially when you include the context dependence for math mode.

Here's a little table that displays some of the main differences:

Features QuickTex UltiSnips Abbreviations
Default Trigger Key <Space> <Tab> Any non-word character
Cursor Placement Yes Yes No
Default Jump Key <Space><Space>* <C-J> N\A
Placeholders <++> Invisible N\A
Available Modes Only Insert Mode Only Insert Mode Any mode
Math Mode Context? Yes, very fast Possible, but slow Very difficult to implement
Speed Ranking Fastest Slowest In the middle
File Type Specific? Yes Yes No

* Requires adding the entry \' ' : "\<ESC>:call search('<+.*+>')\<CR>\"_c/+>/e\<CR>", to your dictionary, which is highly recommended.

Installation

I personally use vim-plug, but here's the various install commands for a variety of plugin managers:

" vim-plug
Plug 'brennier/quicktex'
" NeoBundle
NeoBundle 'brennier/quicktex'
" Vundle
Plugin 'brennier/quicktex'

Configuration

The keywords and their expansions are recorded in various dictionaries. Each filetype has its own dictionary, which should be named in the form of g:quicktex_<filetype>. There is also an additional dictionary that you can use called g:quicktex_math which is used whenever you are inside math delimiters of a Latex file. This example dictionary would give you all the functionality you need for the above gif to work:

let g:quicktex_tex = {
    \' '   : "\<ESC>:call search('<+.*+>')\<CR>\"_c/+>/e\<CR>",
    \'m'   : '\( <+++> \) <++>',
    \'prf' : "\\begin{proof}\<CR><+++>\<CR>\\end{proof}",
\}

let g:quicktex_math = {
    \' '    : "\<ESC>:call search('<+.*+>')\<CR>\"_c/+>/e\<CR>",
    \'fr'   : '\mathcal{R} ',
    \'eq'   : '= ',
    \'set'  : '\{ <+++> \} <++>',
    \'frac' : '\frac{<+++>}{<++>} <++>',
    \'one'  : '1 ',
    \'st'   : ': ',
    \'in'   : '\in ',
    \'bn'   : '\mathbb{N} ',
\}

A few things to note here. If there is a <+++> anywhere in the expansion, then your cursor will automatically jump to that point after the expansion is triggered. Also, while not strictly necessary, I highly advise adding the \' ' : "\<ESC>:call search('<+.*+>')\<CR>\"_c/+>/e\<CR>", entry, which will allow you automatically jump to the next <++> if you press space after a space. You may think this would be annoying to map double space to this, but it's actually extremely useful and doesn't get in the way as much as you'd think. Using this entry, you can put <++>'s in your other expansions to jump around very easily.

Keywords can be any string without whitespace. Expansions can either be a literal string (using single quotes) or a string with keypress expansions (using double quotes). Keypress expansions are things like \<CR>, \<BS>, or \<Right> that one would find in vim remappings. Keep in mind that \'s need to be escaped (i.e. \\) when using double quoted strings and that you need a \ at the beginning of each line of your dictionary.

For more ideas about what to include your dictionary, please take a look at the default dictionaries in ftplugin/tex/default_keywords.vim. It is highly recommended that you make your own custom dictionaries, as the default dictionaries may change without warning.

For more information, read the full documentation using :help quicktex.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].