mirror of
https://github.com/LazyVim/LazyVim.git
synced 2026-07-25 14:01:06 +00:00
[feature][nvim][lazyvim] customer
[what] 自定义配置修改 [why] as what [how] as what
This commit is contained in:
parent
879e29504d
commit
bb0749da47
13 changed files with 59 additions and 22 deletions
|
|
@ -10,7 +10,7 @@ local defaults = {
|
|||
-- colorscheme can be a string like `catppuccin` or a function that will load the colorscheme
|
||||
---@type string|fun()
|
||||
colorscheme = function()
|
||||
require("tokyonight").load()
|
||||
require("nightfox").load()
|
||||
end,
|
||||
-- load the default settings
|
||||
defaults = {
|
||||
|
|
|
|||
|
|
@ -75,7 +75,7 @@ map("v", "<", "<gv")
|
|||
map("v", ">", ">gv")
|
||||
|
||||
-- lazy
|
||||
map("n", "<leader>l", "<cmd>Lazy<cr>", { desc = "Lazy" })
|
||||
-- map("n", "<leader>l", "<cmd>Lazy<cr>", { desc = "Lazy" })
|
||||
|
||||
-- new file
|
||||
map("n", "<leader>fn", "<cmd>enew<cr>", { desc = "New File" })
|
||||
|
|
@ -135,7 +135,7 @@ map("n", "<leader>qq", "<cmd>qa<cr>", { desc = "Quit all" })
|
|||
map("n", "<leader>ui", vim.show_pos, { desc = "Inspect Pos" })
|
||||
|
||||
-- LazyVim Changelog
|
||||
map("n", "<leader>L", function() Util.news.changelog() end, { desc = "LazyVim Changelog" })
|
||||
-- map("n", "<leader>L", function() Util.news.changelog() end, { desc = "LazyVim Changelog" })
|
||||
|
||||
-- floating terminal
|
||||
local lazyterm = function() Util.terminal(nil, { cwd = Util.root() }) end
|
||||
|
|
|
|||
|
|
@ -55,8 +55,8 @@ return {
|
|||
end,
|
||||
},
|
||||
mapping = cmp.mapping.preset.insert({
|
||||
["<C-n>"] = cmp.mapping.select_next_item({ behavior = cmp.SelectBehavior.Insert }),
|
||||
["<C-p>"] = cmp.mapping.select_prev_item({ behavior = cmp.SelectBehavior.Insert }),
|
||||
["<C-j>"] = cmp.mapping.select_next_item({ behavior = cmp.SelectBehavior.Insert }),
|
||||
["<C-k>"] = cmp.mapping.select_prev_item({ behavior = cmp.SelectBehavior.Insert }),
|
||||
["<C-b>"] = cmp.mapping.scroll_docs(-4),
|
||||
["<C-f>"] = cmp.mapping.scroll_docs(4),
|
||||
["<C-Space>"] = cmp.mapping.complete(),
|
||||
|
|
|
|||
|
|
@ -7,6 +7,9 @@ return {
|
|||
opts = { style = "moon" },
|
||||
},
|
||||
|
||||
-- nightfox
|
||||
{ "EdenEast/nightfox.nvim", lazy = true, name = "nightfox" },
|
||||
|
||||
-- catppuccin
|
||||
{
|
||||
"catppuccin/nvim",
|
||||
|
|
|
|||
|
|
@ -22,8 +22,10 @@ return {
|
|||
end,
|
||||
desc = "Explorer NeoTree (cwd)",
|
||||
},
|
||||
{ "<leader>e", "<leader>fe", desc = "Explorer NeoTree (root dir)", remap = true },
|
||||
{ "<leader>E", "<leader>fE", desc = "Explorer NeoTree (cwd)", remap = true },
|
||||
-- { "<leader>e", "<leader>fe", desc = "Explorer NeoTree (root dir)", remap = true },
|
||||
-- { "<leader>E", "<leader>fE", desc = "Explorer NeoTree (cwd)", remap = true },
|
||||
{ "<leader>a", "<leader>fe", desc = "Explorer NeoTree (root dir)", remap = true },
|
||||
{ "<leader>A", "<leader>fE", desc = "Explorer NeoTree (cwd)", remap = true },
|
||||
{
|
||||
"<leader>ge",
|
||||
function()
|
||||
|
|
@ -44,7 +46,7 @@ return {
|
|||
end,
|
||||
init = function()
|
||||
if vim.fn.argc(-1) == 1 then
|
||||
local stat = vim.loop.fs_stat(vim.fn.argv(0))
|
||||
local stat = vim.loop.fs_stat(vim.f.argv(0))
|
||||
if stat and stat.type == "directory" then
|
||||
require("neo-tree")
|
||||
end
|
||||
|
|
@ -133,13 +135,16 @@ return {
|
|||
"<cmd>Telescope buffers sort_mru=true sort_lastused=true<cr>",
|
||||
desc = "Switch Buffer",
|
||||
},
|
||||
{ "<leader>/", Util.telescope("live_grep"), desc = "Grep (root dir)" },
|
||||
-- { "<leader>/", Util.telescope("live_grep"), desc = "Grep (root dir)" },
|
||||
{ "<leader>fw", Util.telescope("live_grep"), desc = "Grep (root dir)" },
|
||||
{ "<leader>:", "<cmd>Telescope command_history<cr>", desc = "Command History" },
|
||||
{ "<leader><space>", Util.telescope("files"), desc = "Find Files (root dir)" },
|
||||
-- find
|
||||
{ "<leader>fb", "<cmd>Telescope buffers sort_mru=true sort_lastused=true<cr>", desc = "Buffers" },
|
||||
-- { "<leader>fb", "<cmd>Telescope buffers sort_mru=true sort_lastused=true<cr>", desc = "Buffers" },
|
||||
{ "bu", "<cmd>Telescope buffers sort_mru=true sort_lastused=true<cr>", desc = "Buffers" },
|
||||
{ "<leader>fc", Util.telescope.config_files(), desc = "Find Config File" },
|
||||
{ "<leader>ff", Util.telescope("files"), desc = "Find Files (root dir)" },
|
||||
-- { "<leader>ff", Util.telescope("files"), desc = "Find Files (root dir)" },
|
||||
{ "<C-p>", Util.telescope("files"), desc = "Find Files (root dir)" },
|
||||
{ "<leader>fF", Util.telescope("files", { cwd = false }), desc = "Find Files (cwd)" },
|
||||
{ "<leader>fr", "<cmd>Telescope oldfiles<cr>", desc = "Recent" },
|
||||
{ "<leader>fR", Util.telescope("oldfiles", { cwd = vim.loop.cwd() }), desc = "Recent (cwd)" },
|
||||
|
|
@ -289,8 +294,20 @@ return {
|
|||
end,
|
||||
})
|
||||
end
|
||||
local actions = require("telescope.actions")
|
||||
opts.defaults = vim.tbl_deep_extend("force", opts.defaults or {}, {
|
||||
mappings = { n = { s = flash }, i = { ["<c-s>"] = flash } },
|
||||
mappings = {
|
||||
n = { s = flash },
|
||||
i = {
|
||||
["<c-s>"] = flash,
|
||||
["<C-n>"] = actions.cycle_history_next,
|
||||
["<C-p>"] = actions.cycle_history_prev,
|
||||
["<C-j>"] = actions.move_selection_next,
|
||||
["<C-k>"] = actions.move_selection_previous,
|
||||
["<C-c>"] = actions.close,
|
||||
["<esc>"] = actions.close,
|
||||
},
|
||||
},
|
||||
})
|
||||
end,
|
||||
},
|
||||
|
|
@ -487,9 +504,11 @@ return {
|
|||
keys = {
|
||||
{ "]t", function() require("todo-comments").jump_next() end, desc = "Next todo comment" },
|
||||
{ "[t", function() require("todo-comments").jump_prev() end, desc = "Previous todo comment" },
|
||||
{ "<leader>xt", "<cmd>TodoTrouble<cr>", desc = "Todo (Trouble)" },
|
||||
-- { "<leader>xt", "<cmd>TodoTrouble<cr>", desc = "Todo (Trouble)" },
|
||||
{ "<leader>tt", "<cmd>TodoTrouble<cr>", desc = "Todo (Trouble)" },
|
||||
{ "<leader>xT", "<cmd>TodoTrouble keywords=TODO,FIX,FIXME<cr>", desc = "Todo/Fix/Fixme (Trouble)" },
|
||||
{ "<leader>st", "<cmd>TodoTelescope<cr>", desc = "Todo" },
|
||||
-- { "<leader>st", "<cmd>TodoTelescope<cr>", desc = "Todo" },
|
||||
{ "<leader>tl", "<cmd>TodoTelescope<cr>", desc = "Todo" },
|
||||
{ "<leader>sT", "<cmd>TodoTelescope keywords=TODO,FIX,FIXME<cr>", desc = "Todo/Fix/Fixme" },
|
||||
},
|
||||
},
|
||||
|
|
|
|||
|
|
@ -22,6 +22,8 @@ return {
|
|||
end
|
||||
|
||||
local opts = {
|
||||
min_width = 100,
|
||||
max_width = { 100, 0.2 },
|
||||
attach_mode = "global",
|
||||
backends = { "lsp", "treesitter", "markdown", "man" },
|
||||
show_guides = true,
|
||||
|
|
@ -46,7 +48,7 @@ return {
|
|||
return opts
|
||||
end,
|
||||
keys = {
|
||||
{ "<leader>cs", "<cmd>AerialToggle<cr>", desc = "Aerial (Symbols)" },
|
||||
{ "<leader>l", "<cmd>AerialToggle<cr>", desc = "Aerial (Symbols)" },
|
||||
},
|
||||
},
|
||||
|
||||
|
|
|
|||
|
|
@ -11,6 +11,7 @@ return {
|
|||
local opts = {
|
||||
symbols = {},
|
||||
symbol_blacklist = {},
|
||||
width = 30,
|
||||
}
|
||||
local filter = Config.kind_filter
|
||||
|
||||
|
|
|
|||
|
|
@ -50,7 +50,8 @@ return {
|
|||
},
|
||||
usePlaceholders = true,
|
||||
completeUnimported = true,
|
||||
staticcheck = true,
|
||||
-- TODO: gopls 版本问题,临时屏蔽
|
||||
staticcheck = false,
|
||||
directoryFilters = { "-.git", "-.vscode", "-.idea", "-.vscode-test", "-node_modules" },
|
||||
semanticTokens = true,
|
||||
},
|
||||
|
|
|
|||
|
|
@ -3,9 +3,9 @@ if not vim.g.vscode then
|
|||
end
|
||||
|
||||
local enabled = {
|
||||
"flit.nvim",
|
||||
-- "flit.nvim",
|
||||
"lazy.nvim",
|
||||
"leap.nvim",
|
||||
-- "leap.nvim",
|
||||
"mini.ai",
|
||||
"mini.comment",
|
||||
"mini.pairs",
|
||||
|
|
|
|||
|
|
@ -11,6 +11,12 @@ end
|
|||
require("lazyvim.config").init()
|
||||
|
||||
return {
|
||||
{ "folke/lazy.nvim", version = "*" },
|
||||
{
|
||||
"folke/lazy.nvim",
|
||||
version = "*",
|
||||
config = function()
|
||||
require("lazy").setup({ checker = { enabled = false } })
|
||||
end,
|
||||
},
|
||||
{ "LazyVim/LazyVim", priority = 10000, lazy = false, config = true, cond = true, version = "*" },
|
||||
}
|
||||
|
|
|
|||
|
|
@ -15,13 +15,13 @@ function M.get()
|
|||
M._keys = {
|
||||
{ "<leader>cl", "<cmd>LspInfo<cr>", desc = "Lsp Info" },
|
||||
{ "gd", function() require("telescope.builtin").lsp_definitions({ reuse_win = true }) end, desc = "Goto Definition", has = "definition" },
|
||||
{ "gr", "<cmd>Telescope lsp_references<cr>", desc = "References" },
|
||||
{ "gi", "<cmd>Telescope lsp_references<cr>", desc = "References" },
|
||||
{ "gD", vim.lsp.buf.declaration, desc = "Goto Declaration" },
|
||||
{ "gI", function() require("telescope.builtin").lsp_implementations({ reuse_win = true }) end, desc = "Goto Implementation" },
|
||||
{ "gy", function() require("telescope.builtin").lsp_type_definitions({ reuse_win = true }) end, desc = "Goto T[y]pe Definition" },
|
||||
{ "K", vim.lsp.buf.hover, desc = "Hover" },
|
||||
{ "gK", vim.lsp.buf.signature_help, desc = "Signature Help", has = "signatureHelp" },
|
||||
{ "<c-k>", vim.lsp.buf.signature_help, mode = "i", desc = "Signature Help", has = "signatureHelp" },
|
||||
-- { "<c-k>", vim.lsp.buf.signature_help, mode = "i", desc = "Signature Help", has = "signatureHelp" },
|
||||
{ "<leader>ca", vim.lsp.buf.code_action, desc = "Code Action", mode = { "n", "v" }, has = "codeAction" },
|
||||
{
|
||||
"<leader>cA",
|
||||
|
|
|
|||
|
|
@ -55,6 +55,7 @@ return {
|
|||
indent = { enable = true },
|
||||
ensure_installed = {
|
||||
"bash",
|
||||
"go",
|
||||
"c",
|
||||
"diff",
|
||||
"html",
|
||||
|
|
|
|||
|
|
@ -4,6 +4,7 @@ return {
|
|||
-- Better `vim.notify()`
|
||||
{
|
||||
"rcarriga/nvim-notify",
|
||||
enabled = false,
|
||||
keys = {
|
||||
{
|
||||
"<leader>un",
|
||||
|
|
@ -287,8 +288,11 @@ return {
|
|||
-- Highly experimental plugin that completely replaces the UI for messages, cmdline and the popupmenu.
|
||||
{
|
||||
"folke/noice.nvim",
|
||||
event = "VeryLazy",
|
||||
-- event = "VeryLazy",
|
||||
opts = {
|
||||
notify = {
|
||||
enabled = false,
|
||||
},
|
||||
lsp = {
|
||||
override = {
|
||||
["vim.lsp.util.convert_input_to_markdown_lines"] = true,
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue