Showing posts with label spaces. Show all posts
Showing posts with label spaces. Show all posts

Wednesday, October 8, 2008

Eclipse - Tabs to Spaces only

  • Window menu → Preferences...
  • Java → Code Style → Formatter → New... button
    • Enter any name → OK
  • Indentation tab → Under General settings, set Tab policy to Spaces only

Wednesday, April 18, 2007

VIM - Inserting spaces instead of tabs

Insert spaces instead of tabs

set expandtab or set et

Set the width of shifts to 4 for autoindenting and shifting: >> and <<

set shiftwidth=4 or set sw=4

Set where to stop tabs to 4

set tabstop=4 or set ts=4


This is what I have in my ~/.vimrc:

Set expanded tabs with shiftwidth=4 and tabstop=4 for Java, Perl, C, and C++ files

autocmd BufNewFile,BufRead *.java,*.pl,*.c,*.h,*.cc,*.cpp,*.hpp set sw=4 ts=4 et