When I write a text in VIM (insert mode) it automatically replaces: $1 with (), $2 with [], $3 with {} and $4 with:
{
}
For the other digits (E.g.: $5) it has an expected behavior.
How can I disable this replacement?
Edit:
1) If I type $, the caret remains about 1 second on that character. So, if I wait a little after typing $, it won't replace $1 with anything.
2) Output for :map $1 is:
v $1 * <Esc>`>a)<Esc>`<i(<Esc>
3) Output for :imap $1 is:
i $1 * ()<Esc>i
4) Output for :nmap $1 is:
No mapping found
5) I use many plugins, but according to the comments/answer, they are not relevant because there are some lines containing inoremap in my ~/.vimrc file.
Details:
This is not the default behaviour of vim.
You probably have a map or an insert map for these keystrokes. You can verify this with a
:verbose map $1
or
:verbose nmap $1
which shows what mappings there are.
If this is indeed the case, the first place to look for definitions is in your .vimrc:
:e $MYVIMRC
then search for $1 and/or map in the .vimrc
Alternatively, you might have some plugin that does that.
Edited with the helpful comment of Marth (using verbose to find out where the mapping was defined).
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With