lots of nonsense, neorg and autosave now in a usable state
This commit is contained in:
47
lua/plugins/functional/autosave.lua
Normal file
47
lua/plugins/functional/autosave.lua
Normal file
@@ -0,0 +1,47 @@
|
||||
return {
|
||||
"okuuva/auto-save.nvim",
|
||||
version = "^1.0.0", -- see https://devhints.io/semver, alternatively use '*' to use the latest tagged release
|
||||
cmd = "ASToggle", -- optional for lazy loading on command
|
||||
event = { "InsertLeave", "TextChanged" },
|
||||
opts = {},
|
||||
config = function(opts)
|
||||
require("auto-save").setup({
|
||||
enabled = true,
|
||||
trigger_events = { -- See :h events
|
||||
immediate_save = { "BufLeave", "FocusLost", "QuitPre", "VimSuspend" }, -- vim events that trigger an immediate save
|
||||
defer_save = { "InsertLeave" }, -- vim events that trigger a deferred save (saves after `debounce_delay`)
|
||||
cancel_deferred_save = { "InsertEnter" }, -- vim events that cancel a pending deferred save
|
||||
},
|
||||
debounce_delay = 1000,
|
||||
noautocmd = true,
|
||||
})
|
||||
local group = vim.api.nvim_create_augroup("autosave", {})
|
||||
|
||||
vim.api.nvim_create_autocmd("User", {
|
||||
pattern = "AutoSaveWritePre",
|
||||
group = group,
|
||||
callback = function(opts)
|
||||
if opts.data.saved_buffer ~= nil then
|
||||
local filename = vim.fn.expand("%:t")
|
||||
print("Saved '" .. filename .. "' at " .. vim.fn.strftime("%H:%M:%S"))
|
||||
end
|
||||
end,
|
||||
})
|
||||
|
||||
vim.api.nvim_create_autocmd("User", {
|
||||
pattern = "AutoSaveEnable",
|
||||
group = group,
|
||||
callback = function(opts)
|
||||
print("AutoSave enabled")
|
||||
end,
|
||||
})
|
||||
|
||||
vim.api.nvim_create_autocmd("User", {
|
||||
pattern = "AutoSaveDisable",
|
||||
group = group,
|
||||
callback = function(opts)
|
||||
print("AutoSave disabled")
|
||||
end,
|
||||
})
|
||||
end,
|
||||
}
|
||||
@@ -2,12 +2,17 @@ return {
|
||||
"nvim-neorg/neorg",
|
||||
lazy = false,
|
||||
version = "*",
|
||||
dependencies = { { "nvim-lua/plenary.nvim" }, { "nvim-neorg/neorg-telescope" } },
|
||||
dependencies = { { "nvim-lua/plenary.nvim" }, { "nvim-neorg/neorg-telescope" }, { "benlubas/neorg-interim-ls" } },
|
||||
config = function()
|
||||
require("neorg").setup({
|
||||
load = {
|
||||
["core.defaults"] = {},
|
||||
["core.concealer"] = {},
|
||||
["core.integrations.treesitter"] = {},
|
||||
["core.looking-glass"] = {},
|
||||
["core.completion"] = {
|
||||
config = { engine = { module_name = "external.lsp-completion" } },
|
||||
},
|
||||
["core.dirman"] = {
|
||||
config = {
|
||||
workspaces = {
|
||||
@@ -25,6 +30,24 @@ return {
|
||||
},
|
||||
},
|
||||
},
|
||||
["external.interim-ls"] = {
|
||||
config = {
|
||||
-- default config shown
|
||||
completion_provider = {
|
||||
-- Enable or disable the completion provider
|
||||
enable = true,
|
||||
|
||||
-- Show file contents as documentation when you complete a file name
|
||||
documentation = true,
|
||||
|
||||
-- Try to complete categories provided by Neorg Query. Requires `benlubas/neorg-query`
|
||||
categories = false,
|
||||
|
||||
-- suggest heading completions from the given file for `{@x|}` where `|` is your cursor
|
||||
-- and `x` is an alphanumeric character. `{@name}` expands to `[name]{:$/people:# name}`
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
})
|
||||
vim.wo.foldlevel = 99
|
||||
|
||||
Reference in New Issue
Block a user