set nocompatible
set nu
set expandtab
 
"this will change tab to spaces
set ts=2 
set shiftwidth=2
set expandtab
 
set hlsearch
syntax on
 
"Use TAB to complete when typing words, else inserts TABs as usual.
"Uses dictionary and source files to find matching words to complete.
 
"See help completion for source,
"Note: usual completion is on <C-n> but more trouble to press all the time.
"Never type the same word twice and maybe learn a new spellings!
"Use the Linux dictionary when spelling is in doubt.
"Window users can copy the file to their machine.
function! Tab_Or_Complete()
  if col('.')>1 && strpart( getline('.'), col('.')-2, 3 ) =~ '^\w'
    return "\<C-N>"
  else 
    return "\<Tab>"
  endif
endfunction
:inoremap <Tab> <C-R>=Tab_Or_Complete()<CR>
:set dictionary="/usr/dict/words"
 
set numberwidth=5
set cmdheight=2
"To map: imap ;f foobar => Type f; foobar will be inserted
 
"RSPEC Where ! is execute command. % is the current file
":!rspec %
 
"Map RSPEC test to ,t
":map ,t :w\|!rspec %<cr>