-
Notifications
You must be signed in to change notification settings - Fork 0
/
headers.vim
33 lines (29 loc) · 1021 Bytes
/
headers.vim
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
" 'alpertuna/vim-header'
" let g:header_auto_add_header = 0
" let g:header_field_filename = 0
" let g:header_field_timestamp = 0
" let g:header_field_modified_timestamp = 0
" let g:header_field_modified_by = 0
let g:licenses_default_commands = ['epam']
" nmap <F5> :AddEPAMLicense<CR>
nmap <F5> :Epam<CR>
function! AddEpamHeader()
"maybe finddir() suits better
let currentPath = split(expand('%:~:h'), '/')
let telescope = filter(currentPath, 'v:val ==? "telescope"')
if len(telescope) > 0 && exists(':Epam')
let l:save = winsaveview()
" if len(telescope) > 0 && exists(':AddEPAMLicense')
" execute 'AddEPAMLicense'
execute 'Epam'
call winrestview(l:save)
endif
endfunction
augroup addHeader
autocmd!
autocmd BufWritePre *.js call AddEpamHeader()
autocmd BufWritePre *.jsx call AddEpamHeader()
autocmd BufWritePre *.ts call AddEpamHeader()
autocmd BufWritePre *.tsx call AddEpamHeader()
" autocmd BufWritePre *.json call AddEpamHeader()
augroup END