add plugin for obsidian, markdown rendering & scrolloff settings
This commit is contained in:
parent
036e7bf17b
commit
6da70dfbb3
@ -27,8 +27,10 @@
|
||||
"nvim-tree.lua": { "branch": "master", "commit": "037d89e60fb01a6c11a48a19540253b8c72a3c32" },
|
||||
"nvim-treesitter": { "branch": "master", "commit": "42fc28ba918343ebfd5565147a42a26580579482" },
|
||||
"nvim-web-devicons": { "branch": "master", "commit": "746ffbb17975ebd6c40142362eee1b0249969c5c" },
|
||||
"obsidian.nvim": { "branch": "main", "commit": "ae1f76a75c7ce36866e1d9342a8f6f5b9c2caf9b" },
|
||||
"plenary.nvim": { "branch": "master", "commit": "b9fd5226c2f76c951fc8ed5923d85e4de065e509" },
|
||||
"pywal": { "branch": "main", "commit": "d11b673c0e3d6eb8cbee7ea8cf4a8911f6ee24b9" },
|
||||
"render-markdown.nvim": { "branch": "main", "commit": "48b4175dbca8439d30c1f52231cbe5a712c8f9d9" },
|
||||
"telescope.nvim": { "branch": "master", "commit": "ad7d9580338354ccc136e5b8f0aa4f880434dcdc" },
|
||||
"todo-comments.nvim": { "branch": "main", "commit": "31e3c38ce9b29781e4422fc0322eb0a21f4e8668" },
|
||||
"trouble.nvim": { "branch": "main", "commit": "bd67efe408d4816e25e8491cc5ad4088e708a69a" },
|
||||
|
||||
@ -13,6 +13,8 @@ vim.opt.termguicolors = true
|
||||
vim.opt.cursorline = true
|
||||
vim.opt.signcolumn = 'yes'
|
||||
vim.opt.clipboard = "unnamedplus"
|
||||
vim.opt.scrolloff = 8
|
||||
vim.opt.sidescrolloff = 8
|
||||
|
||||
-- Leader key
|
||||
vim.g.mapleader = ' '
|
||||
|
||||
97
lua/plugins/notes.lua
Normal file
97
lua/plugins/notes.lua
Normal file
@ -0,0 +1,97 @@
|
||||
return {
|
||||
-- Obsidian integration
|
||||
{
|
||||
"epwalsh/obsidian.nvim",
|
||||
version = "*",
|
||||
lazy = true,
|
||||
ft = "markdown",
|
||||
dependencies = {
|
||||
"nvim-lua/plenary.nvim",
|
||||
"nvim-telescope/telescope.nvim",
|
||||
"hrsh7th/nvim-cmp",
|
||||
},
|
||||
opts = {
|
||||
workspaces = {
|
||||
{
|
||||
name = "vault",
|
||||
path = "/mnt/work/obsidian-vault/",
|
||||
},
|
||||
},
|
||||
completion = {
|
||||
nvim_cmp = true,
|
||||
min_chars = 2,
|
||||
},
|
||||
mappings = {
|
||||
["gf"] = {
|
||||
action = function()
|
||||
return require("obsidian").util.gf_passthrough()
|
||||
end,
|
||||
opts = { noremap = false, expr = true, buffer = true },
|
||||
},
|
||||
["<leader>oc"] = {
|
||||
action = function()
|
||||
return require("obsidian").util.toggle_checkbox()
|
||||
end,
|
||||
opts = { buffer = true, desc = "Toggle checkbox" },
|
||||
},
|
||||
},
|
||||
new_notes_location = "current_dir",
|
||||
wiki_link_func = function(opts)
|
||||
return string.format("[[%s]]", opts.path)
|
||||
end,
|
||||
note_id_func = function(title)
|
||||
-- use title as-is for note IDs (no date prefix)
|
||||
if title ~= nil then
|
||||
return title:gsub(" ", "-"):gsub("[^A-Za-z0-9-]", ""):lower()
|
||||
else
|
||||
return tostring(os.time())
|
||||
end
|
||||
end,
|
||||
ui = {
|
||||
enable = false, -- using render-markdown instead
|
||||
},
|
||||
},
|
||||
keys = {
|
||||
{ "<leader>oo", "<cmd>ObsidianQuickSwitch<cr>", desc = "Obsidian: Quick switch" },
|
||||
{ "<leader>on", "<cmd>ObsidianNew<cr>", desc = "Obsidian: New note" },
|
||||
{ "<leader>os", "<cmd>ObsidianSearch<cr>", desc = "Obsidian: Search" },
|
||||
{ "<leader>ob", "<cmd>ObsidianBacklinks<cr>", desc = "Obsidian: Backlinks" },
|
||||
{ "<leader>ot", "<cmd>ObsidianTags<cr>", desc = "Obsidian: Tags" },
|
||||
{ "<leader>od", "<cmd>ObsidianToday<cr>", desc = "Obsidian: Daily note" },
|
||||
{ "<leader>ol", "<cmd>ObsidianLink<cr>", mode = "v", desc = "Obsidian: Link selection" },
|
||||
},
|
||||
},
|
||||
|
||||
-- Render markdown in buffer
|
||||
{
|
||||
"MeanderingProgrammer/render-markdown.nvim",
|
||||
dependencies = {
|
||||
"nvim-treesitter/nvim-treesitter",
|
||||
"nvim-tree/nvim-web-devicons",
|
||||
},
|
||||
ft = { "markdown", "Avante" },
|
||||
opts = {
|
||||
heading = {
|
||||
enabled = true,
|
||||
icons = { " ", " ", " ", " ", " ", " " },
|
||||
},
|
||||
code = {
|
||||
enabled = true,
|
||||
style = "full",
|
||||
border = "thin",
|
||||
},
|
||||
bullet = {
|
||||
enabled = true,
|
||||
icons = { "●", "○", "◆", "◇" },
|
||||
},
|
||||
checkbox = {
|
||||
enabled = true,
|
||||
unchecked = { icon = " " },
|
||||
checked = { icon = " " },
|
||||
},
|
||||
quote = { enabled = true },
|
||||
pipe_table = { enabled = true },
|
||||
link = { enabled = true },
|
||||
},
|
||||
},
|
||||
}
|
||||
@ -78,6 +78,7 @@ return {
|
||||
{ "<leader>9f", desc = "Fill Function" },
|
||||
{ "<leader>9v", desc = "Visual AI" },
|
||||
{ "<leader>9s", desc = "Stop requests" },
|
||||
{ "<leader>o", group = "Obsidian" },
|
||||
})
|
||||
end,
|
||||
},
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user