<commit_before>" source vim_ide_status from the environment
" Ex: export vim_ide_status="ycm rust cpp"
" don't forget to 'pip install neovim'
let vim_ide_status=$vim_ide_status

if has("nvim")

    " This requires Python. Use the system Python for nvim
    " Hope mac has python3 somewhere
    " /usr/bin/python3 -m pip install neovim jedi mistune psutil setproctitle flake8
    " Tested on:
    " - Ubuntu
    " So, this works, but I don't get docstrings this way
    " Mac doesn't have /usr/bin/python3
    if has("mac")
        " Now it depends on anaconda...
        let g:python3_host_prog = expand('~/anaconda3/bin/python3')
    else
        let g:python3_host_prog = '/usr/bin/python3'
    endif
    Plug 'roxma/nvim-completion-manager'
    " Add preview to see docstrings in the complete window.
    let g:cm_completeopt = 'menu,menuone,noinsert,noselect,preview'

    " Close the prevew window automatically on InsertLeave
    " https://github.com/davidhalter/jedi-vim/blob/eba90e615d73020365d43495fca349e5a2d4f995/ftplugin/python/jedi.vim#L44
    augroup ncm_preview
        autocmd! InsertLeave <buffer> if pumvisible() == 0|pclose|endif
    augroup END

    inoremap <expr> <Tab> pumvisible() ? "\<C-n>" : "\<Tab>"
    inoremap <expr> <S-Tab> pumvisible() ? "\<C-p>" : "\<S-Tab>"

    " Use :ll to go to the first error
    Plug 'neomake/neomake'
    let g:neomake_open_list = 0
    let g:neomake_echo_current_error = 1
    let g:neomake_list_height = 5

    " 0 : Errors only
    " 1 : Quiet message (default)
    let g:neomake_verbose = 0

    " E501: line length
    " W503: line break before binary operator
    let flake8_ignore = '--ignore=E501,W503'

    " When experimenting, I don't want to deal with a bunch of this...
    if !empty($vim_flake8_lax_mode)
        let flake8_ignore .= ',E302,E301,E261,W391,F401,E402,E731,E226,F841,E303,E225'
    endif

    " Don't forget to 'pip3 install flake8'
    " Not sure if the errorformat stuff is necessary
    if executable('flake8')
        let g:neomake_python_enabled_makers = ['flake8']
        let g:neomake_python_flake8_maker = {
            \ 'args': [flake8_ignore, '--format=default'],
            \ 'errorformat':
                \ '%E%f:%l: could not compile,%-Z%p^,' .
                \ '%A%f:%l:%c: %t%n %m,' .
                \ '%A%f:%l: %t%n %m,' .
                \ '%-G%.%#',
            \ }
    endif

    " I think you can only disable all warnings at once.
    " but the only one I don't want is the proprietary attributes
    " let g:neomake_html_tidy_maker = {
    "     \ 'args': ['-e', '-q', '--gnu-emacs', 'true', '--show-warnings', 'false'],
    "     \ 'errorformat': '%A%f:%l:%c: Warning: %m',
    "     \ }

    " Let YCM handle cpp if possible
    if vim_ide_status =~ 'cpp'
        let g:neomake_cpp_enabled_makers = []
        " TODO: Disabling this for c files could get me in trouble because YCM is currently only
        " configured for cpp files... Leaving it in for now because it makes
        " bfaas easier
        let g:neomake_c_enabled_makers = []
    elseif executable('clang')
        let g:neomake_cpp_enabled_makers=['clang']
        let g:neomake_cpp_clang_args = ["-std=c++14", "-Wextra", "-Wall", "-Weverything", "-pedantic"]
    endif


    function! NeoMakeOnWrite()
        " If NeoMake isn't installed, don't do this
        if exists(":Neomake")<commit_msg>Clang args<commit_after>" source vim_ide_status from the environment
" Ex: export vim_ide_status="ycm rust cpp"
" don't forget to 'pip install neovim'
let vim_ide_status=$vim_ide_status

