" Vim configuration file for Mark Groen

filetype plugin indent on
set nocompatible  " No legacy vi support

""
"" Terminal settings
""
set encoding=utf-8

""
"" Search settings
""
if executable("rg")
    set grepprg=rg\ --vimgrep\ --no-heading\ --smart-case  "Set ripgrep as search engine
    set grepformat=%f:%l:%c:%m,%f:%l:%m
endif
set hlsearch  " Highlight search results
set incsearch  " Set incremental search
set ignorecase  " Case insensitive search by default ..
set smartcase  " .. but case sensitive when upper case is used
set path+=**  " Also search files in sub-directories

""
"" File format
""
set fileencodings=ucs-bom,utf-8,cp1250
set fileformats=dos,unix  " Set file line ending preference


""
"" Visual settings
""
set showbreak=>>>
set background=light
colorscheme clear-water

syntax on  " Show syntax highlighting
set cursorline
set number relativenumber
set colorcolumn=72,80,120


""
"" Behaviour settings
""
set wildmenu
set spelllang=en_gb  " By default use UK English for spell checking
set nospell  " Do not spell check by default. Switch on based on file type.
set scrolloff=4  " Keep context on screen during scrolling.

""
"" Key mappings
""

" Show highlight group under cursor
map <F11> :echo "hi<" . synIDattr(synID(line("."),col("."),1),"name") . '> trans<'
    \ . synIDattr(synID(line("."),col("."),0),"name") . "> lo<"
    \ . synIDattr(synIDtrans(synID(line("."),col("."),1)),"name") . ">"<CR>

""
"" Plugins
""

" Lightline
set laststatus=2  " Always show status line


" Riv
let g:lightline = {
      \ 'colorscheme': 'wombat',
      \ 'separator': {'left': "\ue0b0", 'right': "\ue0b2"},
      \ 'subseparator': {'left': "\ue0b1", 'right': "\ue0b3"},
      \ 'component': {'lineinfo': "\ue0a1 %3l:%-2v"}
      \ }

" Signify
set updatetime=250

" UltiSnips
let g:UltiSnipsExpandTrigger = '<c-space>'
let g:UltiSnipsListSnippets = '<c-s-space>'
" let g:UltiSnipsSnippetDirectories=["UltiSnips"]

" vim-skeletons
let skeletons#autoRegister = 1
let skeletons#skeletonsDir = "~/vimfiles/skeletons"

" vim-riv
let g:riv_web_browser = 'start'
highlight rstEmphasis       ctermfg=13
highlight rstFileLink       ctermfg=3   ctermbg=15  cterm=NONE
