REFACTOR: Annotations for autocompletion, reworked how projects are made
and handled, wrote the c file replacing the copied python code.
This commit is contained in:
+10
-7
@@ -1,19 +1,22 @@
|
||||
local actions = require("vern.actions.python")
|
||||
local config = require("vern.configs.python")
|
||||
|
||||
---@param bufnr integer Buffer to activate on : defaults to 0
|
||||
---@param user_opts? VernPythonConfig
|
||||
return function(bufnr, user_opts)
|
||||
---@type VernPythonConfig
|
||||
local opts = vim.tbl_deep_extend("force", {}, config, user_opts or {})
|
||||
vim.api.nvim_buf_create_user_command(bufnr, "Pythonrun", function()
|
||||
vim.api.nvim_buf_create_user_command(bufnr, "CRun", function()
|
||||
if type(actions.run) == "function" then
|
||||
actions.run(opts)
|
||||
end
|
||||
end, { desc = "Run python project" })
|
||||
end, { desc = "Run c project" })
|
||||
|
||||
vim.api.nvim_buf_create_user_command(bufnr, "Pythonpip", function(cmd_args)
|
||||
if actions.pip_install then
|
||||
actions.pip_install(opts, cmd_args)
|
||||
end
|
||||
end, { nargs = "*", desc = "Install python packages" })
|
||||
-- vim.api.nvim_buf_create_user_command(bufnr, "Pythonpip", function(cmd_args)
|
||||
-- if actions.pip_install then
|
||||
-- actions.pip_install()
|
||||
-- end
|
||||
-- end, { nargs = "*", desc = "Install python packages" })
|
||||
|
||||
for key, def in pairs(opts.python.keybinds or {}) do
|
||||
if type(def.action) == "function" then
|
||||
|
||||
@@ -1,7 +1,10 @@
|
||||
local actions = require("vern.actions.python")
|
||||
local config = require("vern.configs.python")
|
||||
|
||||
---@param bufnr integer Buffer to activate on : defaults to 0
|
||||
---@param user_opts? VernPythonConfig
|
||||
return function(bufnr, user_opts)
|
||||
---@type VernPythonConfig
|
||||
local opts = vim.tbl_deep_extend("force", {}, config, user_opts or {})
|
||||
vim.api.nvim_buf_create_user_command(bufnr, "Pythonrun", function()
|
||||
if type(actions.run) == "function" then
|
||||
@@ -9,9 +12,9 @@ return function(bufnr, user_opts)
|
||||
end
|
||||
end, { desc = "Run python project" })
|
||||
|
||||
vim.api.nvim_buf_create_user_command(bufnr, "Pythonpip", function(cmd_args)
|
||||
vim.api.nvim_buf_create_user_command(bufnr, "Pythonpip", function()
|
||||
if actions.pip_install then
|
||||
actions.pip_install(opts, cmd_args)
|
||||
actions.pip_install()
|
||||
end
|
||||
end, { nargs = "*", desc = "Install python packages" })
|
||||
|
||||
|
||||
Reference in New Issue
Block a user