"  REPL
let g:repl = {}
let g:repl['scheme'] = {
  \ 'bin': 'guile',
  \ 'args': ['-L', '.'],
  \ 'syntax': 'scheme',
  \ 'title': 'Scheme REPL'}

" ALE
let g:ale_r_lintr_options = "lintr::with_defaults(absolute_paths_linter, assignment_linter, closed_curly_linter, commas_linter, infix_spaces_linter, no_tab_linter, snake_case_linter = NULL, multiple_dots_linter, spaces_inside_linter, spaces_left_parentheses_linter, trailing_blank_lines_linter, trailing_whitespace_linter, open_curly_linter = NULL, camel_case_linter = NULL, single_quotes_linter = NULL, commented_code_linter, line_length_linter = NULL, object_length_linter = NULL)"

" elm
let g:elm_make_output_file = "index.html"
let g:elm_make_show_warnings = 1
let g:elm_format_autosave = 1
let g:elm_format_fail_silently = 1
let g:elm_jump_to_error = 0
let g:elm_setup_keybindings = 0
let g:elm_detailed_complete = 1
let g:elm_browser_command = "qutebrowser"

" vim-pandoc
let g:pandoc#filetypes#handled = ["markdown"]
let g:pandoc#modules#enabled = ["bibliographies", "toc", "completion"]
let g:pandoc#biblio#use_bibtool = 1

" 고요 and Limelight
let g:goyo_width = 100
let g:goyo_height = 95

" Nvim-R
let R_rconsole_height = 25
let R_nvimpager="vertical"
let R_args_in_stline = 1
let r_syntax_folding = 0
let R_rconsole_width = 0
let R_close_term = 1
let R_assign = 3
let R_objbr_opendf = 0
let R_start_libs = 'base,stats,graphics,grDevices,utils,methods,dplyr,tidyr,ggplot2,stringr,forcats,lubridate,purrr'

" easymotion
let g:EasyMotion_smartcase = 1
let g:EasyMotion_keys = 'auiecmtsrn'
let g:EasyMotion_use_upper = 1

" Autopairs
let g:AutoPairsMultilineClose = 0

" vim-airline options
set noshowmode
let g:airline_powerline_fonts=1

" vim-workspace
let g:workspace_powerline_separators = 1
let g:workspace_tab_icon = "#"
function! g:WorkspaceSetCustomColors()
  hi! WorkspaceBufferTruncDefault cterm=bold ctermbg=10 ctermfg=8 guibg=#999999 guifg=#000000
  hi! WorkspaceIconDefault cterm=NONE ctermbg=5 ctermfg=10 guibg=#FF0000 guifg=#999999

  highlight WorkspaceBufferCurrent ctermbg=green ctermfg=black guibg=green
  highlight WorkspaceBufferActive ctermbg=darkgreen ctermfg=black guibg=darkgreen
  highlight WorkspaceBufferHidden ctermbg=black ctermfg=white guibg=black
  highlight WorkspaceTabHidden ctermbg=darkblue ctermfg=black guibg=darkblue
  highlight WorkspaceTabCurrent ctermbg=blue ctermfg=white guibg=black
  highlight WorkspaceFill ctermbg=black ctermfg=white guibg=black
endfunction

function! s:goyo_enter()
  highlight EndOfBuffer ctermbg=NONE
  Limelight
endfunction

function! s:goyo_leave()
  highlight Comment cterm=italic
  highlight List ctermbg=NONE ctermfg=darkred guibg=gray

  highlight EndOfBuffer ctermbg=235
  highlight Search cterm=bold,underline ctermfg=NONE ctermbg=NONE
  highlight MatchParen ctermbg = 11

  Limelight!
endfunction

augroup Goyo
  autocmd!

  autocmd! User GoyoEnter nested call <SID>goyo_enter()
  autocmd! User GoyoLeave nested call <SID>goyo_leave()
augroup END

" vimwiki
let g:vimwiki_folding='expr:quick'
let g:vimwiki_list = [{'path': '~/Private/vimwiki/',
                    \  'template_path': '~/Private/vimwiki/templates/',
                    \  'template_default': 'default',
                    \  'template_ext': '.tpl',
                    \  'ext': '.wiki',
                    \  'path_html': '~/Private/vimwiki/html/'},
                    \ {'path': '~/Projects/z_Perso/website/content/page/',
                    \  'index': 'pages',
                    \  'syntax': 'markdown',
                    \  'ext': '.md'}]

" Tagbar
let g:tagbar_foldlevel=0
let g:tagbar_autoshowtag=1
let g:tagbar_iconchars = ['▸', '▾']
let g:tagbar_autofocus=1
let g:tagbar_compact=1
let g:tagbar_width=40

let g:tagbar_type_elm = {
          \   'ctagstype':'elm'
          \ , 'kinds':['h:header', 'i:import', 't:type', 'f:function', 'e:exposing']
          \ , 'sro':'&&&'
          \ , 'kind2scope':{ 'h':'header', 'i':'import'}
          \ , 'sort':0
          \ , 'ctagsbin':'~/.config/nvim/gentags/elmtags.py'
          \ , 'ctagsargs': ''
          \ }

let g:tagbar_type_vimwiki = {
          \   'ctagstype':'vimwiki'
          \ , 'kinds':['h:header']
          \ , 'sro':'&&&'
          \ , 'kind2scope':{'h':'header'}
          \ , 'sort':0
          \ , 'ctagsbin':'~/.config/nvim/gentags/vwtags.py'
          \ , 'ctagsargs': 'default'
          \ }

let g:tagbar_type_rmd = {
          \   'ctagstype':'rmd'
          \ , 'kinds':['h:header', 'c:chunk', 'f:function']
          \ , 'sro':'&&&'
          \ , 'kind2scope':{'h':'header', 'c':'chunk'}
          \ , 'sort':0
          \ , 'ctagsbin':'~/.config/nvim/gentags/rmdtags.py'
          \ , 'ctagsargs': ''
          \ }

let g:tagbar_type_r = {
    \ 'ctagstype' : 'r',
    \ 'kinds'     : [
        \ 'f:Functions',
        \ 'g:GlobalVariables',
        \ 'v:FunctionVariables',
    \ ]
\ }

augroup Tagbar
  autocmd!

  autocmd! FileType vimwiki nested :TagbarOpen
augroup END
