run on every cd
This commit is contained in:
@@ -402,16 +402,23 @@ do
|
|||||||
return false
|
return false
|
||||||
end
|
end
|
||||||
|
|
||||||
for compiler, glob_patterns in pairs(compiler_mapping) do
|
local function auto_select_compiler()
|
||||||
for _, glob_pattern in ipairs(glob_patterns) do
|
for compiler, glob_patterns in pairs(compiler_mapping) do
|
||||||
if look_for_file(glob_pattern) then
|
for _, glob_pattern in ipairs(glob_patterns) do
|
||||||
vim.cmd('compiler! '..compiler)
|
if look_for_file(glob_pattern) then
|
||||||
|
vim.cmd('compiler! '..compiler)
|
||||||
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
if look_for_file('justfile') then
|
||||||
|
vim.go.makeprg = 'just'
|
||||||
|
end
|
||||||
end
|
end
|
||||||
if look_for_file('justfile') then
|
|
||||||
vim.go.makeprg = 'just'
|
auto_select_compiler()
|
||||||
end
|
vim.api.nvim_create_autocmd('DirChanged', {
|
||||||
|
callback = auto_select_compiler,
|
||||||
|
})
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user