kernelnewbies.kernelnewbies.org archive mirror
 help / color / mirror / Atom feed
* Query on CodingStyle: indentation
@ 2012-10-19  5:31 Kumar amit mehta
  2012-10-19  7:03 ` Adam Lee
  0 siblings, 1 reply; 5+ messages in thread
From: Kumar amit mehta @ 2012-10-19  5:31 UTC (permalink / raw)
  To: kernelnewbies

Hi,

I've a query regarding the coding style for Linux Kernel code. I'm
reading the CodingStyle under Documentation and what I've understood is
that I shouldn't be using spaces for indentation purposes and should use
tabs of width 8 characters. Quoting from the same document: 
"Outside of comments, documentation and except in Kconfig, spaces are
never used for indentation, and the above example is deliberately broken."
However, Is it correct to replace each tab stroke by 8 spaces ? I use vim
editor and I've put following under $HOME/.vimrc file:
<snip>
set tabstop=8
set shiftwidth=8 
set expandtab
<snip>

In past I've seen that some application have different interpretation of
tabs and hence sometimes even If I've done proper indentation using tab,
the code appears unindented, and therefore In order to make sure that I'm
moving 8 characters upon hitting tab, I've put the above rules under my
.vimrc file. Please let me know If I should remove these from my .vimrc
file and rely on tab instead.

-Amit

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

end of thread, other threads:[~2012-10-22  4:36 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-10-19  5:31 Query on CodingStyle: indentation Kumar amit mehta
2012-10-19  7:03 ` Adam Lee
2012-10-19  9:00   ` Kumar amit mehta
2012-10-19 15:40     ` Greg Freemyer
2012-10-22  4:36       ` Kumar amit mehta

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).