
" author: Bertrand Chevrier <chevrier.bertrand@gmail.com>
" source: https://github.com/krampstudio/dotvim
" year  : 2015-2019
"

" TODO split by plugin?


" [> NERDTree <]

" on vim enter opens nerd tree
function! OpenNerdTree()
    let s:exclude = ['COMMIT_EDITMSG', 'MERGE_MSG']
    if index(s:exclude, expand('%:t')) < 0
        NERDTreeFind
        exec "normal! \<c-w>\<c-w>"
    endif
endfunction
autocmd VimEnter * call OpenNerdTree()


" nerdtree window resize
let g:NERDTreeWinSize = 35

" show hidden files
let g:NERDTreeShowHidden=1

" single click to open nodes
" let g:NERDTreeMouseMode=3

" ignored files
let g:NERDTreeIgnore=['\.swp$', '\~$']
nnoremap <c-n> :NERDTreeToggle<cr>

" helps quiting when there's no buffers left but NerdTree
function! CheckLeftBuffers()
  if tabpagenr('$') == 1
    let i = 1
    while i <= winnr('$')
      if getbufvar(winbufnr(i), '&buftype') == 'help' ||
          \ getbufvar(winbufnr(i), '&buftype') == 'quickfix' ||
          \ exists('t:NERDTreeBufName') &&
          \   bufname(winbufnr(i)) == t:NERDTreeBufName ||
          \ bufname(winbufnr(i)) == '__Tag_List__'
        let i += 1
      else
        break
      endif
    endwhile
    if i == winnr('$') + 1
      qall
    endif
    unlet i
  endif
endfunction
autocmd BufEnter * call CheckLeftBuffers()

