如何在Astrovim中添加Autosave插件?
我是 vim/neovim 社区的新手。我想添加 autosave 功能,例如 vscode 。我不知道 lua语言。我打破了 Astrovim 配置文件多次。并且必须完全重新安装。
我找到了这个软件包,但找不到任何可靠的解决方案,即如何在 Astrovim 中添加此插件。
https://github.com/pocco81/autosave.nvim
/strong>文件:
vim.opt.rtp:append(vim.fn.stdpath "config" .. "/../astronvim")
local impatient_ok, impatient = pcall(require, "impatient")
if impatient_ok then
impatient.enable_profile()
end
local utils = require "core.utils"
utils.bootstrap()
local sources = {
"core.options",
"core.plugins",
"core.autocmds",
"core.mappings",
"configs.which-key-register",
}
for _, source in ipairs(sources) do
local status_ok, fault = pcall(require, source)
if not status_ok then
error("Failed to load " .. source .. "\n\n" .. fault)
elseif source == "core.plugins" then
utils.compiled()
end
end
local status_ok, ui = pcall(require, "core.ui")
if status_ok then
for ui_addition, enabled in pairs(utils.user_settings().ui) do
if enabled and type(ui[ui_addition]) == "function" then
ui[ui_addition]()
end
end
end
local polish = utils.user_plugin_opts "polish"
if type(polish) == "function" then
polish()
end
如何在 Astrovim 中添加 autosave 插件,以及我可以在其中找到适当的设置指南插件,这些插件在 lspinstall 。
I am new to the vim/neovim community. I wanted to add Autosave feature like Vscode. I don't know the lua language. I broke Astrovim config file many times. and had to reinstall altogether.
I found this package but was unable to find any reliable solution that how to add this plugin in Astrovim.
https://github.com/Pocco81/AutoSave.nvim
init.lua file :
vim.opt.rtp:append(vim.fn.stdpath "config" .. "/../astronvim")
local impatient_ok, impatient = pcall(require, "impatient")
if impatient_ok then
impatient.enable_profile()
end
local utils = require "core.utils"
utils.bootstrap()
local sources = {
"core.options",
"core.plugins",
"core.autocmds",
"core.mappings",
"configs.which-key-register",
}
for _, source in ipairs(sources) do
local status_ok, fault = pcall(require, source)
if not status_ok then
error("Failed to load " .. source .. "\n\n" .. fault)
elseif source == "core.plugins" then
utils.compiled()
end
end
local status_ok, ui = pcall(require, "core.ui")
if status_ok then
for ui_addition, enabled in pairs(utils.user_settings().ui) do
if enabled and type(ui[ui_addition]) == "function" then
ui[ui_addition]()
end
end
end
local polish = utils.user_plugin_opts "polish"
if type(polish) == "function" then
polish()
end
How can I add Autosave plugin in Astrovim and where I can find a proper guideline to setup Plugins that are not available in LspInstall .
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
您应该使用的步骤添加 autosave in astrovim
步骤1
转到此目录
/home/home/home/{username}/。
您会找到
plugins.lua
文件在
本地astro_plugins
变量下添加此代码
您的
plugins.lua
文件将看起来像这样(您可以使用 plugins.lua file)复制粘贴)plugins.lua
step step 2
转到此目录
/home/{用户名}/。配置/nvim/lua/configs/
创建一个文件名
auto_save.lua
并复制粘贴此代码auto_save.lua
您可以看到此视频
Steps You should used to add AutoSave plugin in Astrovim
Step 1
Go to this directory
/home/{UserName}/.config/nvim/lua/core/
you will found
plugins.lua
filehere under the
local astro_plugins
variableadd this code
your
plugins.lua
file will look like this (you can copy paste this with your plugins.lua file)plugins.lua
Step 2
Go to this directory
/home/{UserName}/.config/nvim/lua/configs/
create a file name
auto_save.lua
and copy paste this codeauto_save.lua
You can see this Video
您只需要添加一个示例文件中建议的插件部分:
另外,如果不是这种情况,则应如指示的那样管理自己的init.lua文件在这里
You just have to add a plugin section like suggested in the example file :
Also, if that's not the case already you should manage your own init.lua file as indicated here