vimtex lists some commands like ie
to be entered in mode nxo
. How do I do that? What is mode nxo
? (Usually i
brings me into insert mode, and e
then just inserts an e
.)
In vimtex, the mappings like ie
are actually vim text objects (not sure about the right vim nomenclature though). They work together with vim operators like d
(delete).
In particular ie
stands for any tex environment like equation
, itemize
, .... For example, if you cursor is somewhere inside
\begin{equation}
Ax = b
\end{equation}
the command die
will delete everything between \begin{equation}
and \end{equation}
and leave you with
\begin{equation}\end{equation}
.
-
Perfect, works like a charm! - Now the help texts
<plug>(vimtex-ie) Text object for environments (exclusive).
etc. also make sense. Thank you. – not-a-user Aug 2 '16 at 15:17 -
Glad I could help. I switched to vimtex yesterday and I had exactly the same problem. – Jan Aug 2 '16 at 15:27
N represents Normal mode and O represents operational mode and X represents Ex mode. Mappings can be done in normal, ex (similar to command line), visual, insert and operational mode as well. To know more, http://vimdoc.sourceforge.net/htmldoc/intro.html
Vim knows to distinguish key mappings and predefined commands. For example, if you have a mapping like ie
in normal mode, when you press i
, it waits for some time (timeout) and checks whether you entered e
so that it can execute the mapping. If you didn't press any key within that time, it goes to insert mode.
So, whatever mapping you have, you have to press the characters in mapping one after the other immediately (within the timeout time). If you do so, that mapping get executed. If you fail to complete the mapping (fail to press all keys within time), the predefined command with the first key or (first+second key) gets executed.
One example:
Let's take di{
. This mapping deletes text inside a {
and }
pair. Suppose if you press d
, it waits for some keys to be pressed. This waiting mode is called operational mode. If you didn't press i{
within that time, the command is incomplete and gets cancelled.
-
I go from normal mode to insert mode immediately on
i
. I also get no timeout after the firstd
if I dodd
, for example. (Ubuntu 16.04 and vim version 7.4.1689) – not-a-user Jul 28 '16 at 11:12 -
-
-
What is the output of
:map ie
? Can you see the plugin's mapping here? – SibiCoder Jul 28 '16 at 12:29 -
:map ie
yieldso ie @<Plug>(vimtex-ie)
andx ie @<Plug>(vimtex-ie)
- Actually I can use these commands likeie
after having entered "visual block" mode by pressing<Ctrl-V>
. – not-a-user Jul 28 '16 at 13:02