-
Notifications
You must be signed in to change notification settings - Fork 391
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
merge: add motion to jump to math zones
This adds the motions [n, [N, ]n, ]N for moving to the beginning or end of the previous/next math zone. refer: #1818
- Loading branch information
Showing
6 changed files
with
216 additions
and
29 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
\documentclass[]{article} | ||
|
||
\begin{document} | ||
|
||
Test file for math motion. | ||
|
||
\begin{equation} % [n[n or 2[n | ||
1 + 1 = 2 | ||
\end{equation} % [N[N or 2[N | ||
|
||
\( 1 + 1 = 2 \) % Opening: [n, Closing: [N | ||
|
||
\begin{enumerate} | ||
\item 1 | ||
\item 2 | ||
\item 3 | ||
\item 4 | ||
\end{enumerate} | ||
% CURSOR | ||
\[ % ]n | ||
1 + 1 = 2 | ||
\] % ]N | ||
|
||
\begin{itemize} | ||
\item $1 + 1 = 2$. % Opening: ]n]n or 2]n, Closing: ]N]N or 2]N | ||
\end{itemize} | ||
|
||
$1 + 1 = 2$ % Opening: ]n]n]n or 3]n, Closing: ]N]N]N or 3]N | ||
$$1 + 1 = 2$$ % Opening: ]n]n]n]n or 4]n, Closing: ]N]N]N]N or 4]N | ||
|
||
\end{document} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
set nocompatible | ||
let &rtp = '../../..,' . &rtp | ||
filetype plugin on | ||
syntax on | ||
|
||
nnoremap q :qall!<cr> | ||
silent edit test-math-motions.tex | ||
|
||
if empty($INMAKE) | finish | endif | ||
|
||
" vint: -ProhibitCommandRelyOnUser | ||
|
||
normal 19G2]n | ||
call vimtex#test#assert_equal(line('.'), 25) | ||
|
||
normal 19G]N | ||
call vimtex#test#assert_equal(line('.'), 22) | ||
|
||
normal 19G2[n | ||
call vimtex#test#assert_equal(line('.'), 7) | ||
|
||
normal 19G[N | ||
call vimtex#test#assert_equal(line('.'), 11) | ||
|
||
quit! |