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 - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Closed Thread
  Search this Thread
Old 01-07-2012, 01:46 AM   #1
temp2012temp
LQ Newbie
 
Registered: Jan 2012
Posts: 11

Rep: Reputation: Disabled
How can I avoid expanding tab into sapces when editing makefile.


After googling,I get to know that if I add
filetype plugin on
into my vimrc,vim will verify different file type.

I search $VIMRUNTIME/filetype.vim and found out:
" Makefile
au BufNewFile,BufRead *[mM]akefile,*.mk,*.mak,*.dsp setf make

Then I looked into $VIMRUNTIME/ftplugin/make.vim and found out:
" Make sure a hard TAB is used, required for most make programs
setlocal noexpandtab softtabstop=0

In coclusion, when editing makefile,vim should not expand tab.But it did.I don't know why. All I want is to avoid expanding tab into sapces when editing makefile.
Any help will be appreciated!


Here is my vimrc:

set nocompatible
syntax on
set expandtab
set tabstop=4
set shiftwidth=4
set autoindent
set cindent
set nu
set diffexpr=MyDiff()
set nobackup
filetype plugin on
 
Old 01-07-2012, 02:47 AM   #2
colucix
LQ Guru
 
Registered: Sep 2003
Location: Bologna
Distribution: CentOS 6.5 OpenSuSE 12.3
Posts: 10,509

Rep: Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983
Please post your thread in only one forum. Posting a single thread in the most relevant forum will make it easier for members to help you and will keep the discussion in one place. This thread is being closed because it is a duplicate. Please continue here: http://www.linuxquestions.org/questi...efiles-922519/
 
  


Closed Thread



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
[SOLVED] how to avoid using expandtab in vim when editing makefile temp2012temp Linux - Newbie 3 01-07-2012 02:45 AM
LXer: Avoid latency while editing remote files using bcvi LXer Syndicated Linux News 0 07-11-2008 11:11 PM
Help on editing perl script to avoid file names with colon (:) stelmed Programming 2 12-12-2006 05:17 PM
editing a makefile scotoma Linux - Newbie 2 10-03-2004 01:50 PM
editing makefile ahjamm Linux - Software 2 10-25-2003 11:59 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 09:32 AM.

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