Update some configurations.
This commit is contained in:
parent
0496943912
commit
cc8ca1ff33
5
README.md
Normal file
5
README.md
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
# Vim Configuration
|
||||||
|
|
||||||
|
This is my vim(neovim) configuration, mainly using Lazy.vim as Configuration
|
||||||
|
manager and adding some basic support so that it can be used in multi-purpose
|
||||||
|
tasks.
|
||||||
@ -1,17 +1,17 @@
|
|||||||
-- Bootstrap lazy.nvim
|
-- Bootstrap lazy.nvim
|
||||||
local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim"
|
local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim"
|
||||||
if not (vim.uv or vim.loop).fs_stat(lazypath) then
|
if not (vim.uv or vim.loop).fs_stat(lazypath) then
|
||||||
local lazyrepo = "https://github.com/folke/lazy.nvim.git"
|
local lazyrepo = "https://github.com/folke/lazy.nvim.git"
|
||||||
local out = vim.fn.system({ "git", "clone", "--filter=blob:none", "--branch=stable", lazyrepo, lazypath })
|
local out = vim.fn.system({ "git", "clone", "--filter=blob:none", "--branch=stable", lazyrepo, lazypath })
|
||||||
if vim.v.shell_error ~= 0 then
|
if vim.v.shell_error ~= 0 then
|
||||||
vim.api.nvim_echo({
|
vim.api.nvim_echo({
|
||||||
{ "Failed to clone lazy.nvim:\n", "ErrorMsg" },
|
{ "Failed to clone lazy.nvim:\n", "ErrorMsg" },
|
||||||
{ out, "WarningMsg" },
|
{ out, "WarningMsg" },
|
||||||
{ "\nPress any key to exit..." },
|
{ "\nPress any key to exit..." },
|
||||||
}, true, {})
|
}, true, {})
|
||||||
vim.fn.getchar()
|
vim.fn.getchar()
|
||||||
os.exit(1)
|
os.exit(1)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
vim.opt.rtp:prepend(lazypath)
|
vim.opt.rtp:prepend(lazypath)
|
||||||
|
|
||||||
@ -23,13 +23,13 @@ vim.g.maplocalleader = "\\"
|
|||||||
|
|
||||||
-- Setup lazy.nvim
|
-- Setup lazy.nvim
|
||||||
require("lazy").setup({
|
require("lazy").setup({
|
||||||
spec = {
|
spec = {
|
||||||
-- import your plugins
|
-- import your plugins
|
||||||
{ import = "plugins" },
|
{ import = "plugins" },
|
||||||
},
|
},
|
||||||
-- Configure any other settings here. See the documentation for more details.
|
-- Configure any other settings here. See the documentation for more details.
|
||||||
-- colorscheme that will be used when installing plugins.
|
-- colorscheme that will be used when installing plugins.
|
||||||
install = { colorscheme = { "habamax" } },
|
install = { colorscheme = { "catppuccin-mocha" } },
|
||||||
-- automatically check for plugin updates
|
-- automatically check for plugin updates
|
||||||
checker = { enabled = true },
|
checker = { enabled = true },
|
||||||
})
|
})
|
||||||
|
|||||||
@ -38,7 +38,7 @@ return {
|
|||||||
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-n>"] = cmp.mapping.complete(), -- 触发补全
|
||||||
["<C-e>"] = cmp.mapping.abort(), -- 关闭补全
|
["<C-e>"] = cmp.mapping.abort(), -- 关闭补全
|
||||||
['<CR>'] = cmp.mapping(function(fallback)
|
['<CR>'] = cmp.mapping(function(fallback)
|
||||||
if cmp.visible() then
|
if cmp.visible() then
|
||||||
@ -79,14 +79,6 @@ return {
|
|||||||
{ name = "path" }, -- 文件路径
|
{ name = "path" }, -- 文件路径
|
||||||
{ name = "buffer" }, -- 缓冲区内容
|
{ name = "buffer" }, -- 缓冲区内容
|
||||||
}),
|
}),
|
||||||
-- 美化补全菜单(图标 + 类型提示)
|
|
||||||
formatting = {
|
|
||||||
format = lspkind.cmp_format({
|
|
||||||
mode = "symbol_text",
|
|
||||||
maxwidth = 50,
|
|
||||||
ellipsis_char = "...",
|
|
||||||
}),
|
|
||||||
},
|
|
||||||
})
|
})
|
||||||
|
|
||||||
-- 命令行补全
|
-- 命令行补全
|
||||||
|
|||||||
@ -3,6 +3,10 @@
|
|||||||
return {
|
return {
|
||||||
{
|
{
|
||||||
"tpope/vim-fugitive",
|
"tpope/vim-fugitive",
|
||||||
event = "User GitPrompt", -- 按需加载
|
cmd = {
|
||||||
|
"G",
|
||||||
|
"Git",
|
||||||
|
"Gedit", "Gdiffsplit", "Gread", "Gwrite", "GMove", "Ggrep", "GDelete", "GBrowse"
|
||||||
|
}
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|||||||
@ -7,7 +7,7 @@ return {
|
|||||||
{ "<leader>n", ":NERDTreeFocus<CR>", mode = "n", desc = "Nerd Tree Focus" },
|
{ "<leader>n", ":NERDTreeFocus<CR>", mode = "n", desc = "Nerd Tree Focus" },
|
||||||
{ "<C-n>", ":NERDTree<CR>", mode = "n", desc = "Nerd Tree" },
|
{ "<C-n>", ":NERDTree<CR>", mode = "n", desc = "Nerd Tree" },
|
||||||
{ "<C-t>", ":NERDTreeToggle<CR>", mode = "n", desc = "Nerd Tree Toggle" },
|
{ "<C-t>", ":NERDTreeToggle<CR>", mode = "n", desc = "Nerd Tree Toggle" },
|
||||||
{ "<C-f>", ":NERDTreeFind<CR>", mode = "n", desc = "Nerd Tree Find" },
|
{ "<C-s>", ":NERDTreeFind<CR>", mode = "n", desc = "Nerd Tree Find" },
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@ -43,8 +43,8 @@ return {
|
|||||||
{ "s", "<Plug>(easymotion-overwin-f2)", mode = "n", desc = "EasyMotion 跳转双字符" },
|
{ "s", "<Plug>(easymotion-overwin-f2)", mode = "n", desc = "EasyMotion 跳转双字符" },
|
||||||
|
|
||||||
-- <Leader>L 跳转行(上下)
|
-- <Leader>L 跳转行(上下)
|
||||||
{ "<leader>L", "<Plug>(easymotion-overwin-line)", mode = "n", desc = "EasyMotion 跳转行" },
|
{ "<leader>l", "<Plug>(easymotion-overwin-line)", mode = "n", desc = "EasyMotion 跳转行" },
|
||||||
{ "<leader>L", "<Plug>(easymotion-bd-jk)", mode = { "x", "o" }, desc = "EasyMotion 跳转行(可视模式)" },
|
{ "<leader>l", "<Plug>(easymotion-bd-jk)", mode = { "x", "o" }, desc = "EasyMotion 跳转行(可视模式)" },
|
||||||
|
|
||||||
-- <Leader>w 跳转单词
|
-- <Leader>w 跳转单词
|
||||||
{ "<leader>w", "<Plug>(easymotion-overwin-w)", mode = "n", desc = "EasyMotion 跳转单词" },
|
{ "<leader>w", "<Plug>(easymotion-overwin-w)", mode = "n", desc = "EasyMotion 跳转单词" },
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user