I'm new to vim and trying to configure vim for my coding learning course. I tried these very basic inoremap lines in my ~/.vimrc, and there are also similar lines for <>'", but none of them works.
inoremap { {}<ESC>i<left>
inoremap {<CR> {<CR>}<ESC>O
inoremap {{ {
inoremap {} {}
I even deleted all the lines in the .vimrc except these inoremap lines, still no effect, meaning when I hit {, I don't get its pair }. I know there are plugins that may be more powerful, but I don't want my .vimrc to be messy and become unmanageable therefore I'd really like the native features work out for me, as a starting point. After all I don't need very fancy functions at the moment. Helps are appreciated.
By the way, I use FreeBSD, but I don't expect the vim configuration is so much system dependent.
set nocompatible
line at the start of your.vimrc
file?{
, while I think you want it to be inside curly braces. For that, following should do the jobinoremap { {}<ESC>i
:version