From 058fa5ecbf152be3864b3a510aec418b18c35734 Mon Sep 17 00:00:00 2001 From: Hsieh Chin Fan Date: Thu, 11 Jul 2024 23:49:29 +0800 Subject: Update --- vim/lua/chadrc.lua | 98 ++++++++++++++++++++++++++++++------------------------ 1 file changed, 55 insertions(+), 43 deletions(-) (limited to 'vim/lua') diff --git a/vim/lua/chadrc.lua b/vim/lua/chadrc.lua index f9c2357..4b65f52 100644 --- a/vim/lua/chadrc.lua +++ b/vim/lua/chadrc.lua @@ -5,56 +5,68 @@ local M = {} M.ui = { - theme = "onedark", + theme = "onedark", + hl_override = { + CursorLineNr = { fg = "#eeee00" }, + }, - -- hl_override = { - -- Comment = { italic = true }, - -- ["@comment"] = { italic = true }, - -- }, - tabufline = { - enabled = true, - order = { "treeOffset", "buffers", "tabs" }, - }, + -- hl_override = { + -- Comment = { italic = true }, + -- ["@comment"] = { italic = true }, + -- }, + tabufline = { + enabled = true, + order = { "treeOffset", "buffers", "tabs" }, + }, - term = { - hl = "Normal:term,WinSeparator:WinSeparator", - sizes = { sp = 0.4, vsp = 0.4 }, - float = { - relative = "editor", - row = 0.15, - col = 0.13, - width = 0.7, - height = 0.7, - border = "single", - }, - }, + term = { + hl = "Normal:term,WinSeparator:WinSeparator", + sizes = { sp = 0.4, vsp = 0.4 }, + float = { + relative = "editor", + row = 0.15, + col = 0.13, + width = 0.7, + height = 0.7, + border = "single", + }, + }, } -- For tabufline if M.ui.tabufline.enabled then + vim.api.nvim_exec( + [[ + function! CloseBufferSafely() + lua require("nvchad.tabufline").close_buffer() + endfunction + ]], + false + ) - -- vim.keymap.set("n", "", function() - -- local bufnrs = vim.tbl_filter(function(b) return 1 == vim.fn.buflisted(b) end, vim.api.nvim_list_bufs()) - -- if #bufnrs == 1 or #vim.fn.getwininfo() > 1 then - -- vim.cmd("silent quit") - -- else - -- require("nvchad.tabufline").close_buffer() - -- -- vim.cmd("bdelete") - -- end - -- end, { desc = "buffer close" }) - - for i = 1, 9, 1 do - vim.keymap.set("n", string.format("", i), function() - vim.api.nvim_set_current_buf(vim.t.bufs[i]) - end) - end - vim.keymap.set("n", "", function() require("nvchad.tabufline").move_buf(-1) end) - vim.keymap.set("n", "", function() require("nvchad.tabufline").move_buf(1) end) - vim.keymap.set("n", "", function() vim.cmd("tabprevious") end) - vim.keymap.set("n", "", function() vim.cmd("tabnext") end) - vim.keymap.set("n", "", function() require("nvchad.tabufline").next() end, { desc = "buffer goto next" }) - vim.keymap.set("n", "", function() require("nvchad.tabufline").prev() end, { desc = "buffer goto prev" }) - + for i = 1, 9, 1 do + vim.keymap.set("n", string.format("", i), function() + vim.api.nvim_set_current_buf(vim.t.bufs[i]) + end) + end + vim.keymap.set("n", "", function() + require("nvchad.tabufline").move_buf(-1) + end) + vim.keymap.set("n", "", function() + require("nvchad.tabufline").move_buf(1) + end) + vim.keymap.set("n", "", function() + vim.cmd("tabprevious") + end) + vim.keymap.set("n", "", function() + vim.cmd("tabnext") + end) + vim.keymap.set("n", "", function() + require("nvchad.tabufline").next() + end, { desc = "buffer goto next" }) + vim.keymap.set("n", "", function() + require("nvchad.tabufline").prev() + end, { desc = "buffer goto prev" }) end return M -- cgit v1.2.3-70-g09d2