mirror of
https://github.com/js0ny/dotfiles.git
synced 2025-12-21 00:33:00 +00:00
wayland-wm: sunsetr hyprlock
This commit is contained in:
parent
91b011a725
commit
47d967bfc9
26 changed files with 326 additions and 96 deletions
|
|
@ -6,8 +6,9 @@ local bufmap = {
|
|||
{ mode = "x", keys = "i", cmd = 'c*<C-r>"*', opt = { desc = "Add italic to selected text" } },
|
||||
{ mode = "x", keys = "b", cmd = 'c**<C-r>"**', opt = { desc = "Add bold to selected text" } },
|
||||
{ mode = "x", keys = "c", cmd = 'c`<CR><C-r>"<CR>`', opt = { desc = "Add code block to selected text" } },
|
||||
{ mode = "x", keys = "d", cmd = 'c~~<C-r>"~~', opt = { desc = "Add strikethrough to selected text" } },
|
||||
{ mode = "x", keys = "D", cmd = 'c~~<C-r>"~~', opt = { desc = "Add strikethrough to selected text" } },
|
||||
{ mode = "x", keys = "h", cmd = 'c==<C-r>"==', opt = { desc = "Add highlight to selected text" } },
|
||||
{ mode = "n", keys = "<Tab>", cmd = "za", opt = { desc = "Toggle folding under current level" } },
|
||||
}
|
||||
|
||||
-- local set_buf_keymaps_prefix = require("keymaps.utils").set_buf_keymaps_prefix
|
||||
|
|
|
|||
|
|
@ -10,6 +10,13 @@
|
|||
require("config.options")
|
||||
|
||||
local minimal = os.getenv("NVIM_MINIMAL") or os.getenv("EDITOR_POPUP")
|
||||
local disable_ai = os.getenv("DISABLE_AI_ASSISTANT") or "0"
|
||||
|
||||
if disable_ai == "1" then
|
||||
vim.g.ai_enabled = false
|
||||
else
|
||||
vim.g.ai_enabled = true
|
||||
end
|
||||
|
||||
if minimal == "1" then
|
||||
-- require("profiles.minimal")
|
||||
|
|
@ -50,6 +57,7 @@ if vim.g.neovide then
|
|||
vim.g.neovide_input_macos_option_key_is_meta = "only_left"
|
||||
end
|
||||
|
||||
-- TODO: Refractor this part to submodules
|
||||
-- 存储输入法状态的变量
|
||||
vim.g.input_layout = nil
|
||||
|
||||
|
|
|
|||
7
home/dot_config/nvim/lsp/svelte-language-server.lua
Normal file
7
home/dot_config/nvim/lsp/svelte-language-server.lua
Normal file
|
|
@ -0,0 +1,7 @@
|
|||
---@type vim.lsp.Config
|
||||
return {
|
||||
cmd = { "svelteserver" },
|
||||
root_markers = { "package.json", "svelte.config.js" },
|
||||
filetypes = { "svelte" },
|
||||
settings = {},
|
||||
}
|
||||
|
|
@ -44,13 +44,13 @@ opt.termguicolors = true
|
|||
|
||||
--- Fold
|
||||
opt.foldmethod = "expr"
|
||||
-- Folding provided by treesitter
|
||||
opt.foldexpr = "nvim_treesitter#foldexpr()"
|
||||
-- Use builtin Treesitter foldexpr
|
||||
-- See: https://github.com/nvim-treesitter/nvim-treesitter/commit/dd7bb795c48b5b9795bde0537bb29ddf9fb7b42d
|
||||
opt.foldexpr = "v:lua.vim.treesitter.foldexpr()"
|
||||
-- Disable fold at start
|
||||
opt.foldlevelstart = 99
|
||||
opt.foldlevel = 99
|
||||
opt.foldenable = false
|
||||
opt.foldlevelstart = 1
|
||||
opt.foldenable = true
|
||||
|
||||
-- Hide Command Line if empty
|
||||
opt.cmdheight = 0
|
||||
|
|
@ -79,3 +79,5 @@ vim.fn.matchadd("Conceal", [[\%u200b]], 10, -1, { conceal = "" })
|
|||
|
||||
opt.grepformat = "%f:%l:%c:%m"
|
||||
opt.grepprg = "rg --vimgrep"
|
||||
|
||||
vim.o.exrc = true
|
||||
|
|
|
|||
|
|
@ -96,7 +96,6 @@ local keymaps_basic = {
|
|||
cmd = "5e",
|
||||
opts = { desc = "Down 5 Lines" },
|
||||
},
|
||||
{ keys = "<Tab>", cmd = "<C-w><C-w>", opts = { desc = "Focus on other panel" } },
|
||||
-- { keys = "<CR>", cmd = "%" },
|
||||
{ keys = "Y", cmd = "y$", opts = { desc = "Yank to End of Line" } },
|
||||
{ mode = mode_arrow, keys = "J", cmd = "5j" },
|
||||
|
|
|
|||
|
|
@ -8,6 +8,7 @@ return {
|
|||
{ import = "plugins.lang.lua" },
|
||||
{ import = "plugins.lang.verilog" },
|
||||
{ import = "plugins.lang.treesitter" },
|
||||
{ import = "plugins.lang.neorg" },
|
||||
{ import = "plugins.mod.trouble-nvim" },
|
||||
{ import = "plugins.mod.conform-nvim" },
|
||||
}
|
||||
|
|
|
|||
|
|
@ -75,7 +75,7 @@ return {
|
|||
enable = false,
|
||||
},
|
||||
templates = {
|
||||
folder = "_Global/LuaTemplates",
|
||||
folder = "90 - System/LuaTemplates",
|
||||
date_format = "%Y-%m-%d",
|
||||
time_format = "%H:%M",
|
||||
substitutions = {
|
||||
|
|
@ -87,51 +87,71 @@ return {
|
|||
},
|
||||
---@return table
|
||||
frontmatter = {
|
||||
-- Update frontmatter in order
|
||||
func = function(note)
|
||||
-- Add the title of the note as an alias.
|
||||
if note.title then
|
||||
note:add_alias(note.title)
|
||||
end
|
||||
local meta = note.metadata or {}
|
||||
|
||||
-- Force to use UUID as the note id.
|
||||
local note_id = uuid()
|
||||
if note.metadata.id == nil then
|
||||
-- ID: Rule: Generate if not present, never overwrite
|
||||
local note_id = meta.uuid
|
||||
if note_id == nil then
|
||||
note_id = uuid()
|
||||
else
|
||||
note_id = note.metadata.id
|
||||
end
|
||||
|
||||
local out = {
|
||||
-- id = note_id,
|
||||
aliases = note.aliases,
|
||||
tags = note.tags,
|
||||
title = note.id,
|
||||
-- date = os.date("%Y-%m-%dT00:00:00"),
|
||||
-- mtime = os.date("%Y-%m-%dT%H:%M:%S"),
|
||||
}
|
||||
-- Aliases: Always ensure filename is in aliases
|
||||
local aliases = meta.aliases or note.aliases or {}
|
||||
if type(aliases) ~= "table" then
|
||||
aliases = { aliases }
|
||||
end
|
||||
|
||||
-- `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 not vim.tbl_isempty(note.metadata) then
|
||||
for k, v in pairs(note.metadata) do
|
||||
out[k] = v
|
||||
if note.title and note.id and note.title ~= note.id then
|
||||
local is_duplicate = false
|
||||
for _, v in pairs(aliases) do
|
||||
if v == note.id then
|
||||
is_duplicate = true
|
||||
break
|
||||
end
|
||||
end
|
||||
|
||||
if not is_duplicate then
|
||||
table.insert(aliases, note.id)
|
||||
end
|
||||
end
|
||||
|
||||
-- Force to update mtime.
|
||||
local out = {
|
||||
uuid = note_id,
|
||||
aliases = aliases,
|
||||
tags = meta.tags or note.tags,
|
||||
title = meta.title or note.id, -- 优先保留 metadata 中的 title,否则用 note.id
|
||||
}
|
||||
|
||||
-- 5. 合并其他自定义 Metadata
|
||||
-- 使用 vim.tbl_extend "force" 策略:
|
||||
-- 将 current_metadata 中的所有字段强制合并到 out 中。
|
||||
-- 这样可以确保:所有手动添加的字段(如 author, category 等)都不会丢失。
|
||||
-- 同时,如果 metadata 里本来就有 id,这里会再次确认覆盖,保证一致性。
|
||||
out = vim.tbl_extend("force", out, meta)
|
||||
|
||||
-- 6. 强制更新 mtime (这是你希望每次保存都更新的)
|
||||
out.mtime = os.date("%Y-%m-%dT%H:%M:%S")
|
||||
|
||||
-- 7. 保持 date (创建时间) 不变
|
||||
-- 如果 metadata 里没有 date,也许你想补一个?如果不需要,可以删掉下面这行
|
||||
if out.date == nil then
|
||||
out.date = os.date("%Y-%m-%dT%H:%M:%S")
|
||||
end
|
||||
|
||||
return out
|
||||
end,
|
||||
},
|
||||
daily_notes = {
|
||||
folder = "_Global/Periodic",
|
||||
folder = "00 - Journal/Daily",
|
||||
date_format = "%Y-%m-%d",
|
||||
default_tags = { "daily" },
|
||||
-- default_tags = { "daily" },
|
||||
template = nil,
|
||||
},
|
||||
-- see below for full list of options 👇
|
||||
attachments = {
|
||||
img_folder = "_Global/Assets",
|
||||
img_folder = "90 - System/Assets",
|
||||
img_name_func = function()
|
||||
return string.format("%s-", os.time())
|
||||
end,
|
||||
|
|
|
|||
65
home/dot_config/nvim/lua/plugins/lang/neorg.lua
Normal file
65
home/dot_config/nvim/lua/plugins/lang/neorg.lua
Normal file
|
|
@ -0,0 +1,65 @@
|
|||
return {
|
||||
-- {
|
||||
-- "benlubas/neorg-interim-ls",
|
||||
-- },
|
||||
-- {
|
||||
-- "nvim-neorg/neorg",
|
||||
-- lazy = false, -- Disable lazy loading as some `lazy.nvim` distributions set `lazy = true` by default
|
||||
--
|
||||
-- version = "*", -- Pin Neorg to the latest stable release
|
||||
-- config = true,
|
||||
-- options = {
|
||||
-- load = {
|
||||
-- ["core.defaults"] = {}, -- Load all the default modules
|
||||
-- ["core.concealer"] = {}, -- Allows for use of icons
|
||||
-- ["core.norg.dirman"] = { -- Manages Neorg workspaces
|
||||
-- config = {
|
||||
-- workspaces = {
|
||||
-- notes = "~/OrgFiles",
|
||||
-- },
|
||||
-- },
|
||||
-- default_workspace = "notes",
|
||||
-- },
|
||||
-- ["core.neorgcmd"] = {},
|
||||
-- ["core.ui.calendar"] = {},
|
||||
-- ["core.looing-glass"] = {},
|
||||
-- ["core.latex.renderer"] = {},
|
||||
-- ["core.completion"] = {
|
||||
-- config = {
|
||||
-- engine = {
|
||||
-- module_name = "external.lsp-completion",
|
||||
-- },
|
||||
-- },
|
||||
-- },
|
||||
-- ["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}`
|
||||
-- people = {
|
||||
-- enable = false,
|
||||
--
|
||||
-- -- path to the file you're like to use with the `{@x` syntax, relative to the
|
||||
-- -- workspace root, without the `.norg` at the end.
|
||||
-- -- ie. `folder/people` results in searching `$/folder/people.norg` for headings.
|
||||
-- -- Note that this will change with your workspace, so it fails silently if the file
|
||||
-- -- doesn't exist
|
||||
-- path = "people",
|
||||
-- },
|
||||
-- },
|
||||
-- },
|
||||
-- },
|
||||
-- },
|
||||
-- },
|
||||
-- },
|
||||
}
|
||||
|
|
@ -12,12 +12,12 @@ return {
|
|||
"BufReadPre",
|
||||
},
|
||||
opts = {
|
||||
ensure_installed = { "c", "lua", "vim", "vimdoc", "markdown", "markdown_inline", "latex" },
|
||||
ensure_installed = { "c", "lua", "vim", "vimdoc", "markdown" },
|
||||
highlight = { enable = true },
|
||||
indent = { enable = true },
|
||||
},
|
||||
config = function()
|
||||
require('nvim-treesitter.configs').setup({ highlight = { enable = true } })
|
||||
end
|
||||
config = function(_, opts)
|
||||
require("nvim-treesitter.configs").setup(opts)
|
||||
end,
|
||||
},
|
||||
}
|
||||
|
|
|
|||
|
|
@ -3,18 +3,19 @@ return {
|
|||
cmd = "Copilot",
|
||||
build = ":Copilot auth",
|
||||
event = "BufReadPost",
|
||||
enabled = vim.g.ai_enabled,
|
||||
opts = {
|
||||
suggestion = {
|
||||
enabled = not vim.g.ai_cmp,
|
||||
auto_trigger = true,
|
||||
hide_during_completion = vim.g.ai_cmp,
|
||||
-- hide_during_completion = vim.g.ai_cmp,
|
||||
keymap = {
|
||||
accept = "<M-l>", -- Inspired from zed
|
||||
next = "<M-]>",
|
||||
prev = "<M-[>",
|
||||
},
|
||||
},
|
||||
panel = { enabled = true },
|
||||
-- Disable <M-CR> to open Copilot panel
|
||||
panel = { enabled = false },
|
||||
filetypes = {
|
||||
markdown = true,
|
||||
help = true,
|
||||
|
|
|
|||
|
|
@ -86,6 +86,10 @@ return {
|
|||
enabled = true,
|
||||
-- See: ../lang/markdown/obsidian-nvim.lua
|
||||
img_dirs = { "90 - System/Assets" },
|
||||
math = {
|
||||
enabled = true,
|
||||
font_size = "small",
|
||||
},
|
||||
},
|
||||
},
|
||||
keys = {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue