set complete=k

inoremap <Tab> <C-n>

nnoremap <Tab> <C-w>w
nnoremap <S-Tab> <C-w>W
inoremap <Tab> <Esc><C-w>wi
inoremap <S-Tab> <Tab>
nnoremap <Up> <C-w>k
inoremap <Up> <Esc><C-w>ki
nnoremap <Down> <C-w>j
inoremap <Down> <Esc><C-w>ji

autocmd BufRead tags inoremap <buffer> <Tab> <C-n>
autocmd BufRead tags inoremap <buffer> <CR> <C-y>
autocmd BufRead tags inoremap <buffer> <expr> j pumvisible() ? '<C-n>' : 'j'
autocmd BufRead tags inoremap <buffer> <expr> k pumvisible() ? '<C-p>' : 'k'

nnoremap <CR> :xa<CR>

set shortmess+=F

" colorscheme is green (2) on black (16)
hi StatusLine cterm=none
hi StatusLine ctermbg=16
hi StatusLine ctermfg=1
hi StatusLineNC cterm=none
hi StatusLineNC ctermbg=16
hi StatusLineNC ctermfg=2

fun! VincaStatus(filename)
	" The command
	" set statusline=%{VincaStatus(expand(\"\%:t:r\"))}
	" will apply this format
	" Create a status which looks like ----- filename ------ "
	let line = "  " . a:filename . "  "
	while strlen(line) < winwidth(0) - 1
		let line = "-" . line . "-"
	endwhile	
	if strlen(line) == winwidth(0) - 1
		let line = line . "-"
	endif
	return line
endfun
set statusline=%{VincaStatus(expand(\"\%:t:r\"))}

" hide the blue tildes which are normally seen at the end of each file
set fillchars=eob:\ ,
