https://github.com/guiltydolphin/tex-headings-vim
Vim plugin for changing (La)TeX section headers.
https://github.com/guiltydolphin/tex-headings-vim
Last synced: 4 months ago
JSON representation
Vim plugin for changing (La)TeX section headers.
- Host: GitHub
- URL: https://github.com/guiltydolphin/tex-headings-vim
- Owner: GuiltyDolphin
- License: gpl-3.0
- Created: 2015-10-20T18:05:10.000Z (over 10 years ago)
- Default Branch: master
- Last Pushed: 2015-11-19T17:00:57.000Z (over 10 years ago)
- Last Synced: 2025-03-03T05:09:21.938Z (over 1 year ago)
- Language: VimL
- Size: 18.6 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
TeX-headings-vim
================
Vim plugin for modifying (La)TeX section headers.
Available on [GitHub](https://www.github.com/GuiltyDolphin/tex-headings-vim)
Installing
----------
If you have [Vundle](https://www.github.com/VundleVim/Vundle.vim),
then just add `Plugin 'guiltydolphin/tex-headings-vim'` to the
plugin section of your vimrc.
Setup
-----
To use the plugin, simply map some keys to
`:call TeXHeaderHigher()` and `:call TeXHeaderLower()`.
For example:
```
augroup TeXHeaderBinds
au FileType tex nnoremap hh :call TeXHeaderHigher()
au FileType tex nnoremap hl :call TeXHeaderLower()
augroup END
```
The `g:tex_headings_update_refs` variable controls how references
are handled.
0. Do nothing with references of the section.
1. Update references without asking.
2. Update references, but ask before each one.
Note that if a section has the label `\label{sec:foo}`, then
anything that matches `\` is considered a reference.
Example
-------
Using the bindings defined above, and
`g:tex_headings_update_refs` set to 1:
With the text:
```
... some text ...
\section{foo}
\label{sec:foo}
... some text ...
... Section~\ref{sec:foo}
```
Using `hl` would result in
```
... some text ...
\subsection{foo}
\label{sub:foo}
... some text ...
... Section~\ref{sub:foo}
```
License
-------
Copyright (c) 2015 GuiltyDolphin (Ben Moon)
Licensed under GNU GPLv3 - see the `LICENSE` file for more
information.