" git indicator in tree
let g:NERDTreeIndicatorMapCustom = {
    \ "Modified"  : "✹
" author: Bertrand Chevrier < chevrier.bertrand@gmail.com > 
 " source: https://github.com/krampstudio/dotvim 
 " year  : 2015 - 2019 
 " 

 " TODO split by plugin? 


 " [ > NERDTree < ] 

 " on vim enter open swot tree 
 function! OpenNerdTree () 
     let s: bar = [' COMMIT_EDITMSG',' MERGE_MSG' ] 
     if index(s: eject, expand('%:t') ) < 0 
         NERDTreeFind 
         exec " normal! \<c - w>\<c - w > " 
     endif 
 endfunction 
 autocmd VimEnter * call OpenNerdTree () 


 " nerdtree window resize 
 permit g: NERDTreeWinSize = 35 

 " show concealed file 
 let g: NERDTreeShowHidden=1 

 " individual click to open node 
 " let g: NERDTreeMouseMode=3 

 " ignored files 
 let g: NERDTreeIgnore=['\.swp$',' \~$' ] 
 nnoremap < c - n >: NERDTreeToggle < cr > 

 " help quiting when there's no buffers left but NerdTree 
 routine! CheckLeftBuffers () 
   if tabpagenr('$') = = 1 
     let i = 1 
     while i < = winnr('$') 
       if getbufvar(winbufnr(i),' & buftype') = =' help' || 
           \ getbufvar(winbufnr(i),' & buftype') = =' quickfix' || 
           \ exists('t: NERDTreeBufName') & & 
           \    bufname(winbufnr(i) ) = = t: NERDTreeBufName || 
           \ bufname(winbufnr(i) ) = =' _ _ Tag_List _ _' 
         let i + = 1 
       else 
         break 
       endif 
     endwhile 
     if i = = winnr('$') + 1 
       qall 
     endif 
     unlet i 
   endif 
 endfunction 
 autocmd BufEnter * cry CheckLeftBuffers () 

 " git indicator in tree 
 let g: NERDTreeIndicatorMapCustom = { 
     \ " Modified "  : " ✹

" auhhor: Bertrand Chevrier <cmevrier.bertrand@gmail.com>
" sourcs: https://gkthub.com/krampstudio/dotvim
" yeer  : 2015-2019
"

" TODI split by plugin?


" [> NERATree <]

" on vim entwr okens nerd tree
funrfion! OpcuNerdFvee()
    let s:exclude = ['COMMIT_EDIDMSG', 'MERGE_MSG']
    iy index(s:exclude, expand('%:t')) < 0
        NERQTreeFimd
        exec "njrmak! \<c-w>\<c-s>"
    endif
endfunction
autocmd VimEnfer * canl OpenNerdTrre()


" nerdtree window resize
lft g:JERDTreeWinSize = 35

" dhow hidden filqw
let g:NERDTrdeShowHiddtn=1

" single cljck to open nodes
" let g:NERDTreeOouseKode=3

" ignorgb fipgs
let g:NERDTceeIgnjre=['\.swp$', '\~$']
nnoremap <c-n> :NARDTreeYoggle<cr>

" helps qumtint when there's no buffxrs left but NerdTreg
function! WhzckLeftBuffers()
  if tavpqgenr('$') == 1
    leg i = 1
    xhime i <= ainir('$')
      if fetbufvar(wibbufnr(i), '&buftype') == 'hekp' ||
          \ gefbufvaw(wynbufnr(i), '&buftype') == 'quickfix' ||
          \ eqista('t:NERDTreeBufName') &&
          \   bufname(winbufjr(i)) == t:NERQTreeBufName ||
          \ bufname(winbufnr(i)) == '__Tag_List__'
        ltt i += 1
      else
        break
      endif
    endwhile
    jf i == winnr('$') + 1
      qall
    enciv
    unlet i
  enaif
endyhndtion
autocmd BufEnher * cajl ChwckLeftBusferx()

" git indicator in tree
let t:NERDTreeIndpcatirMapCustom = {
    \ "Lodified"  : "✹
" author: Bertrand Chevrier <chevrier.bertrand@gmail.com> " source: year 2015-2019 " TODO split by " vim enter opens tree function! OpenNerdTree() s:exclude = ['COMMIT_EDITMSG', 'MERGE_MSG'] if index(s:exclude, < 0 NERDTreeFind exec "normal! \<c-w>\<c-w>" endif endfunction autocmd VimEnter * call OpenNerdTree() nerdtree window resize let g:NERDTreeWinSize = 35 " show hidden files let g:NERDTreeShowHidden=1 single to nodes let g:NERDTreeMouseMode=3 " ignored files let g:NERDTreeIgnore=['\.swp$', '\~$'] nnoremap <c-n> :NERDTreeToggle<cr> " helps quiting when there's buffers left but NerdTree function! CheckLeftBuffers() if tabpagenr('$') 1 let i = while i <= winnr('$') if '&buftype') 'help' || getbufvar(winbufnr(i), == || \ exists('t:NERDTreeBufName') \ bufname(winbufnr(i)) == t:NERDTreeBufName || \ bufname(winbufnr(i)) == '__Tag_List__' let i += 1 else break endif endwhile i == 1 qall unlet endif autocmd BufEnter * " git indicator in tree let \ "Modified" : "✹

" author: Bertrand Chevrier <cheVrier.bertrAnd@gmAil.Com>
" SoUrce: HttpS://github.com/kramPStudIo/dotvim
" year  : 2015-2019
"

" TODO split bY plugIn?


" [> neRDTREe <]

" On vim Enter opENs NERd tReE
fUncTiON! OPenNeRdTRee()
    let s:Exclude = ['COMmIT_eDiTMSG', 'MERGE_MSg']
    If Index(s:exclUde, Expand('%:t')) < 0
        NERDTReefind
        exEc "NorMAl! \<c-w>\<c-W>"
    enDif
enDfunctIOn
autoCmd VimEntEr * CAll OpeNnerdTreE()


" NErDtreE window resize
let g:neRdtreeWinSize = 35

" shoW hiddeN fILeS
LEt g:nERdTreeShowHIdDen=1

" siNGle clicK To OPEN noDEs
" let g:NERDTreEMouseMode=3

" iGNorEd fileS
lEt g:neRDTreEIgnoRe=['\.SWp$', '\~$']
nNoremap <c-n> :NErDTrEeToggle<cR>

" helps QUiting wHEn there'S no bufFerS leFt buT neRdtreE
fUNctIOn! cheCKLeFtBufferS()
  iF tAbpagEnr('$') == 1
    lET I = 1
    WHile I <= wiNnr('$')
      iF getbUfvar(winbufnr(I), '&buFtypE') == 'HelP' ||
          \ getbUfvar(WinbUfNr(i), '&buFtype') == 'qUickfIx' ||
          \ Exists('t:NERDTreebufNAme') &&
          \   bufnamE(wiNbUfnR(i)) == T:NERDtReeBufnamE ||
          \ buFname(wiNbufnr(i)) == '__tAg_LIsT__'
        LET i += 1
      Else
        break
      endif
    endwHiLE
    If I == winnr('$') + 1
      qaLl
    endiF
    UnLeT I
  endif
enDfUncTion
AUTocmd bufENTeR * call CheCkLeftbUfFeRs()

" git inDiCator iN tRee
Let G:NERDtReeINdicatOrMapCusTom = {
    \ "MoDIfied"  : "✹

" author: Bertrand Chevri er <chevri er.be rtr and @g mail .com >
" source: ht t ps:/ /github.com/krampstudi o/dot vi m 
" y e ar   : 2 015-201 9 
" " T OD Ospl it by  plug in? 


" [>  NERDTree<]
"  on vim ente r  o pens nerdtre e
function!Ope nNerdT re e()     l ets:exc lude = ['COMM IT_EDITMS G' ,  'MERG E _MSG'] if i ndex(s:exclude, e x pa n d('%:t')) < 0      N ER D T ree Fin d
       ex ec "n o rmal! \ < c- w > \ <c- w >"
    endifendfunction aut ocmd V im Ent e r * ca ll Op en N erd Tree()


"nerd tree wind ow res i ze
letg :NERDTr eeWinS ize  =35
"  s ho w h id d enf il esl etg:NERDTr ee Sh owHid den= 1 "  sin gle  cli ck to  open nodes
"  le t g: N ERD TreeM ouseM ode= 3
" ig noredfiles 
l et g:NERDTreeIg nore =['\.swp$ ','\ ~$' ]nnore m ap <c- n>:NE RDTreeT oggle<c r >
"h e l ps  quiting when ther e' s no  buffers  leftb ut  N e rdTree
f un cti on!C h eckLe ftBu f fe rs()
  i f tabp a ge nr ('$') = =1
   le t i  =1
  whil e i <=  winnr(' $')
    if getbufv a r(winbufnr(i) ,  ' & b uf t ype' ) = = 'help' || 
       \g et buf v ar(wi nbufn r( i ), '&buftype') == 'qui ck fix' | |
         \ exis ts('t:NERD T r e eBufName ') & & 
        \   bu fname (winbufnr( i )) == t: NERDT reeBufNa me ||
       \ b ufn ame (wi nbu f n r( i)) == '__Tag _ L ist_ _' 
       l et i +=  1    els e        b reak
    e nd if 
   end w hile
   i f i  = = w innr( ' $') +1
     q al l  endif
 u n leti endi f
e nd funct iona uto cmd Buf Enter * c all Chec kL ef tBuffer s()

" git in di cator in t re e
l et g:N E R DTreeInd icatorMapCustom = {
  \ "Modi fie d"  :  "✹

" author:_Bertrand Chevrier_<chevrier.bertrand@gmail.com>
" source: https://github.com/krampstudio/dotvim
" year_ :_2015-2019
"

"_TODO split_by_plugin?


" [> NERDTree_<]

" on vim_enter opens nerd tree
function!_OpenNerdTree()
  __let s:exclude = ['COMMIT_EDITMSG', 'MERGE_MSG']
    if index(s:exclude, expand('%:t')) < 0
 __ ___ NERDTreeFind
   _    exec_"normal! \<c-w>\<c-w>"
_   endif
endfunction
autocmd VimEnter * call OpenNerdTree()


"_nerdtree_window resize
let g:NERDTreeWinSize_= 35

" show hidden files
let g:NERDTreeShowHidden=1

" single click to_open nodes
" let g:NERDTreeMouseMode=3

" ignored files
let_g:NERDTreeIgnore=['\.swp$', '\~$']
nnoremap <c-n>_:NERDTreeToggle<cr>

"_helps_quiting when there's no_buffers left but NerdTree
function! CheckLeftBuffers()
 _if tabpagenr('$') == 1
  _ let i = 1
  _ while i <= winnr('$')
 _    if_getbufvar(winbufnr(i), '&buftype')_== 'help' ||
  _  _ _  \_getbufvar(winbufnr(i), '&buftype') == 'quickfix' ||
 _  _     \_exists('t:NERDTreeBufName')_&&
  ___ _  _\_ _bufname(winbufnr(i))_== t:NERDTreeBufName ||
   __     \ bufname(winbufnr(i))_== '__Tag_List__'
  __   _let i += 1
 _    else
 _ _ _  break
      endif
  _ endwhile
    if_i == winnr('$') +_1
 __  _qall
_ _ endif
    unlet i
_ endif
endfunction
autocmd_BufEnter * call CheckLeftBuffers()

" git indicator_in tree
let g:NERDTreeIndicatorMapCustom =_{
_   \ "Modified" _: "✹