LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
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-25-2008, 08:53 AM   #1
LinuxNewbie999
Member
 
Registered: Oct 2006
Distribution: FreeBSD
Posts: 162

Rep: Reputation: 30
vim talk.


How do i set vim default to have ":set nu"(line numbers) and shape the C program file in proper look?
 
Old 03-25-2008, 09:11 AM   #2
jschiwal
LQ Guru
 
Registered: Aug 2001
Location: Fargo, ND
Distribution: SuSE AMD64
Posts: 15,733

Rep: Reputation: 682Reputation: 682Reputation: 682Reputation: 682Reputation: 682Reputation: 682
Look at "locate vimrc". There should be a sample vimrc file that you can copy to ~/.vimrc. This setting will recognize a .c file and set the indentation appropriately. Edit the file to add the :set nu.

You could also edit the c.vim file to add the 'nu' option.
 
Old 03-25-2008, 08:22 PM   #3
LinuxNewbie999
Member
 
Registered: Oct 2006
Distribution: FreeBSD
Posts: 162

Original Poster
Rep: Reputation: 30
I think need more time to study that file.....It's complicating
 
Old 03-26-2008, 12:26 AM   #4
jschiwal
LQ Guru
 
Registered: Aug 2001
Location: Fargo, ND
Distribution: SuSE AMD64
Posts: 15,733

Rep: Reputation: 682Reputation: 682Reputation: 682Reputation: 682Reputation: 682Reputation: 682
One of the recent LXer posts on this site had a link to a "dotfiles" site that has a collection of useful .dot file including vim files. Look in the Syndication forum. They might be useful.

Simply copying the .vimrc_sample file to ~/.vimrc will give you everything you want except for setting the :nu option. There is a subdirectory that contains names like bash.vim, c.vim, etc. This is the file that the .vimrc file includes if vim detects a C source file.
You could (make a backup first) edit that file to make the change system wide for C source files.
 
Old 03-26-2008, 01:13 AM   #5
ak_random
Member
 
Registered: Jun 2007
Location: Silicon Valley, CA
Distribution: Xubuntu
Posts: 83

Rep: Reputation: 15
Of course, if you haven't already, you should take a look at the
Vim documentation -- yes, it actually has documentation! To get to it, enter ":help" after you've started Vim. Of course, there's tons more, and even in user-friendly formatting, if you follow the link that says "Documentation" (gasp!) from Vim's web site.
 
  


Reply



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
encryption with Vim (vim -x) mikshaw Linux - Software 2 03-07-2007 09:00 AM
LXer: Vim tips: Using Vim mappings and abbreviations LXer Syndicated Linux News 0 06-18-2006 01:54 PM
LXer: Cream for Vim - Making Vim more user friendly LXer Syndicated Linux News 0 06-17-2006 11:54 PM
talk talk daemon configuration ananthkrk Red Hat 1 10-16-2004 11:45 AM
why cannot "talk" to others,since mesg is yes and disable = no(in /etc/xinetd.c/talk) whepin Linux - Newbie 0 12-31-2001 02:04 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 04:06 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
Open Source Consulting | Domain Registration