public inbox for gentoo-user@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-user] [OT] vim c syntax
@ 2006-04-13 15:41 Dan LaMotte
  0 siblings, 0 replies; 3+ messages in thread
From: Dan LaMotte @ 2006-04-13 15:41 UTC (permalink / raw
  To: gentoo-user

really simple problem, but quite annoying.

% vim --version
VIM - Vi IMproved 6.4 (2005 Oct 15, compiled Jan 12 2006 12:36:23)

i am editing a C file and this is the problem i'm having:

in vim i have   set ts=4   to make my tabs 4 spaces instead of 8. I
really dislike 8 spaces for tabs. anyways...

i type in vim

void main ( void )
{<enter>
	int c;

The <enter> autoindent indents it 8 spaces ?!?
my tabstop is 4 though !

I want this

void main ( void )
{<enter>
    int c;

If anyone knows how to fix this or if its like a bug or something...
that'd be great.

thanks.

-- 
# - dan lamotte -            - lamotte {at} cs.umn.edu - #####
## - systems staff -      - uofm -      - cs department - ####
### fpr: 690F C162 4AE5 F85F FE94 88E5 D123 FBAC 0852 A280 ###
-- 
gentoo-user@gentoo.org mailing list



^ permalink raw reply	[flat|nested] 3+ messages in thread

* [gentoo-user] [OT] vim c syntax
@ 2006-04-13 15:42 Dan LaMotte
  2006-04-13 16:01 ` Kevin O'Gorman
  0 siblings, 1 reply; 3+ messages in thread
From: Dan LaMotte @ 2006-04-13 15:42 UTC (permalink / raw
  To: gentoo-user

really simple problem, but quite annoying.

% vim --version
VIM - Vi IMproved 6.4 (2005 Oct 15, compiled Jan 12 2006 12:36:23)

i am editing a C file and this is the problem i'm having:

in vim i have   set ts=4   to make my tabs 4 spaces instead of 8. I
really dislike 8 spaces for tabs. anyways...

i type in vim

void main ( void )
{<enter>
	int c;

The <enter> autoindent indents it 8 spaces ?!?
my tabstop is 4 though !

I want this

void main ( void )
{<enter>
    int c;

If anyone knows how to fix this or if its like a bug or something...
that'd be great.

thanks.

-- 
# - dan lamotte -            - lamotte {at} cs.umn.edu - #####
## - systems staff -      - uofm -      - cs department - ####
### fpr: 690F C162 4AE5 F85F FE94 88E5 D123 FBAC 0852 A280 ###

-- 
gentoo-user@gentoo.org mailing list



^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [gentoo-user] [OT] vim c syntax
  2006-04-13 15:42 Dan LaMotte
@ 2006-04-13 16:01 ` Kevin O'Gorman
  0 siblings, 0 replies; 3+ messages in thread
From: Kevin O'Gorman @ 2006-04-13 16:01 UTC (permalink / raw
  To: gentoo-user

[-- Attachment #1: Type: text/plain, Size: 1466 bytes --]

You probably want something like this in your .vimrc:

set expandtab
set tabstop=8           " ts, number of spaces that a tab *in the original
file* is
                                 "    equivalent to
set softtabstop=4     " how much a tab *that you type* is worth
set shiftwidth=4        " sw, number of spaces shifted left and right when
issuing
                                 "  commands
set autoindent
set smartindent

YMMV

++ kevin

On 4/13/06, Dan LaMotte <lamotte@cs.umn.edu> wrote:
>
> really simple problem, but quite annoying.
>
> % vim --version
> VIM - Vi IMproved 6.4 (2005 Oct 15, compiled Jan 12 2006 12:36:23)
>
> i am editing a C file and this is the problem i'm having:
>
> in vim i have   set ts=4   to make my tabs 4 spaces instead of 8. I
> really dislike 8 spaces for tabs. anyways...
>
> i type in vim
>
> void main ( void )
> {<enter>
>         int c;
>
> The <enter> autoindent indents it 8 spaces ?!?
> my tabstop is 4 though !
>
> I want this
>
> void main ( void )
> {<enter>
>     int c;
>
> If anyone knows how to fix this or if its like a bug or something...
> that'd be great.
>
> thanks.
>
> --
> # - dan lamotte -            - lamotte {at} cs.umn.edu - #####
> ## - systems staff -      - uofm -      - cs department - ####
> ### fpr: 690F C162 4AE5 F85F FE94 88E5 D123 FBAC 0852 A280 ###
>
> --
> gentoo-user@gentoo.org mailing list
>
>


--
Kevin O'Gorman, PhD

[-- Attachment #2: Type: text/html, Size: 2575 bytes --]

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2006-04-13 16:07 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-04-13 15:41 [gentoo-user] [OT] vim c syntax Dan LaMotte
  -- strict thread matches above, loose matches on Subject: below --
2006-04-13 15:42 Dan LaMotte
2006-04-13 16:01 ` Kevin O'Gorman

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox