Remove md guide

This commit is contained in:
2025-10-24 19:50:16 +08:00
parent f4fcf0e47c
commit 0282159de6
3 changed files with 26 additions and 73 deletions

View File

@@ -1,8 +1,11 @@
-- Prevent cargo compiler from being loaded
vim.g.current_compiler = 'custom'
-- Load persistent configuration from .workspace.lua
local ws_file = "./.nvim.workspace.lua"
local loaded, workspace = pcall(dofile, ws_file)
if not loaded then
workspace = { args = { }, build_type = "debug", binary = "blog-server" }
workspace = { args = {}, build_type = "debug", binary = "blog-server" }
end
local build_folder
@@ -16,27 +19,37 @@ local function updateBuildEnv()
-- The run (F6) arguments
vim.opt.makeprg = "cargo build"
vim.g.cargo_makeprg_params = 'build'
if workspace.build_type == "release" then
vim.opt.makeprg = vim.opt.makeprg .. " --release"
vim.g.cargo_makeprg_params = vim.g.cargo_makeprg_params .. " --release"
end
-- Rust compiler error format
vim.opt.errorformat = {
-- Main error/warning line with file:line:col format
'%E%>error%m,' .. -- Start of error block
'%W%>warning: %m,' .. -- Start of warning block
'%-G%>help: %m,' .. -- Ignore help lines
'%-G%>note: %m,' .. -- Ignore note lines
'%C%> --> %f:%l:%c,' .. -- Continuation: file location
'%Z%>%p^%m,' .. -- End: column pointer (^^^)
'%C%>%s%#|%.%#,' .. -- Continuation: context lines with |
'%C%>%s%#%m,' .. -- Continuation: other context
'%-G%.%#' -- Ignore everything else
'%E%>error%m,' .. -- Start of error block
'%W%>warning: %m,' .. -- Start of warning block
'%-G%>help: %m,' .. -- Ignore help lines
'%-G%>note: %m,' .. -- Ignore note lines
'%C%> --> %f:%l:%c,' .. -- Continuation: file location
'%Z%>%p^%m,' .. -- End: column pointer (^^^)
'%C%>%s%#|%.%#,' .. -- Continuation: context lines with |
'%C%>%s%#%m,' .. -- Continuation: other context
'%-G%.%#' -- Ignore everything else
}
end
updateBuildEnv()
-- Prevent Vim's built-in rust ftplugin from loading the cargo compiler
vim.api.nvim_create_autocmd("FileType", {
pattern = "rust",
callback = function()
vim.b.current_compiler = 'custom'
end,
})
local function writeWorkspace()
-- A very minimal serializer for workspace configuration
local s = { l = "", ls = {}, i = "" }
@@ -107,7 +120,7 @@ vim.api.nvim_create_user_command("Args", function(a) updateArgs(a.fargs) end,
{ nargs = '*', desc = "Update run/debug arguments" })
if dap_ok then
local lldb_init = { }
local lldb_init = {}
dap_configs = {
{
name = 'test all',