mirror of
https://github.com/js0ny/dotfiles.git
synced 2025-12-21 08:43:00 +00:00
feat?(nvim): Migrate to 0.11
This commit is contained in:
parent
48331347fd
commit
124703b2e0
6 changed files with 66 additions and 11 deletions
5
tools/nvim/lsp/clangd.lua
Normal file
5
tools/nvim/lsp/clangd.lua
Normal file
|
|
@ -0,0 +1,5 @@
|
||||||
|
return {
|
||||||
|
cmd = { "clangd", "--background-index" },
|
||||||
|
root_markers = { "compile_commands.json", "compile_flags.txt", ".clangd" },
|
||||||
|
filetypes = { "c", "cpp" },
|
||||||
|
}
|
||||||
1
tools/nvim/lsp/luals.lua
Normal file
1
tools/nvim/lsp/luals.lua
Normal file
|
|
@ -0,0 +1 @@
|
||||||
|
return {}
|
||||||
14
tools/nvim/lua/config/migration.lua
Normal file
14
tools/nvim/lua/config/migration.lua
Normal file
|
|
@ -0,0 +1,14 @@
|
||||||
|
local nvim_version = vim.version()
|
||||||
|
|
||||||
|
if nvim_version.minor ~= 11 then
|
||||||
|
return
|
||||||
|
end
|
||||||
|
|
||||||
|
vim.diagnostic.config({
|
||||||
|
virtual_lines = true,
|
||||||
|
})
|
||||||
|
|
||||||
|
vim.lsp.enable({
|
||||||
|
"clangd",
|
||||||
|
"luals",
|
||||||
|
})
|
||||||
|
|
@ -2,7 +2,10 @@ return {
|
||||||
{
|
{
|
||||||
"rmagatti/auto-session",
|
"rmagatti/auto-session",
|
||||||
event = "BufReadPre",
|
event = "BufReadPre",
|
||||||
|
cmd = {
|
||||||
|
"SessionSearch",
|
||||||
|
"SessionSave",
|
||||||
|
},
|
||||||
opts = {
|
opts = {
|
||||||
suppressed_dirs = { "~/", "~/Projects", "~/Downloads", "/" },
|
suppressed_dirs = { "~/", "~/Projects", "~/Downloads", "/" },
|
||||||
},
|
},
|
||||||
|
|
|
||||||
|
|
@ -27,7 +27,7 @@ return {
|
||||||
build = ":MasonUpdate",
|
build = ":MasonUpdate",
|
||||||
opts_extend = { "ensure_installed" },
|
opts_extend = { "ensure_installed" },
|
||||||
opts = {
|
opts = {
|
||||||
ensure_installed = require("config.servers").servers,
|
-- ensure_installed = require("config.servers").servers,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
|
@ -38,8 +38,8 @@ return {
|
||||||
{ "neovim/nvim-lspconfig" },
|
{ "neovim/nvim-lspconfig" },
|
||||||
},
|
},
|
||||||
opts = {
|
opts = {
|
||||||
ensure_installed = require("config.servers").servers,
|
-- ensure_installed = require("config.servers").servers,
|
||||||
automatic_installation = false,
|
-- automatic_installation = false,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
{ import = "plugins.mod.conform-nvim" },
|
{ import = "plugins.mod.conform-nvim" },
|
||||||
|
|
|
||||||
|
|
@ -7,11 +7,44 @@ return {
|
||||||
---@type snacks.Config
|
---@type snacks.Config
|
||||||
opts = {
|
opts = {
|
||||||
-- bigfile = { enabled = true },
|
-- bigfile = { enabled = true },
|
||||||
dashboard = { enabled = true },
|
dashboard = {
|
||||||
explorer = { enabled = true },
|
enabled = true,
|
||||||
|
preset = {
|
||||||
|
keys = {
|
||||||
|
{ key = "p", icon = " ", desc = "查找项目", action = "<cmd>Telescope projects<CR>" },
|
||||||
|
{ key = "h", icon = " ", desc = "历史文件", action = "<cmd>Telescope oldfiles<CR>" },
|
||||||
|
{ key = "l", icon = " ", desc = "加载会话", action = "<cmd>SessionSearch<CR>" },
|
||||||
|
{
|
||||||
|
key = "c",
|
||||||
|
icon = " ",
|
||||||
|
desc = "转到设置",
|
||||||
|
action = "<cmd>Telescope find_files cwd=~/.config/nvim<CR>",
|
||||||
|
},
|
||||||
|
{ key = "q", icon = " ", desc = "退出", action = "<cmd>qa<CR>" },
|
||||||
|
},
|
||||||
|
},
|
||||||
|
sections = {
|
||||||
|
{ section = "header" },
|
||||||
|
{ icon = " ", title = "Keymaps", section = "keys", indent = 2, padding = 1 },
|
||||||
|
{ icon = " ", title = "Recent Files", section = "recent_files", indent = 2, padding = 1 },
|
||||||
|
{ icon = " ", title = "Projects", section = "projects", indent = 2, padding = 1 },
|
||||||
|
{ section = "startup" },
|
||||||
|
},
|
||||||
|
},
|
||||||
|
explorer = {
|
||||||
|
-- TODO: Remap some keys in explorer
|
||||||
|
-- win = {
|
||||||
|
-- list = {
|
||||||
|
-- keys = {
|
||||||
|
-- ["l"] = "focus_input",
|
||||||
|
-- ["i"] = "confirm",
|
||||||
|
-- ["O"] = "explorer_open", -- Open with system default
|
||||||
|
-- },
|
||||||
|
-- },
|
||||||
|
-- },
|
||||||
|
},
|
||||||
indent = { enabled = true },
|
indent = { enabled = true },
|
||||||
-- input = { enabled = true },
|
-- input = { enabled = true },
|
||||||
-- picker = { enabled = true },
|
|
||||||
-- notifier = { enabled = true },
|
-- notifier = { enabled = true },
|
||||||
-- quickfile = { enabled = true },
|
-- quickfile = { enabled = true },
|
||||||
-- scope = { enabled = true },
|
-- scope = { enabled = true },
|
||||||
|
|
@ -25,9 +58,8 @@ return {
|
||||||
"<leader>ft",
|
"<leader>ft",
|
||||||
function()
|
function()
|
||||||
require("snacks").explorer()
|
require("snacks").explorer()
|
||||||
end
|
end,
|
||||||
,
|
desc = "Toggle File Explorer",
|
||||||
desc = "Toggle File Explorer"
|
|
||||||
},
|
},
|
||||||
}
|
},
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue