✨ feat(nvim): added a lot of extras
wildfire, neorg, obsidian, autosave, no-neck-pain, etc
This commit is contained in:
parent
aa696f684c
commit
353bbc67f2
6 changed files with 126 additions and 0 deletions
5
.config/nvim/lua/plugins/extras/coding/wildfire.lua
Normal file
5
.config/nvim/lua/plugins/extras/coding/wildfire.lua
Normal file
|
@ -0,0 +1,5 @@
|
|||
return {
|
||||
"sustech-data/wildfire.nvim",
|
||||
event = "BufEnter",
|
||||
opts = {},
|
||||
}
|
26
.config/nvim/lua/plugins/extras/editor/neorg.lua
Normal file
26
.config/nvim/lua/plugins/extras/editor/neorg.lua
Normal file
|
@ -0,0 +1,26 @@
|
|||
return {
|
||||
"nvim-neorg/neorg",
|
||||
build = ":Neorg sync-parsers",
|
||||
dependencies = { "nvim-lua/plenary.nvim" },
|
||||
event = "VeryLazy",
|
||||
opts = {
|
||||
load = {
|
||||
["core.defaults"] = {}, -- Loads default behaviour
|
||||
["core.concealer"] = {}, -- Adds pretty icons to your documents
|
||||
["core.keybinds"] = {}, -- Adds default keybindings
|
||||
["core.completion"] = {
|
||||
config = {
|
||||
engine = "nvim-cmp",
|
||||
},
|
||||
}, -- Enables support for completion plugins
|
||||
["core.journal"] = {}, -- Enables support for the journal module
|
||||
["core.dirman"] = { -- Manages Neorg workspaces
|
||||
config = {
|
||||
workspaces = {
|
||||
notes = "~/projects/notes",
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
}
|
48
.config/nvim/lua/plugins/extras/editor/obsidian.lua
Normal file
48
.config/nvim/lua/plugins/extras/editor/obsidian.lua
Normal file
|
@ -0,0 +1,48 @@
|
|||
return {
|
||||
"epwalsh/obsidian.nvim",
|
||||
event = { "BufReadPre */obsidian-vault/*.md" },
|
||||
keys = {
|
||||
{
|
||||
"gf",
|
||||
function()
|
||||
if require("obsidian").util.cursor_on_markdown_link() then
|
||||
return "<cmd>ObsidianFollowLink<CR>"
|
||||
else
|
||||
return "gf"
|
||||
end
|
||||
end,
|
||||
noremap = false,
|
||||
expr = true,
|
||||
},
|
||||
},
|
||||
dependencies = {
|
||||
"nvim-lua/plenary.nvim",
|
||||
"hrsh7th/nvim-cmp",
|
||||
"nvim-telescope/telescope.nvim",
|
||||
},
|
||||
opts = {
|
||||
dir = vim.env.HOME .. "Documentos/Obsidian/obsidianVault/root", -- specify the vault location. no need to call 'vim.fn.expand' here
|
||||
use_advanced_uri = true,
|
||||
finder = "telescope.nvim",
|
||||
mappings = {},
|
||||
|
||||
templates = {
|
||||
subdir = "templates",
|
||||
date_format = "%Y-%m-%d-%a",
|
||||
time_format = "%H:%M",
|
||||
},
|
||||
|
||||
note_frontmatter_func = function(note)
|
||||
-- This is equivalent to the default frontmatter function.
|
||||
local out = { id = note.id, aliases = note.aliases, tags = note.tags }
|
||||
-- `note.metadata` contains any manually added fields in the frontmatter.
|
||||
-- So here we just make sure those fields are kept in the frontmatter.
|
||||
if note.metadata ~= nil and require("obsidian").util.table_length(note.metadata) > 0 then
|
||||
for k, v in pairs(note.metadata) do
|
||||
out[k] = v
|
||||
end
|
||||
end
|
||||
return out
|
||||
end,
|
||||
},
|
||||
}
|
5
.config/nvim/lua/plugins/extras/ui/comment-box.lua
Normal file
5
.config/nvim/lua/plugins/extras/ui/comment-box.lua
Normal file
|
@ -0,0 +1,5 @@
|
|||
return {
|
||||
"LudoPinelli/comment-box.nvim",
|
||||
event = "BufReadPost",
|
||||
opts = {},
|
||||
}
|
31
.config/nvim/lua/plugins/extras/util/autosave.lua
Normal file
31
.config/nvim/lua/plugins/extras/util/autosave.lua
Normal file
|
@ -0,0 +1,31 @@
|
|||
return {
|
||||
-- "Pocco81/auto-save.nvim",
|
||||
"zoriya/auto-save.nvim", -- HACK: use fork until PR is accepted
|
||||
event = { "InsertEnter" },
|
||||
opts = {
|
||||
callbacks = {
|
||||
before_saving = function()
|
||||
-- save global autoformat status
|
||||
vim.g.OLD_AUTOFORMAT = vim.g.autoformat_enabled
|
||||
|
||||
vim.g.autoformat_enabled = false
|
||||
vim.g.OLD_AUTOFORMAT_BUFFERS = {}
|
||||
-- disable all manually enabled buffers
|
||||
for _, bufnr in ipairs(vim.api.nvim_list_bufs()) do
|
||||
if vim.b[bufnr].autoformat_enabled then
|
||||
table.insert(vim.g.OLD_BUFFER_AUTOFORMATS, bufnr)
|
||||
vim.b[bufnr].autoformat_enabled = false
|
||||
end
|
||||
end
|
||||
end,
|
||||
after_saving = function()
|
||||
-- restore global autoformat status
|
||||
vim.g.autoformat_enabled = vim.g.OLD_AUTOFORMAT
|
||||
-- reenable all manually enabled buffers
|
||||
for _, bufnr in ipairs(vim.g.OLD_AUTOFORMAT_BUFFERS or {}) do
|
||||
vim.b[bufnr].autoformat_enabled = true
|
||||
end
|
||||
end,
|
||||
},
|
||||
},
|
||||
}
|
11
.config/nvim/lua/plugins/extras/util/no-neck-pain.lua
Normal file
11
.config/nvim/lua/plugins/extras/util/no-neck-pain.lua
Normal file
|
@ -0,0 +1,11 @@
|
|||
return {
|
||||
"shortcuts/no-neck-pain.nvim",
|
||||
opts = {},
|
||||
keys = {
|
||||
{
|
||||
"<leader>uN",
|
||||
"<cmd>NoNeckPain<cr>",
|
||||
desc = "No Neck Pain",
|
||||
},
|
||||
},
|
||||
}
|
Loading…
Add table
Reference in a new issue