fix(nvim): LuaSnip auto expand, snack image preview for md

This commit is contained in:
js0ny 2025-04-13 17:11:04 +01:00
parent 085c2995da
commit 8d0d95420a
8 changed files with 25 additions and 28 deletions

View file

@ -1,12 +1,12 @@
[linux] [linux]
systemd: systemd:
{{LN}} {{DOTFILES}}/platforms/{{OS}}/systemd {{XDG_CONFIG_HOME}}/systemd/ {{LN}} {{DOTFILES}}/platforms/{{OS}}/systemd {{XDG_CONFIG_HOME}}/systemd
[linux] [linux]
keyd: keyd:
-which keyd || sudo pacman -S keyd --noconfirm || sudo apt install keyd --yes || @just build_keyd -which keyd || sudo pacman -S keyd --noconfirm || sudo apt install keyd --yes || @just build_keyd
sudo cp {{DOTFILES}}/platforms/linux/keyd/keyd.conf /etc/keyd/default.conf sudo cp {{DOTFILES}}/platforms/linux/keyd/default.conf /etc/keyd/default.conf
mkdir -p {{XDG_CONFIG_HOME}}/keyd mkdir -p {{XDG_CONFIG_HOME}}/keyd
{{LN}} {{DOTFILES}}/platforms/linux/keyd/app.conf {{XDG_CONFIG_HOME}}/keyd/app.conf {{LN}} {{DOTFILES}}/platforms/linux/keyd/app.conf {{XDG_CONFIG_HOME}}/keyd/app.conf
sudo systemctl enable --now keyd.service sudo systemctl enable --now keyd.service

View file

@ -4,7 +4,7 @@ Documentation=man:keyd-application-mapper(1) https://github.com/rvaiya/keyd
[Service] [Service]
Type=forking Type=forking
ExecStart=/usr/bin/keyd-application-mapper -d ExecStart=/usr/local/bin/keyd-application-mapper -d
ExecStop=pkill keyd-applicatio ExecStop=pkill keyd-applicatio
Restart=on-failure Restart=on-failure

View file

@ -23,6 +23,7 @@ return {
integrations = { integrations = {
-- lualine = true, -- lualine = true,
"lualine", "lualine",
"blink_cmp"
}, },
}, },
}, },

View file

@ -1,11 +1,22 @@
return { return {
{ import = "plugins.mod.blink-cmp" }, { import = "plugins.mod.blink-cmp" },
-- { import = "plugins.mod.nvim-cmp" },
{ {
"L3MON4D3/LuaSnip", "L3MON4D3/LuaSnip",
build = "make install_jsregexp", build = "make install_jsregexp",
event = "InsertEnter", event = "InsertEnter",
config = function() config = function()
require("luasnip.loaders.from_vscode").lazy_load({ paths = "~/.config/lsp-snippets" }) require("luasnip.loaders.from_vscode").lazy_load({ paths = "~/.config/lsp-snippets" })
require("luasnip").setup({
history = true,
enable_autosnippets = true,
})
end, end,
}, },
{
"js0ny/luasnip-latex-snippets.nvim",
dependencies = { "L3MON4D3/LuaSnip", "lervag/vimtex" },
ft = { "tex", "latex", "markdown", "org" },
opts = {}
}
} }

View file

@ -8,25 +8,14 @@ return {
{ import = "plugins.lang.lua" }, { import = "plugins.lang.lua" },
{ import = "plugins.lang.treesitter" }, { import = "plugins.lang.treesitter" },
{ import = "plugins.mod.trouble-nvim" }, { import = "plugins.mod.trouble-nvim" },
{ -- Remove mason and use system package manager
"williamboman/mason.nvim",
cmd = "Mason",
build = ":MasonUpdate",
-- opts_extend = { "ensure_installed" },
opts = {
-- ensure_installed = require("config.servers").servers,
},
},
-- { -- {
-- "williamboman/mason-lspconfig.nvim", -- "williamboman/mason.nvim",
-- event = "BufReadPre", -- cmd = "Mason",
-- dependencies = { -- build = ":MasonUpdate",
-- { "williamboman/mason.nvim" }, -- -- opts_extend = { "ensure_installed" },
-- { "neovim/nvim-lspconfig" },
-- },
-- opts = { -- opts = {
-- -- ensure_installed = require("config.servers").servers, -- -- ensure_installed = require("config.servers").servers,
-- -- automatic_installation = false,
-- }, -- },
-- }, -- },
{ import = "plugins.mod.conform-nvim" }, { import = "plugins.mod.conform-nvim" },

View file

@ -12,7 +12,7 @@ return {
"BufReadPre", "BufReadPre",
}, },
opts = { opts = {
ensure_installed = { "c", "lua", "vim", "vimdoc", "markdown", "markdown_inline" }, ensure_installed = { "c", "lua", "vim", "vimdoc", "markdown", "markdown_inline", "latex" },
highlight = { enable = true }, highlight = { enable = true },
indent = { enable = true }, indent = { enable = true },
}, },

View file

@ -12,7 +12,6 @@ return {
}, },
config = function() config = function()
local cmp = require("cmp") local cmp = require("cmp")
local lspconfig = require("lspconfig")
local capabilities = require("cmp_nvim_lsp").default_capabilities() local capabilities = require("cmp_nvim_lsp").default_capabilities()
local servers_module = require("config.servers") local servers_module = require("config.servers")
local luasnip = require("luasnip") local luasnip = require("luasnip")
@ -108,10 +107,5 @@ return {
matching = { disallow_symbol_nonprefix_matching = false }, matching = { disallow_symbol_nonprefix_matching = false },
}) })
-- 配置 LSP end,
for _, server in ipairs(servers) do
local config = vim.tbl_deep_extend("force", default_server_config, servers_config[server] or {})
lspconfig[server].setup(config)
end
end,
} }

View file

@ -41,7 +41,9 @@ return {
-- scroll = { enabled = true }, -- scroll = { enabled = true },
statuscolumn = { enabled = true }, statuscolumn = { enabled = true },
-- words = { enabled = true }, -- words = { enabled = true },
image = { enabled = true }, image = { enabled = true,
img_dirs = { "_Global/Assets" }
},
}, },
keys = { keys = {
-- { -- {