[oclug] spaces and tabs

Michael P. Soulier msoulier at digitaltorque.ca
Wed Jun 18 09:24:21 EDT 2003


On 18/06/03 Patrick Smith did speaketh:

> Unfortunately, this has one main drawback:  makefiles, where the 
> space/tab distinction is important.  Assuming you have "set expandtab" 
> in your .vimrc, when editing a makefile you can either manually ":set 
> noet" or type control-v, tab to get a real tab character.
> 
> (It's almost certainly possible to get vim to automatically turn off
> expandtab when editing makefiles.  Personally, I've never gotten around 
> to it.)

    For Vim 6+

    mkdir -p $HOME/.vim/ftplugin
    echo "setlocal noet" > $HOME/.vim/ftplugin/make

    And add these to your .vimrc file

" Turn on filetype support. 
filetype on
" Turn on filetype plugins.
filetype plugin on

    Automatic indentation, btw, is controlled via this setting, so turn
it off or on as you please. 

" Turn on filetype indenting by default. 
filetype indent on

    If you're not using Vim 6+, this can be done with an autocommand.

    Mike

-- 
Michael P. Soulier <msoulier at digitaltorque.ca>, GnuPG pub key: 5BC8BE08
"...the word HACK is used as a verb to indicate a massive amount
of nerd-like effort."  -Harley Hahn, A Student's Guide to Unix
IM: msoulier at jabber.org
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
Url : http://tux.oclug.on.ca/pipermail/oclug/attachments/20030618/1440bb97/attachment.bin


More information about the OCLUG mailing list