This commit is contained in:
newbie 2023-11-22 23:19:24 +08:00
parent b99c2fb31b
commit 8f8db2de10
4 changed files with 40 additions and 10 deletions

View File

@ -23,6 +23,7 @@ if not G.loop.fs_stat(lazypath) then
end
G.opt.rtp:prepend(lazypath)
require("keymap")
@ -32,6 +33,7 @@ if G.g.vscode then
else
require("options")
require("lazy").setup(require('plugs'))
require("lazy").lockfile = G.fn.stdpath("data") .. "/lazy/lazy-lock.json"
end

View File

@ -13,11 +13,29 @@ G.cgp = vim.nvim_create_augroup
function G.map(maps)
for _,map in pairs(maps) do
if #map == 3 then
vim.keymap.set(map[1], map[2], map[3], {noremap = true})
elseif #map == 4 then
vim.keymap.set(map[1], map[2], map[3], map[4])
else
print("太多变量了")
end
--G.api.nvim_set_keymap(map[1], map[2], map[3], map[4])
end
end
function G.delmap(maps)
for _,map in pairs(maps) do
if #map == 2 then
vim.keymap.del(map[1], map[2], {})
elseif #map == 3 then
vim.keymap.del(map[1], map[2], map[3])
else
print("太多变量了")
end
end
end
function G.cmd(cmd)
G.api.nvim_command(cmd)
end

View File

@ -1,3 +1,4 @@
return {
'github/copilot.vim', -- github copilot

View File

@ -1,22 +1,31 @@
return {
'kyazdani42/nvim-web-devicons',
{
'https://git.qyhhh.top/newbieQQ/nvim-tree.lua',
"nvim-tree/nvim-tree.lua",
config = function ()
G.map({
{"n", "<c-e>", ":NvimTreeToggle<CR>", {noremap = true}},
})
require'nvim-tree'.setup {
sort_by = "case_sensitive",
view = { width = 30, },
view = {
width = 30,
},
filters = { dotfiles = true, },
git = { enable = true },
-- on_attach = my_on_attach,
}
on_attach = function (bufnr)
local api = require'nvim-tree.api'
api.config.mappings.default_on_attach(bufnr)
-- override a default
G.delmap({
{'n', '<C-e>', { buffer = bufnr }},
})
end
}
}
G.map({
{"n", "<C-e>", ":NvimTreeToggle<CR>", { noremap = true }},
})
end
}
}