Here are some good tutorials to popular command line editors that can be used through a text console. All of these can be installed on Raspbian (if they are not already installed).
Configure for spaces instead of tabs and 4 space indentation. Put the following in ~/.vimrc
" tabstop: Width of tab character " softtabstop: Fine tunes the amount of white space to be added " shiftwidth Determines the amount of whitespace to add in normal mode " expandtab: When on uses space instead of tabs set tabstop=4 set softtabstop=4 set shiftwidth=4 set expandtab