LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Debian
User Name
Password
Debian This forum is for the discussion of Debian Linux.

Notices


Reply
  Search this Thread
Old 11-16-2006, 07:15 AM   #1
introuble
Member
 
Registered: Apr 2004
Distribution: Debian -unstable
Posts: 700

Rep: Reputation: 31
VIM set autoindent -- not working from config file


In /etc/vim/vimrc I have added: "set autoindent".
This doesn't turn autoindenting on.

In ~/.vimrc I have added: "set autoindent".
This doesn't turn autoindenting on.

If, whilst I'm in VIM, I type: ":set ai", it turns autoindent on.

Any ideas why it doesn't work when I specify it in the config. files?
 
Old 11-16-2006, 09:55 AM   #2
tronayne
Senior Member
 
Registered: Oct 2003
Location: Northeastern Michigan, where Carhartt is a Designer Label
Distribution: Slackware 32- & 64-bit Stable
Posts: 3,541

Rep: Reputation: 1065Reputation: 1065Reputation: 1065Reputation: 1065Reputation: 1065Reputation: 1065Reputation: 1065Reputation: 1065
Here's an alternative (that'll work with every vi, real or clone).

In you home directory, create a file .exrc with this content:
Code:
set autoindent showmode showmatch
Log out, log back in, and there you go.

You may not like showmode (it just displays the mode you're in; e.g., "open"), but you will like showmatch -- anytime you type an open paren, brace, or bracket when you type the closing paren, brace, or bracket the cursor will jump to show you the match; handy, that. And, of course, autoindent does what you want it to.
 
Old 11-16-2006, 12:55 PM   #3
introuble
Member
 
Registered: Apr 2004
Distribution: Debian -unstable
Posts: 700

Original Poster
Rep: Reputation: 31
Doesn't work. Could someone post a vimrc file?
 
Old 11-16-2006, 01:13 PM   #4
fordeck
Member
 
Registered: Oct 2006
Location: Utah
Posts: 520

Rep: Reputation: 61
On a FC 3 machine you could find the following file.

/usr/share/vim/vim63/vimrc_example.vim

and copy it to ~/.vimrc or just cut and paste the options you like. However I find that it provides alot of functionality one of which is setting your autoindent.

Note:
The file may be in a different directory on your system. But you could find with the following command:

Code:
find / -iname '*vimrc*' 2>/dev/null
Also here is a link that I find to be a great reference when it comes to VI.

Last edited by fordeck; 11-16-2006 at 01:18 PM.
 
Old 11-16-2006, 01:26 PM   #5
slakmagik
Senior Member
 
Registered: Feb 2003
Distribution: Slackware
Posts: 4,113

Rep: Reputation: Disabled
You could also try ':verbose set ai?' to see if something's overriding you. If you have filetypes enabled, they may be doing something weird, for instance.
 
Old 11-17-2006, 07:08 AM   #6
introuble
Member
 
Registered: Apr 2004
Distribution: Debian -unstable
Posts: 700

Original Poster
Rep: Reputation: 31
I reverted back to original debian config files and it's working now [didn't have to specify "set ai" :-/]
 
  


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
which config file to set: this name <=> this ip kloss Linux - Networking 2 04-23-2006 02:23 PM
How to set TAB to 4 spaces in vim? kornerr Linux - General 2 01-05-2006 01:26 AM
VIM Config problems djgerbavore Slackware 5 05-05-2005 09:18 AM
Which config file do I set the hostname in (RH9)? anachron Linux - Newbie 8 06-02-2004 07:48 PM
a working default config file for 2.6 demmylls Linux - General 9 12-25-2003 11:45 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Debian

All times are GMT -5. The time now is 09:22 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