Disabling auto-indentation and auto-comments(//)

1 view
Skip to first unread message

mthread

unread,
Nov 26, 2008, 1:52:21 AM11/26/08
to vim_use
Hi,
I am using vim to write c++ code. How do I disable/enable auto-
indentation and auto-comments(ie it automatically adds '//' when I
move from one line to the other).

Albie

unread,
Nov 26, 2008, 3:24:12 AM11/26/08
to vim...@googlegroups.com

To disable autoindentation, use:
:set noautoindent | set nosmartindent | set nocindent

To re-enable auto indentation, just re-set the type of indent you would
like to use.

To en/disable automatic comment continuation, use:
:set formatoptions-=c

Your indent settings are normally governed by the scripts in your
$VIMRUNTIME/indent , ~/.vim/indent (or, on Windows, ~/vimfiles/indent)
and sometimes by a filetype plugin.

For more info, see
:help C-indenting
:help autoindent
:help smartindent
:help 'formatoptions'
:help fo-table
:help formatting

--

[ Albie Janse van Rensburg ~ http://morph.telspace.co.za ]

A good scapegoat is hard to find.
A guilty conscience is the mother of invention.
-- Carolyn Wells

Reply all
Reply to author
Forward
0 new messages