增加格式化插件;格式化配置;增加搜索插件

This commit is contained in:
LingZhaoHui 2024-06-20 00:46:34 +08:00
parent dc5fda281a
commit 1ed88eaaca
Signed by: zeekling
GPG Key ID: D96E4E75267CA2CC
12 changed files with 407 additions and 345 deletions

View File

@ -17,32 +17,51 @@ return {
end, end,
}, },
mapping = cmp.mapping.preset.insert({ mapping = cmp.mapping.preset.insert({
['<C-b>'] = cmp.mapping.scroll_docs(-4), ["<C-b>"] = cmp.mapping.scroll_docs(-4),
['<C-f>'] = cmp.mapping.scroll_docs(4), ["<C-f>"] = cmp.mapping.scroll_docs(4),
['<C-Space>'] = cmp.mapping.complete(), ["<C-Space>"] = cmp.mapping.complete(),
['<C-e>'] = cmp.mapping.abort(), ["<C-e>"] = cmp.mapping.abort(),
['<CR>'] = cmp.mapping.confirm({ select = true }), ["<CR>"] = cmp.mapping.confirm({ select = true }),
}), }),
sources = cmp.config.sources({ sources = cmp.config.sources({
{ name = 'nvim_lsp' }, { name = "nvim_lsp" },
{ name = 'luasnip' }, { name = "luasnip" },
}, { }, {
{ name = 'buffer' }, { name = "buffer" },
{ name = "path" }, { name = "path" },
}), }),
}) })
end, end,
}, },
{ {
"neovim/nvim-lspconfig" "neovim/nvim-lspconfig",
}, },
{ {
"nvim-treesitter/nvim-treesitter", "nvim-treesitter/nvim-treesitter",
config = function() config = function()
require('nvim-treesitter.configs').setup { require("nvim-treesitter.configs").setup({
ensure_installed = { 'c', 'cpp', 'cmake', 'bash', 'go', 'lua', 'python', 'java', 'git_config', 'git_rebase', 'gitattributes', 'gitcommit', 'gitignore', 'groovy', 'json', 'sql', 'vim', 'xml', 'tcl'}, ensure_installed = {
} "c",
"cpp",
"cmake",
"bash",
"go",
"lua",
"python",
"java",
"git_config",
"git_rebase",
"gitattributes",
"gitcommit",
"gitignore",
"groovy",
"json",
"sql",
"vim",
"xml",
"tcl",
},
})
end, end,
},
} }
}

View File

@ -20,6 +20,17 @@ return {
s={"<cmd>NvimTreeToggle<cr>", "show dir tree on left"}, s={"<cmd>NvimTreeToggle<cr>", "show dir tree on left"},
c={"<cmd>NvimTreeClose<cr>", "hidden dir tree on left"} c={"<cmd>NvimTreeClose<cr>", "hidden dir tree on left"}
}, },
f = {
name="Search,Format",
s={
name="search",
f={"<cmd>Telescope find_files<cr>", "Search file by name"},
g={"<cmd>Telescope live_grep<cr>", "Grep in files"},
b={"<cmd>Telescope buffers<cr>", "Grep in buffer"},
},
f={"<cmd>Format<cr>", "Code Format"}
},
l = { l = {
name="Lazy", name="Lazy",
s={"<cmd>Lazy show<cr>", "Lazy show"}, s={"<cmd>Lazy show<cr>", "Lazy show"},
@ -38,9 +49,6 @@ return {
name = "version", name = "version",
v={"<cmd>version<cr>", "neovim version"}, v={"<cmd>version<cr>", "neovim version"},
}, },
s = {
name="Search"
},
} }
}, {silent = true, noremap = true}) }, {silent = true, noremap = true})
wk.setup() wk.setup()

View File

@ -1,26 +1,41 @@
return { return {
'nvim-java/nvim-java', "nvim-java/nvim-java",
dependencies = { dependencies = {
'nvim-java/lua-async-await', "nvim-java/lua-async-await",
'nvim-java/nvim-java-refactor', "nvim-java/nvim-java-refactor",
'nvim-java/nvim-java-core', "nvim-java/nvim-java-core",
'nvim-java/nvim-java-test', "nvim-java/nvim-java-test",
'nvim-java/nvim-java-dap', "nvim-java/nvim-java-dap",
'MunifTanjim/nui.nvim', "MunifTanjim/nui.nvim",
'neovim/nvim-lspconfig', "neovim/nvim-lspconfig",
'mfussenegger/nvim-dap', "mfussenegger/nvim-dap",
{ {
'williamboman/mason.nvim', "williamboman/mason.nvim",
opts = { opts = {
registries = { registries = {
'github:nvim-java/mason-registry', "github:nvim-java/mason-registry",
'github:mason-org/mason-registry', "github:mason-org/mason-registry",
},
}, },
}, },
}
}, },
config = function() config = function()
require('java').setup({ require("java").setup({
root_markers = {
"settings.gradle",
"settings.gradle.kts",
"pom.xml",
"build.gradle",
"mvnw",
"gradlew",
"build.gradle",
"build.gradle.kts",
".git",
},
java_test = {
enable = true,
},
}) })
require("lspconfig").jdtls.setup({})
end, end,
} }

