feat(nvim): added a lot of extras

wildfire, neorg, obsidian, autosave, no-neck-pain, etc
This commit is contained in:
Sergio Laín 2023-11-16 23:48:31 +01:00
parent aa696f684c
commit 353bbc67f2
No known key found for this signature in database
GPG key ID: 14C9B8080681777B
6 changed files with 126 additions and 0 deletions

View file

@ -0,0 +1,5 @@
return {
"sustech-data/wildfire.nvim",
event = "BufEnter",
opts = {},
}

View 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",
},
},
},
},
},
}

View 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,
},
}

View file

@ -0,0 +1,5 @@
return {
"LudoPinelli/comment-box.nvim",
event = "BufReadPost",
opts = {},
}

View 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,
},
},
}

View file

@ -0,0 +1,11 @@
return {
"shortcuts/no-neck-pain.nvim",
opts = {},
keys = {
{
"<leader>uN",
"<cmd>NoNeckPain<cr>",
desc = "No Neck Pain",
},
},
}