How to get a Closing Brace in VIM or VI

Just add the following line to ~/.vimrc

inoremap { {<CR><BS>}<Esc>ko

Now my ~/.vimrc looks like this:

sh-4.2$ cat ~/.vimrc
"*CODING STYLE STUFF

"**Tab And Indenting Stuff:
"***these 3 tab tips always go together
set expandtab
set shiftwidth=2
set tabstop=2
"***and this makes the tabs work more intuitively:
set smarttab

"***indent automatically
set ai "Auto indent
set si "Smart indet

"**Vim By Default Does Not Highlight Java/C++ Syntax:
"syntax on
inoremap { {<CR><BS>}<Esc>ko

sh-4.2$

Advertisements

About SunKing2

Former web developer, guitar player, started Piano 2012 -yes still doing it! Recovery, sobriety, mental health advocate.
This entry was posted in Uncategorized. Bookmark the permalink.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s