if has("nvim")

    " This requires Python. Use the system Python for nvim
    " Hope mac has python3 somewhere
    " /usr/bin/python3 -m pip install neovim jedi mistune psutil setproctitle flake8
    " Tested on:
    " - Ubuntu
    " So, this works, but I don't get docstrings this way
    " Mac doesn't have /usr/bin/python3
    if has("mac")
        " Now it depends on anaconda...
        let g:python3_host_prog = expand('~/anaconda3/bin/python3')
    else
        let g:python3_host_prog = '/usr/bin/python3'
    endif
    Plug 'roxma/nvim-completion-manager'
    " Add preview to see docstrings in the complete window.
    let g:cm_completeopt = 'menu,menuone,noinsert,noselect,preview'

    " Close the prevew window automatically on InsertLeave
    " https://github.com/davidhalter/jedi-vim/blob/eba90e615d73020365d43495fca349e5a2d4f995/ftplugin/python/jedi.vim#L44
    augroup ncm_preview
        autocmd! InsertLeave <buffer> if pumvisible() == 0|pclose|endif
    augroup END

    inoremap <expr> <Tab> pumvisible() ? "\<C-n>" : "\<Tab>"
    inoremap <expr> <S-Tab> pumvisible() ? "\<C-p>" : "\<S-Tab>"

    " Use :ll to go to the first error
    Plug 'neomake/neomake'
    let g:neomake_open_list = 0
    let g:neomake_echo_current_error = 1
    let g:neomake_list_height = 5

    " 0 : Errors only
    " 1 : Quiet message (default)
    let g:neomake_verbose = 0

    " E501: line length
    " W503: line break before binary operator
    let flake8_ignore = '--ignore=E501,W503'

    " When experimenting, I don't want to deal with a bunch of this...
    if !empty($vim_flake8_lax_mode)
        let flake8_ignore .= ',E302,E301,E261,W391,F401,E402,E731,E226,F841,E303,E225'
    endif

    " Don't forget to 'pip3 install flake8'
    " Not sure if the errorformat stuff is necessary
    if executable('flake8')
        let g:neomake_python_enabled_makers = ['flake8']
        let g:neomake_python_flake8_maker = {
            \ 'args': [flake8_ignore, '--format=default'],
            \ 'errorformat':
                \ '%E%f:%l: could not compile,%-Z%p^,' .
                \ '%A%f:%l:%c: %t%n %m,' .
                \ '%A%f:%l: %t%n %m,' .
                \ '%-G%.%#',
            \ }
    endif

    " I think you can only disable all warnings at once.
    " but the only one I don't want is the proprietary attributes
    " let g:neomake_html_tidy_maker = {
    "     \ 'args': ['-e', '-q', '--gnu-emacs', 'true', '--show-warnings', 'false'],
    "     \ 'errorformat': '%A%f:%l:%c: Warning: %m',
    "     \ }

    " Let YCM handle cpp if possible
    if vim_ide_status =~ 'cpp'
        let g:neomake_cpp_enabled_makers = []
        " TODO: Disabling this for c files could get me in trouble because YCM is currently only
        " configured for cpp files... Leaving it in for now because it makes
        " bfaas easier
        let g:neomake_c_enabled_makers = []
    elseif executable('clang')
        let g:neomake_cpp_enabled_makers=['clang']
        let g:neomake_cpp_clang_args = ["-std=c++14", "-Wextra", "-Wall", "-Weverything", "-pedantic", "-Wno-c++98-compat", "-Wno-missing-prototypes"]
    endif


    function! NeoMakeOnWrite()
        " If NeoMake isn't installed, don't do this
        if exists(":Neomake")
{'fraction_non_alphanumeric': 0.1252020573108009, 'fraction_numerical': 0.029977957384276267, 'mean_word_length': 2.678918918918919, 'pattern_counts': {'":': 2, '<': 21, '<?xml version=': 0, '>': 21, 'https://': 2, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '384261', 'n_tokens_mistral': 2566, 'n_tokens_neox': 2353, 'n_words': 636}