LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 09-20-2002, 07:08 AM   #1
sarin
Member
 
Registered: May 2001
Location: India, Kerala, Thrissur
Distribution: FC 7-10
Posts: 354
Blog Entries: 2

Rep: Reputation: 34
Vim not putting tabs in Makefile


Hi,

I was making a small Makefile and I got this error.

Makefile:14: *** missing separator. Stop.

I tried all that I knew and finally found that a tab was put as some spaces by vim. I opened it in pico and inserted a tab and eveything worked fine. Does anyone know how to tell vim to put a tab and not that many spaces?

--Sarin

PS: On a second thought, this should have gone to software or general section . Lets hope acid won't see this .

Last edited by sarin; 09-20-2002 at 07:28 AM.
 
Click here to see the post LQ members have rated as the most helpful post in this thread.
Old 09-20-2002, 10:16 AM   #2
unSpawn
Moderator
 
Registered: May 2001
Posts: 29,415
Blog Entries: 55

Rep: Reputation: 3594Reputation: 3594Reputation: 3594Reputation: 3594Reputation: 3594Reputation: 3594Reputation: 3594Reputation: 3594Reputation: 3594Reputation: 3594Reputation: 3594
If I'm right it's "noexpandtab" or "et" (in vim type ":help et").
In your ~/.vimrc or other resource, add line (w/o quotes):
"set noexpandtab". Don't forget to source it or make an alias or script for it like:alias vim='vim -s<resource> $@'.

I'd say this definately is programming related, tho everyone should benefit from getting to know Vi (better)...
 
1 members found this post helpful.
Old 09-21-2002, 12:37 AM   #3
sarin
Member
 
Registered: May 2001
Location: India, Kerala, Thrissur
Distribution: FC 7-10
Posts: 354

Original Poster
Blog Entries: 2

Rep: Reputation: 34
Thanks, It worked.
--Sarin
 
Old 11-18-2011, 08:38 AM   #4
tarkalak
LQ Newbie
 
Registered: Nov 2011
Posts: 1

Rep: Reputation: Disabled
ather way

Add this to .vimrc
It will tell vim to not expand tabs for make regardless of your tab settings.

"This is for setting Makefiles with tabs not spaces
autocmd FileType make setlocal noexpandtab
 
2 members found this post helpful.
Old 01-14-2018, 11:36 PM   #5
zeozod
LQ Newbie
 
Registered: Jan 2018
Posts: 1

Rep: Reputation: Disabled
a better way

Rather than changing settings around for makefiles, you can always set vim to expandtabs, but then use a <C-v><C-i> whenever you really want to insert a tab, like when writing makefile rules.
 
Old 01-14-2018, 11:59 PM   #6
astrogeek
Moderator
 
Registered: Oct 2008
Distribution: Slackware [64]-X.{0|1|2|37|-current} ::12<=X<=14, FreeBSD_12{.0|.1}
Posts: 5,581
Blog Entries: 11

Rep: Reputation: 3596Reputation: 3596Reputation: 3596Reputation: 3596Reputation: 3596Reputation: 3596Reputation: 3596Reputation: 3596Reputation: 3596Reputation: 3596Reputation: 3596
Welcome to LQ zeozod.

You have replied to a 15 year old thread, which was last replied 7 years ago.

While your post may be relevant, it is preferred that you open your own threads for your own questions to assure that the details are current and specific to your own issues, and to attract the attention of currently active members.

Please review the Site FAQ for guidance in posting your questions and general forum usage.
 
Old 01-15-2018, 12:58 PM   #7
dugan
LQ Guru
 
Registered: Nov 2003
Location: Canada
Distribution: distro hopper
Posts: 9,985

Rep: Reputation: 4568Reputation: 4568Reputation: 4568Reputation: 4568Reputation: 4568Reputation: 4568Reputation: 4568Reputation: 4568Reputation: 4568Reputation: 4568Reputation: 4568
Since it hasn't been said in the last 15 years:

Code:
autocmd filetype=make setlocal noexpandtab
 
  


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
encryption with Vim (vim -x) mikshaw Linux - Software 2 03-07-2007 09:00 AM
How to modify makefile.in or makefile.am QiangWan Linux - Newbie 1 05-17-2005 11:07 AM
how to get (makefile -f makefile )output into the textview widget in Pygtk sailu_mvn Programming 3 02-28-2005 03:57 AM
vim and makefile melinda_sayang Linux - General 7 06-10-2004 12:16 AM
generate Makefile from Makefile.in without calling ./configure ? chris78 Programming 2 05-02-2004 12:23 PM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

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