Closed NEX-S closed 2 years ago
I try to use this but seems not working...
use { 'CRAG666/code_runner.nvim',
requires = 'nvim-lua/plenary.nvim',
-- cmd = { 'RunFile', 'RunCode' },
config = [[
require "code_runner".setup {
mode = "float",
startinsert = false,
float = {
border = "single",
blend = 30,
},
filetype = {
python = "time python3 -u",
c = "cd $dir && gcc $fileName -o $fileNameWithoutExt -Wall && time ./$fileNameWithoutExt && rm $fileNameWithoutExt",
php = "time php $fileName",
sh = "time sh $fileName",
html = "time google-chrome-stable $fileName",
markdown = vim.cmd "MarkdownPreviewToggle",
lua = vim.cmd "source $MYVIMRC",
http = require "rest-nvim".run(),
},
}
]]
}
i have to use this to run mutiple code in one window :(
vim.api.nvim_create_autocmd({ "BufRead", "BufEnter", "BufNewFile", "TabEnter" }, {
pattern = { "*.python", "*.php", "*.c", "*.html", "*.sh" },
callback = function ()
vim.keymap.set('n', ';r', '<CMD>RunCode<CR>', { noremap = true, silent = true })
end
})
vim.api.nvim_create_autocmd({ "BufRead", "BufEnter", "BufNewFile", "TabEnter" }, {
pattern = { "*.lua" },
callback = function ()
vim.keymap.set('n', ';r', '<CMD>source $MYVIMRC<CR>', { noremap = true, silent = true })
end
})
vim.api.nvim_create_autocmd({ "BufRead", "BufEnter", "BufNewFile", "TabEnter" }, {
pattern = { "*.md" },
callback = function ()
vim.keymap.set('n', ';r', '<CMD>MarkdownPreviewToggle<CR>', { noremap = true, silent = true })
end
})
vim.api.nvim_create_autocmd({ "BufRead", "BufEnter", "BufNewFile", "TabEnter" }, {
pattern = { "*.http" },
callback = function ()
vim.keymap.set('n', ';r', '<CMD>lua require "rest-nvim".run()<CR>', { noremap = true, silent = true })
end
})
This is not the normal behavior of code_runner, it works based on shell commands only use vim for the console or the windows, if you want to try to implement what you need, I am acept to any pr
lol im noob for github and i havent use git before, but i will try my best to implement that <3.
I want to make my code_runner.nvim run MarkdownPreviewToggle in nvim cmd after i press some keys....