LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 03-29-2006, 09:27 AM   #1
EAD
Member
 
Registered: Mar 2006
Distribution: ARCH linux
Posts: 137

Rep: Reputation: 15
Question A little vim question


Hii, How can I make vim to add parenthesis ?
I mean when I write
Code:
(
I want it to auto be
Code:
()
and so on for {} and []
 
Old 03-29-2006, 10:54 AM   #2
druuna
LQ Veteran
 
Registered: Sep 2003
Posts: 10,532
Blog Entries: 7

Rep: Reputation: 2389Reputation: 2389Reputation: 2389Reputation: 2389Reputation: 2389Reputation: 2389Reputation: 2389Reputation: 2389Reputation: 2389Reputation: 2389Reputation: 2389
Hi,

You can use abbreviations (ab) for that.

Something like this: ab ( () will print the closing ) once you hit a non-alphanumeric key (space, return, esc).

Put these in your .vimrc (or /etc/vimrc if you want it globally):
ab ( ()
ab [ []
an { {}


For details type 'help abbreviation' in command mode.

Hope this helps.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Vim newbie question EAD Linux - Newbie 1 03-27-2006 06:01 PM
vim and vi editing question penguin_powered Programming 5 07-24-2005 05:43 PM
vim question blackzone Linux - Newbie 2 09-10-2004 10:04 AM
Question about VIM configuration ICO Linux - General 4 01-06-2004 07:41 PM
vi/vim question kiley_rodgers Slackware 1 06-18-2003 09:15 AM


All times are GMT -5. The time now is 10:02 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration