适配我的termux、架构判断提取为全局变量、重写ufo使用lsp折叠相关配置

This commit is contained in:
tiny 2026-04-26 01:09:44 +00:00
parent 08a226d9ee
commit ca576a6090
7 changed files with 33 additions and 37 deletions

View file

@ -2,18 +2,9 @@
-- === 光标移动neovide
-- ===
-- 判断 CPU 架构
local arch = jit and jit.arch or ""
local is_arm = arch:match("arm") or arch:match("aarch64")
if is_arm then
vim.o.guifont = "ComicShannsMono Nerd Font:h24"
end
vim.keymap.set('n', '<sC-c>', '"+y', { noremap = true })
vim.keymap.set('v', '<sC-c>', '"+y', { noremap = true })
if vim.g.neovide then
if not is_arm then
vim.env.HTTP_PROXY = "http://127.0.0.1:7897"
vim.env.HTTPS_PROXY = "http://127.0.0.1:7897"
end
-- https://github.com/neovide/neovide/issues/1282
vim.keymap.set('n', '<sC-v>', '"+p', { noremap = true })
vim.keymap.set('v', '<sC-v>', '"+P', { noremap = true })
@ -22,9 +13,15 @@ if vim.g.neovide then
vim.keymap.set('t', '<sC-v>', '<C-\\><C-n>"+Pi', { noremap = true })
vim.g.neovide_opacity = 0.75
-- vim.o.guifont = "ComicShannsMono Nerd Font:h16" -- text below applies for VimScript
vim.o.guifont = "Ioskeley Mono:h15" -- text below applies for VimScript
vim.o.guifont = "Ioskeley_Mono,Noto_Sans_CJK_SC:h15" -- text below applies for VimScript
-- 全屏可以在i3和sway的配置中设置
-- vim.g.neovide_fullscreen = true
if not IS_ARM then
vim.env.HTTP_PROXY = "http://127.0.0.1:7897"
vim.env.HTTPS_PROXY = "http://127.0.0.1:7897"
else
vim.o.guifont = "Ioskeley_Mono,Noto_Sans_CJK_SC:h24"
end
end
-- ===
-- === map function

View file

@ -71,6 +71,10 @@ autocmd BufLeave * :silent !fcitx5-remote -c
]])
-- 意为: 当 进入插入模式、创建Buf、进入Buf、离开Buf 时 触发shell命令 fcitx-remote -c 关闭输入法,改为英文输入
-- 架构判断
local arch = jit and jit.arch or ""
_G.IS_ARM = arch:match("arm") or arch:match("aarch64") ~= nil
-- 日志高亮关键字
vim.filetype.add({
extension = { -- 后缀名

View file

@ -7,9 +7,7 @@ local function mapkey(mode, lhs, rhs, opts)
end
local function mapcmd(key, cmd)
vim.keymap.set("n", key, function()
vim.cmd(cmd)
end, { silent = true })
vim.keymap.set("n", key, "<Cmd>" .. cmd .. "<CR>", { silent = true })
end
local function maplua(modes, key, action, desc)
@ -133,10 +131,10 @@ mapkey({ "n", "x", "o" }, "<LEADER>n", "<C-w>h")
mapkey({ "n", "x", "o" }, "<LEADER>i", "<C-w>l")
-- 使用s + 新方向键 进行分屏
mapcmd("su", "set nosplitbelow<CR>:split<CR>:set splitbelow")
mapcmd("se", "set splitbelow<CR>:split")
mapcmd("sn", "set nosplitright<CR>:vsplit<CR>:set splitright")
mapcmd("si", "set splitright<CR>:vsplit")
mapcmd("su", "leftabove split") -- 在上方分屏
mapcmd("se", "rightbelow split") -- 在下方分屏
mapcmd("sn", "leftabove vsplit") -- 在左侧分屏
mapcmd("si", "rightbelow vsplit") -- 在右侧分屏
-- 使用方向键来调整窗口大小
mapcmd("<up>", "res +5")
@ -304,9 +302,7 @@ function map:key(mode, lhs, rhs)
end
function map:cmd(key, cmd)
vim.keymap.set("n", key, function()
vim.cmd(cmd)
end, { silent = true })
vim.keymap.set("n", key, "<Cmd>" .. cmd .. "<CR>", { silent = true })
end
function map:lua(key, txt_or_func)