-
Notifications
You must be signed in to change notification settings - Fork 33
No command available for this filetype #135
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Working with folder with space: filetype = {
v = 'v run',
tex = function(...)
require('code_runner.hooks.tectonic').build(
preview_cmd,
{ '--keep-intermediates', '--keep-logs' }
)
end,
quarto = {
'cd $dir &&',
'quarto preview $fileName',
'--no-browser',
'--port 4444',
},
markdown = function(...)
local hook = require('code_runner.hooks.preview_pdf')
require('code_runner.hooks.ui').select({
Marp = function()
require('code_runner').run_from_fn(
'marp --theme-set $MARPT -w -p . &$end'
)
end,
Latex = function()
hook.run({
command = 'pandoc',
args = { '$fileName', '-o', '$tmpFile', '-t pdf' },
preview_cmd = preview_cmd,
})
end,
Beamer = function()
hook.run({
command = 'pandoc',
args = { '$fileName', '-o', '$tmpFile', '-t beamer' },
preview_cmd = preview_cmd,
})
end,
Eisvogel = function()
hook.run({
command = 'bash',
args = { './build.sh' },
preview_cmd = preview_cmd,
overwrite_output = '.',
})
end,
})
end,
javascript = 'node',
java = 'cd $dir && javac $fileName && java $fileNameWithoutExt',
kotlin = 'cd $dir && kotlinc-native $fileName -o $fileNameWithoutExt && ./$fileNameWithoutExt.kexe',
c = function(...)
c_base = {
'cd $dir &&',
'gcc $fileName -o',
'/tmp/$fileNameWithoutExt',
}
local c_exec = {
'&& /tmp/$fileNameWithoutExt &&',
'rm /tmp/$fileNameWithoutExt',
}
vim.ui.input({ prompt = 'Add more args:' }, function(input)
c_base[4] = input
require('code_runner.commands').run_from_fn(
vim.list_extend(c_base, c_exec)
)
end)
end,
-- cpp = {
-- 'cd $dir &&',
-- 'g++ $fileName',
-- '-o /tmp/$fileNameWithoutExt &&',
-- '/tmp/$fileNameWithoutExt',
-- },
cpp = function(...)
cpp_base = {
[[cd '$dir' &&]],
'g++ $fileName -o',
'/tmp/$fileNameWithoutExt',
}
local cpp_exec = {
'&& /tmp/$fileNameWithoutExt &&',
'rm /tmp/$fileNameWithoutExt',
}
vim.ui.input({ prompt = 'Add more args:' }, function(input)
cpp_base[4] = input
vim.print(vim.tbl_extend('force', cpp_base, cpp_exec))
require('code_runner.commands').run_from_fn(
vim.list_extend(cpp_base, cpp_exec)
)
end)
end,
python = "python -u '$dir/$fileName'",
sh = 'bash',
typescript = 'deno run',
typescriptreact = 'yarn dev$end',
rust = 'cd $dir && rustc $fileName && $dir$fileNameWithoutExt',
dart = 'dart',
cs = function(...)
local root_dir =
require('null-ls.utils').root_pattern('*.csproj')(vim.loop.cwd())
return 'cd ' .. root_dir .. ' && dotnet run$end'
end,
},
project_path = vim.fn.expand('~/.config/nvim/project_manager.json'),
}, |
@FrancescoDerme use [[]] instead '' |
@CRAG666 Thank you, I’ll try ASAP |
Strangely not working for me: |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I'm trying to add cpp to the list of supported languages, my config function is defined as follows. When I run
:RunCode
on a .cpp file, I'm prompted with "Add more args:", but then whatever I enter the command fails with "No command available for this file type", what am I doing wrong? Please notice that I've also modified a command to'cd "$dir" &&'
instead of"cd "$dir"&&",
since$dir
might contain spaces.The text was updated successfully, but these errors were encountered: