-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
186 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,65 @@ | ||
local function install_missing_dora() | ||
local dora_path = vim.fn.stdpath("data") .. "/lazy/dora.nvim" | ||
|
||
if not vim.uv.fs_stat(dora_path) then | ||
vim | ||
.system({ | ||
"git", | ||
"clone", | ||
"https://github.com/TwIStOy/dora.nvim.git", | ||
dora_path, | ||
}) | ||
:wait() | ||
end | ||
|
||
vim.opt.rtp:prepend(dora_path) | ||
end | ||
|
||
local M = {} | ||
|
||
function M.setup(opts) | ||
install_missing_dora() | ||
|
||
---@class dora | ||
local dora = require("dora") | ||
|
||
opts = opts or {} | ||
|
||
opts.packages = { | ||
"dora.packages._builtin", | ||
"dora.packages.coding", | ||
"dora.packages.editor", | ||
"dora.packages.treesitter", | ||
"dora.packages.lsp", | ||
"dora.packages.ui", | ||
"dora.packages.extra.ui", | ||
"dora.packages.extra.misc.tools", | ||
"dora.packages.extra.misc.darwin", | ||
"dora.packages.extra.editor", | ||
"dora.packages.extra.lang.cpp", | ||
"dora.packages.extra.lang.cmake", | ||
"dora.packages.extra.lang.lua", | ||
"dora.packages.extra.lang.latex", | ||
"dora.packages.extra.lang.markdown", | ||
"dora.packages.extra.lang.python", | ||
"dora.packages.extra.lang.rust", | ||
"dora.packages.extra.lang.dart", | ||
"dora.packages.extra.lang.swift", | ||
"dora.packages.extra.lang.typescript", | ||
"dora.packages.extra.lang.nix", | ||
"dora.packages.extra.misc.competitive-programming", | ||
"dora.packages.extra.obsidian", | ||
"dora.packages.extra.misc.copilot", | ||
"dora.packages.extra.misc.wakatime", | ||
"dora.packages.extra.misc.rime", | ||
|
||
"dotvim.packages.obsidian", | ||
"dotvim.packages.lsp", | ||
} | ||
|
||
dora.setup(opts) | ||
|
||
vim.cmd("colorscheme catppuccin") | ||
end | ||
|
||
return M |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
---@type dora.core.package.PackageOption | ||
return { | ||
name = "dotvim.packages.lsp", | ||
deps = { | ||
"dora.packages.extra.lsp", | ||
}, | ||
plugins = { | ||
{ | ||
"aerial.nvim", | ||
opts = function(_, opts) | ||
local function post_parse_symbol(_, _item, ctx) | ||
local function merge_nested_namespaces(item) | ||
if | ||
item.kind == "Namespace" | ||
and #item.children == 1 | ||
and item.children[1].kind == "Namespace" | ||
and item.lnum == item.children[1].lnum | ||
and item.end_lnum == item.children[1].end_lnum | ||
then | ||
item.name = item.name .. "::" .. item.children[1].name | ||
item.children = item.children[1].children | ||
for _, child in ipairs(item.children) do | ||
child.parent = item | ||
child.level = item.level + 1 | ||
end | ||
merge_nested_namespaces(item) | ||
end | ||
end | ||
if ctx.backend_name == "lsp" and ctx.lang == "clangd" then | ||
merge_nested_namespaces(_item) | ||
end | ||
return true | ||
end | ||
|
||
opts.post_parse_symbol = post_parse_symbol | ||
end, | ||
}, | ||
}, | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,82 @@ | ||
local default_vault_path = { | ||
"~/Documents/Main", | ||
"~/Projects/obsidian-data/Main", | ||
} | ||
|
||
local function resolve_obsidna_vault() | ||
for _, path in ipairs(default_vault_path) do | ||
local p = vim.fn.resolve(vim.fn.expand(path)) | ||
if vim.fn.isdirectory(p) == 1 then | ||
return p | ||
end | ||
end | ||
return vim.fn.resolve(vim.fn.expand(default_vault_path[1])) | ||
end | ||
|
||
---@type dora.core.package.PackageOption | ||
return { | ||
name = "dotvim.packages.obsidian", | ||
deps = { | ||
"dora.packages.extra.obsidian", | ||
}, | ||
plugins = { | ||
{ | ||
"obsidian.nvim", | ||
opts = { | ||
dir = resolve_obsidna_vault(), | ||
notes_subdir = "3-Resources/0-Zettel", | ||
log_level = vim.log.levels.WARN, | ||
daily_notes = { | ||
folder = "3-Resources/0-Dairy", | ||
date_format = "%Y-%m-%d", | ||
alias_format = "%B %-d, %Y", | ||
template = "Templates.nvim/daily-note.md", | ||
}, | ||
new_notes_location = "notes_subdir", | ||
completion = { | ||
nvim_cmp = true, | ||
}, | ||
templates = { | ||
subdir = "0-Assets", | ||
substitutions = { | ||
daily_title = function() | ||
return os.date("%B %-d, %Y") | ||
end, | ||
daily_date = function() | ||
return os.date("%Y-%m-%d") | ||
end, | ||
}, | ||
}, | ||
use_advanced_uri = true, | ||
mappings = {}, | ||
note_id_func = function(_) | ||
return ("%0x-%04x-%4x"):format( | ||
os.time(), | ||
math.random(0, 0xffff), | ||
math.random(0, 0xffff) | ||
) | ||
end, | ||
note_frontmatter_func = function(note) | ||
local out = { | ||
id = note.id, | ||
aliases = note.aliases, | ||
tags = note.tags, | ||
lastModifiedTime = os.date("%Y-%m-%d"), | ||
} | ||
if note.metadata ~= nil and not vim.tbl_isempty(note.metadata) then | ||
for k, v in pairs(note.metadata) do | ||
if out[k] == nil then | ||
out[k] = v | ||
end | ||
end | ||
end | ||
if out["createdTime"] == nil then | ||
out["createdTime"] = out["lastModifiedTime"] | ||
end | ||
return out | ||
end, | ||
yaml_parser = "yq", | ||
}, | ||
}, | ||
}, | ||
} |