aboutsummaryrefslogtreecommitdiffhomepage
path: root/vim/lua/chadrc.lua
diff options
context:
space:
mode:
Diffstat (limited to 'vim/lua/chadrc.lua')
-rw-r--r--vim/lua/chadrc.lua6
1 files changed, 5 insertions, 1 deletions
diff --git a/vim/lua/chadrc.lua b/vim/lua/chadrc.lua
index 851b78b..e19b897 100644
--- a/vim/lua/chadrc.lua
+++ b/vim/lua/chadrc.lua
@@ -32,14 +32,17 @@ M.ui = {
32 32
33-- For tabufline 33-- For tabufline
34if M.ui.tabufline.enabled then 34if M.ui.tabufline.enabled then
35
35 vim.keymap.set("n", "<C-c>", function() 36 vim.keymap.set("n", "<C-c>", function()
36 local bufnrs = vim.tbl_filter(function(b) return 1 == vim.fn.buflisted(b) end, vim.api.nvim_list_bufs()) 37 local bufnrs = vim.tbl_filter(function(b) return 1 == vim.fn.buflisted(b) end, vim.api.nvim_list_bufs())
37 if #bufnrs == 1 or #vim.fn.getwininfo() > 1 then 38 if #bufnrs == 1 or #vim.fn.getwininfo() > 1 then
38 vim.cmd("silent quit") 39 vim.cmd("silent quit")
39 else 40 else
40 require("nvchad.tabufline").close_buffer() 41 -- require("nvchad.tabufline").close_buffer()
42 vim.cmd("bdelete")
41 end 43 end
42 end, { desc = "buffer close" }) 44 end, { desc = "buffer close" })
45
43 for i = 1, 9, 1 do 46 for i = 1, 9, 1 do
44 vim.keymap.set("n", string.format("<A-%s>", i), function() 47 vim.keymap.set("n", string.format("<A-%s>", i), function()
45 vim.api.nvim_set_current_buf(vim.t.bufs[i]) 48 vim.api.nvim_set_current_buf(vim.t.bufs[i])
@@ -51,6 +54,7 @@ if M.ui.tabufline.enabled then
51 vim.keymap.set("n", "<A-L>", function() vim.cmd("tabnext") end) 54 vim.keymap.set("n", "<A-L>", function() vim.cmd("tabnext") end)
52 vim.keymap.set("n", "<tab>", function() require("nvchad.tabufline").next() end, { desc = "buffer goto next" }) 55 vim.keymap.set("n", "<tab>", function() require("nvchad.tabufline").next() end, { desc = "buffer goto next" })
53 vim.keymap.set("n", "<S-tab>", function() require("nvchad.tabufline").prev() end, { desc = "buffer goto prev" }) 56 vim.keymap.set("n", "<S-tab>", function() require("nvchad.tabufline").prev() end, { desc = "buffer goto prev" })
57
54end 58end
55 59
56 60