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 :o. Lets hope acid won't see this :D. |
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)... |
Thanks, It worked.
--Sarin |
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 |
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.
|
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. |
Since it hasn't been said in the last 15 years:
Code:
autocmd filetype=make setlocal noexpandtab |
All times are GMT -5. The time now is 11:19 PM. |