mirror of
https://github.com/raimon49/requirements.txt.vim.git
synced 2026-03-07 05:51:52 +08:00
Set makeprg if pip-compile is available
also update tests and make Requirements_matched_filename more specific.
This commit is contained in:
11
after/ftplugin/requirements.vim
Normal file
11
after/ftplugin/requirements.vim
Normal file
@@ -0,0 +1,11 @@
|
||||
if executable('pip-compile')
|
||||
let s:filename = expand("%:p")
|
||||
if fnamemodify(s:filename, ":t") ==# 'requirements.in'
|
||||
" this is the default filename for pip-compile
|
||||
setlocal makeprg=pip-compile
|
||||
elseif fnamemodify(s:filename, ":e") ==# 'in'
|
||||
\ && Requirements_matched_filename(s:filename)
|
||||
setlocal makeprg=pip-compile\ %
|
||||
endif
|
||||
endif
|
||||
" vim: et sw=4 ts=4 sts=4:
|
||||
Reference in New Issue
Block a user