diff --git a/lua/G.lua b/lua/G.lua index 17909a7..0212ddd 100644 --- a/lua/G.lua +++ b/lua/G.lua @@ -15,25 +15,13 @@ 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 + vim.keymap.set(map[1], map[2], map[3], map[4] or { noremap = true }) 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 + vim.keymap.del(map[1], map[2], map[3] or {}) end end diff --git a/lua/keymap.lua b/lua/keymap.lua index b5496b7..72e9dfb 100644 --- a/lua/keymap.lua +++ b/lua/keymap.lua @@ -1,42 +1,39 @@ -local opt = { noremap = true } - -- base G.map({ - { 'n', 'nh', ':nohlsearch', opt }, - { 'n', 'rp', ':%s/', opt }, + { 'n', 'nh', ':nohlsearch' }, + { 'n', 'rp', ':%s/' }, - { 'v', 'L', '$', opt }, - { 'v', 'H', '^', opt }, - { 'n', 'L', '$', opt }, - { 'n', 'H', '^', opt }, - { 'v', '>', '>gv', opt }, - { 'v', '<', '', '>gv' }, + { 'v', '<', '', '>>', opt }, - { 'n', '<', '<<', opt }, - { 'n', '?', ':set hlsearch?', opt }, - { 'n', '/', ':set hlsearch/', opt }, + { 'n', '>', '>>' }, + { 'n', '<', '<<' }, + { 'n', '?', ':set hlsearch?' }, + { 'n', '/', ':set hlsearch/' }, - { 'n', '', ':tabn', opt }, - { 'n', '', ':tabp', opt }, + { 'n', '', ':tabn' }, + { 'n', '', ':tabp' }, - { 'n', '', 'j', opt }, - { 'n', '', 'h', opt }, - { 'n', '', 'k', opt }, - { 'n', '', 'l', opt }, + { 'n', '', 'j' }, + { 'n', '', 'h' }, + { 'n', '', 'k' }, + { 'n', '', 'l' }, - { 'n', '', ':q', opt }, - { 'n', '', ':w !sudo tee %', opt }, - { 'n', '', ':q!', opt }, - { 'v', '', '"+y', opt }, + { 'n', '', ':q' }, + { 'n', '', ':w !sudo tee %' }, + { 'n', '', ':q!' }, + { 'v', '', '"+y' }, - { 'n', 'y', 'ggyG', opt }, - { 'n', 'p', 'ggpG', opt }, - { 'n', 'v', 'ggVG', opt }, - - { 'n', '', ':res -5', opt }, - { 'n', '', ':res +5', opt }, - { 'n', '', ':vertical resize -5', opt }, - { 'n', '', ':vertical resize +5', opt }, + { 'n', 'y', 'ggyG' }, + { 'n', 'p', 'ggpG' }, + { 'n', 'v', 'ggVG' }, + { 'n', '', ':res -5' }, + { 'n', '', ':res +5' }, + { 'n', '', ':vertical resize -5' }, + { 'n', '', ':vertical resize +5' }, }) diff --git a/lua/options.lua b/lua/options.lua index d053a69..8b7ff08 100644 --- a/lua/options.lua +++ b/lua/options.lua @@ -29,7 +29,7 @@ G.opt.ignorecase = true G.opt.incsearch = true -- 不换行 -G.opt.textwidth = 999 +G.opt.textwidth = 0 G.opt.wrap = false diff --git a/lua/plugs/theme.lua b/lua/plugs/theme.lua index 3e1428f..15db832 100644 --- a/lua/plugs/theme.lua +++ b/lua/plugs/theme.lua @@ -20,9 +20,9 @@ return { always_divide_middle = true, globalstatus = false, refresh = { - statusline = 1000, - tabline = 1000, - winbar = 1000, + statusline = 2000, + tabline = 2000, + winbar = 2000, } }, sections = {