set t_Co=256
let g:solarized_termcolors=256
"filetype off
call pathogen#infect()
"call pathogen#helptags()
syntax on
"syntax enable

set background=dark
colorscheme solarized

"filetype plugin indent off

set laststatus=2
set number " Line numbering
set hlsearch
set ttimeoutlen=50
set nocompatible " Backwards-compatibility
set ruler " Turn on the ruler (?)

" <Space> clear current highlighting
nnoremap <silent> <Space> :nohlsearch<Bar>:echo<CR>

let g:airline_powerline_fonts=1

let g:indentLine_enabled=1

let g:indent_guides_enable_on_vim_startup=0
let g:indent_guides_guide_size=1
let g:indent_guides_start_level=2

"let g:gitgutter_enabled=1
"let g:gitgutter_signs=0
"let g:gitgutter_sign_column_always=0
"let g:gitgutter_highlight_lines=1

"let g:airline_theme = "bubblegum" " olika diskreta färger i lägen och filändring
"let g:airline_theme = "papercolor" " simpel och tydlig, samma färg i olika lägen, diskret markering för filändring med färg
"let g:airline_theme = "silver" " enkla färger, endast diskret modeline färg vid lägen, filändring endast med +
let g:airline_theme = "sol" " enkla och tydliga färger för olika lägen, tydlig markering för filändring
"let g:airline_theme = "understated" "olika diskreta färger i lägen och filändring

let g:airline#extensions#tabline#enabled = 1
"let g:airline#extensions#tabline#fnamemod = ':t'
let g:airline#extensions#syntastic#enabled = 1
let g:airline#extensions#branch#enabled = 1

"set statusline+=%#warningmsg#
"set statusline+=%{SyntasticStatuslineFlag()}
"set statusline+=%*
"let g:syntastic_alawys_populate_loc_list = 1
"let g:syntastic_auto_loc_list = 1
let g:syntastic_check_on_open = 1
let g:syntastic_check_on_wq = 0
"let g:syntastic_php_checkers = ['php']
"let g:syntastic_php_checkers = ['php', 'phpcs', 'phpmd']
"let g:syntastic_quiet_messages = { "type": "style" }
"let g:syntastic_aggregate_errors = 1
let g:syntastic_css_csslint_args = "--ignore=outline-none,empty-rules,ids,universal-selector"

"augroup VimCSS3Syntax
"	autocmd!
"	autocmd FileType css setlocal iskeyword+=-
"augroup END

"let g:css_fast_sync=1
"syn sync maxlines=200

"highlight ExtraWhitespace ctermbg=red guibg=red
"match ExtraWhitespace /\s\+$/
"autocmd BufWinEnter * match ExtraWhitespace /\s\+$/
"autocmd InsertEnter * match ExtraWhitespace /\s\+\%#\@<!$/
"autocmd InsertLeave * match ExtraWhitespace /\s\+$/
autocmd BufWinLeave * call clearmatches()
autocmd BufEnter * :syntax sync fromstart

"set fileformats=unix
"autocmd Syntax * syn match ExtraWhitespace /\s\+$| \+\ze\t/

" Append modeline after last line in buffer.
" Use substitute() instead of printf() to handle '%%s' modeline in LaTeX
" files.
function! AppendModeline()
	let l:modeline = printf(" vim: set ts=%d sw=%d sts=%d tw=%d %set :",
		\ &tabstop, &shiftwidth, &softtabstop, &textwidth, &expandtab ? '' : 'no')
	let l:modeline = substitute(&commentstring, "%s", l:modeline, "")
	call append(line("$"), l:modeline)
nnoremap <silent> <Leader>ml :call AppendModeline()<CR>

" vim: set ts=4 sw=4 sts=4 tw=0 et ft=vim