View File

@ -2,7 +2,8 @@ return {
{ {
"ray-x/lsp_signature.nvim", "ray-x/lsp_signature.nvim",
event = "BufRead", event = "BufRead",
config = function() require"lsp_signature".on_attach() end, config = function()
require("lsp_signature").on_attach()
end,
}, },
} }

View File

@ -6,4 +6,3 @@ return {
vim.fn["mkdp#util#install"]() vim.fn["mkdp#util#install"]()
end, end,
} }

View File

@ -8,9 +8,9 @@ return {
extensions = { extensions = {
h = "cpp", h = "cpp",
}, },
} },
}) })
end end,
}, },
{ {
"HiPhish/nvim-ts-rainbow2", "HiPhish/nvim-ts-rainbow2",
@ -115,10 +115,10 @@ return {
"ray-x/cmp-treesitter", "ray-x/cmp-treesitter",
}, },
{ {
'nvim-lualine/lualine.nvim', "nvim-lualine/lualine.nvim",
config = function() config = function()
require('lualine').setup() require("lualine").setup()
end end,
}, },
{ {
"nvim-neo-tree/neo-tree.nvim", "nvim-neo-tree/neo-tree.nvim",
@ -128,7 +128,7 @@ return {
"nvim-tree/nvim-web-devicons", -- not strictly required, but recommended "nvim-tree/nvim-web-devicons", -- not strictly required, but recommended
"MunifTanjim/nui.nvim", "MunifTanjim/nui.nvim",
-- "3rd/image.nvim", -- Optional image support in preview window: See `# Preview Mode` for more information -- "3rd/image.nvim", -- Optional image support in preview window: See `# Preview Mode` for more information
} },
}, },
{ {
"tiagovla/scope.nvim", "tiagovla/scope.nvim",
@ -138,24 +138,40 @@ return {
tag = "v3.*", tag = "v3.*",
config = function() config = function()
vim.g.termguicolors = true vim.g.termguicolors = true
require("bufferline").setup() require("bufferline").setup()
end, end,
}, },
{ {
'nvimdev/dashboard-nvim', "nvimdev/dashboard-nvim",
event = 'VimEnter', event = "VimEnter",
config = function() config = function()
require('dashboard').setup { require("dashboard").setup({
-- config -- config
} })
end, end,
dependencies = { {'nvim-tree/nvim-web-devicons'}} dependencies = { { "nvim-tree/nvim-web-devicons" } },
}, },
{ {
"azabiong/vim-highlighter", "azabiong/vim-highlighter",
}, },
{"stevearc/dressing.nvim", {
opts = {}} "stevearc/dressing.nvim",
opts = {},
},
{
"mhartington/formatter.nvim",
config = function()
require("formatter").setup({
logging = true,
log_level = vim.log.levels.WARN,
filetype = {
lua = { require("formatter.filetypes.lua").stylua },
java = { require("formatter.filetypes.java").clangformat },
},
["*"] = {
require("formatter.filetypes.any").remove_trailing_whitespace,
},
})
end,
},
} }

View File

@ -1,6 +1,5 @@
return { return {
{ {
"tpope/vim-fugitive", "tpope/vim-fugitive",
},
} }
}

View File

@ -4,7 +4,7 @@ return {
version = "*", version = "*",
dependencies = { "nvim-tree/nvim-web-devicons" }, dependencies = { "nvim-tree/nvim-web-devicons" },
config = function() config = function()
require("nvim-tree").setup {} require("nvim-tree").setup({})
end end,
} },
} }

View File

@ -0,0 +1,7 @@
return {
{
"nvim-telescope/telescope.nvim",
tag = "0.1.8",
dependencies = { "nvim-lua/plenary.nvim" },
},
}

View File

@ -6,17 +6,17 @@ config = function()
highlight_hovered_item = true, highlight_hovered_item = true,
show_guides = true, show_guides = true,
auto_preview = false, auto_preview = false,
position = 'right', position = "right",
relative_width = true, relative_width = true,
width = 25, width = 25,
auto_close = false, auto_close = false,
show_numbers = false, show_numbers = false,
show_relative_numbers = false, show_relative_numbers = false,
show_symbol_details = true, show_symbol_details = true,
preview_bg_highlight = 'Pmenu', preview_bg_highlight = "Pmenu",
autofold_depth = nil, autofold_depth = nil,
auto_unfold_hover = true, auto_unfold_hover = true,
fold_markers = { '', '' }, fold_markers = { "", "" },
wrap = false, wrap = false,
keymaps = { keymaps = {
-- These keymaps can be a string or a table for multiple keys -- These keymaps can be a string or a table for multiple keys
@ -68,5 +68,4 @@ config = function()
}) })
end, end,
}, },
} }

View File

@ -1,14 +1,13 @@
return { return {
{ {
'projekt0n/github-nvim-theme', "projekt0n/github-nvim-theme",
}, },
{ {
"Mofiqul/vscode.nvim", "Mofiqul/vscode.nvim",
lazy = false, lazy = false,
config = function() config = function()
require('vscode').setup({ require("vscode").setup({})
}) vim.cmd("colorscheme vscode")
vim.cmd('colorscheme vscode')
end, end,
} },
} }