Always make :Build/:BuildDir available
Don't attached this functionality to only c/cpp filetypes.
This commit is contained in:
@@ -151,22 +151,20 @@ function build.list_targets()
|
||||
return targets
|
||||
end
|
||||
|
||||
function build.create_commands()
|
||||
local buffer = vim.api.nvim_get_current_buf()
|
||||
local buffer = vim.api.nvim_get_current_buf()
|
||||
|
||||
-- Create :BuildDir command
|
||||
vim.api.nvim_buf_create_user_command(buffer, 'BuildDir', function(opts)
|
||||
build.set_dir(opts.fargs[1])
|
||||
end, {
|
||||
bang = true, nargs = '?', complete = build.list_dirs,
|
||||
})
|
||||
-- Create :BuildDir command
|
||||
vim.api.nvim_buf_create_user_command(buffer, 'BuildDir', function(opts)
|
||||
build.set_dir(opts.fargs[1])
|
||||
end, {
|
||||
bang = true, nargs = '?', complete = build.list_dirs,
|
||||
})
|
||||
|
||||
-- Create :Build command
|
||||
vim.api.nvim_buf_create_user_command(buffer, 'Build', function(opts)
|
||||
build.run(opts.fargs)
|
||||
end, {
|
||||
bang = true, nargs = '*', complete = build.list_targets,
|
||||
})
|
||||
end
|
||||
-- Create :Build command
|
||||
vim.api.nvim_buf_create_user_command(buffer, 'Build', function(opts)
|
||||
build.run(opts.fargs)
|
||||
end, {
|
||||
bang = true, nargs = '*', complete = build.list_targets,
|
||||
})
|
||||
|
||||
return build
|
||||
|
||||
Reference in New Issue
Block a user