• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

rbonvall/vim-textobj-latex: Vim text objects for LaTeX code

原作者: [db:作者] 来自: 网络 收藏 邀请

开源软件名称(OpenSource Name):

rbonvall/vim-textobj-latex

开源软件地址(OpenSource Url):

https://github.com/rbonvall/vim-textobj-latex

开源编程语言(OpenSource Language):

Vim Script 100.0%

开源软件介绍(OpenSource Introduction):

textobj-latex — Vim text objects for LaTeX code

This plugin provides text objects for common LaTeX stuff that are not conveniently described by builtin Vim text objects.

Currently supported text objects are:

a i Description
a\ i\ Inline math surrounded by \( and \).
a$ i$ Inline math surrounded by dollar signs.
aq iq Single-quoted text `like this'.
aQ iQ Double-quoted text ``like this''.
ae ie Environment \begin{…} to \end{…}

Example

Let █ be the position of the cursor.

Start with this:

\begin{document}
\begin{frame}{Example}
\begin{minipage}[t]{0.4\textwidth}
  The ``quick'' brown fox jumped█
  over the ``lazy'' dog
  \(\sum_i n_i\) times this month
  where \(n_i\) is the number of jumps
  on day $i$.
\end{minipage}
\end{frame}
\end{document}

Press >ae to indent the minipage:

\begin{document}
\begin{frame}{Example}
  \begin{minipage}[t]{0.4\textwidth}
    The ``quick'' brown fox jumped█
    over the ``lazy'' dog
    \(\sum_i n_i\) times this month
    where \(n_i\) is the number of jumps
    on day $i$.
  \end{minipage}
\end{frame}
\end{document}

Press Fq and then gUiQ to convert the double-quoted text to uppercase:

\begin{document}
\begin{frame}{Example}
  \begin{minipage}[t]{0.4\textwidth}
    The ``█QUICK'' brown fox jumped
    over the ``lazy'' dog
    \(\sum_i n_i\) times this month
    where \(n_i\) is the number of jumps
    on day $i$.
  \end{minipage}
\end{frame}
\end{document}

Press jj and then ci\ to start changing the equation:

\begin{document}
\begin{frame}{Example}
  \begin{minipage}[t]{0.4\textwidth}
    The ``QUICK'' brown fox jumped
    over the ``lazy'' dog
    \(█\) times this month
    where \(n_i\) is the number of jumps
    on day $i$.
  \end{minipage}
\end{frame}
\end{document}

Type something, then <Esc> and jjh:

\begin{document}
\begin{frame}{Example}
  \begin{minipage}[t]{0.4\textwidth}
    The ``QUICK'' brown fox jumped
    over the ``lazy'' dog
    \(n_1 + \cdots + n_30\) times this month
    where \(n_i\) is the number of jumps
    on day $i$█.
  \end{minipage}
\end{frame}
\end{document}

da$, B and p moves the equation before its preceding word:

\begin{document}
\begin{frame}{Example}
  \begin{minipage}[t]{0.4\textwidth}
    The ``QUICK'' brown fox jumped
    over the ``lazy'' dog
    \(n_1 + \cdots + n_30\) times this month
    where \(n_i\) is the number of jumps
    on $i$█day .
  \end{minipage}
\end{frame}
\end{document}

i, -th, <Esc>f<Space>x and you're done:

\begin{document}
\begin{frame}{Example}
  \begin{minipage}[t]{0.4\textwidth}
    The ``QUICK'' brown fox jumped
    over the ``lazy'' dog
    \(n_1 + \cdots + n_30\) times this month
    where \(n_i\) is the number of jumps
    on $i$-th day.█
  \end{minipage}
\end{frame}
\end{document}

Installation

Textobj-latex depends on Kana's textobj-user, so you have to install it first.

If you use Vundle, add the following lines to your .vimrc:

Bundle 'kana/vim-textobj-user'
Bundle 'rbonvall/vim-textobj-latex'

and then run :BundleInstall from within Vim.

If you use Pathogen, clone both repos in your bundle directory:

cd ~/.vim/bundle
git clone git://github.com/kana/vim-textobj-user
git clone git://github.com/rbonvall/vim-textobj-latex

If you don't use either: you should.

I have included dependency information for Vim Addon Manager and Vim Flavor, but have made no effort whatsoever to test if they work properly.

Author

Roberto Bonvallet <[email protected]>

License

Same terms as Vim itself.




鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap