aboutsummaryrefslogtreecommitdiffhomepage
path: root/vim/nvim/lua/chadrc.lua
diff options
context:
space:
mode:
Diffstat (limited to 'vim/nvim/lua/chadrc.lua')
-rw-r--r--vim/nvim/lua/chadrc.lua47
1 files changed, 47 insertions, 0 deletions
diff --git a/vim/nvim/lua/chadrc.lua b/vim/nvim/lua/chadrc.lua
new file mode 100644
index 0000000..aa0d78c
--- /dev/null
+++ b/vim/nvim/lua/chadrc.lua
@@ -0,0 +1,47 @@
1-- This file needs to have same structure as nvconfig.lua
2-- https://github.com/NvChad/NvChad/blob/v2.5/lua/nvconfig.lua
3
4---@type ChadrcConfig
5local M = {}
6
7M.ui = {
8 theme = "onedark",
9
10 -- hl_override = {
11 -- Comment = { italic = true },
12 -- ["@comment"] = { italic = true },
13 -- },
14 tabufline = {
15 enabled = true,
16 },
17}
18
19-- For tabufline
20if M.ui.tabufline.enabled then
21 vim.keymap.set("n", "<C-c>", function()
22 local bufnrs = vim.tbl_filter(function(b)
23 if 1 ~= vim.fn.buflisted(b) then
24 return false
25 else
26 return true
27 end
28 end, vim.api.nvim_list_bufs())
29 if #bufnrs == 1 then
30 vim.cmd("silent quit!")
31 else
32 require("nvchad.tabufline").close_buffer()
33 end
34 end, { desc = "buffer close" })
35 for i = 1, 9, 1 do
36 vim.keymap.set("n", string.format("<A-%s>", i), function()
37 vim.api.nvim_set_current_buf(vim.t.bufs[i])
38 end)
39 end
40 vim.keymap.set("n", "<A-h>", function() require("nvchad.tabufline").move_buf(-1) end)
41 vim.keymap.set("n", "<A-l>", function() require("nvchad.tabufline").move_buf(1) end)
42 vim.keymap.set("n", "<A-H>", function() vim.cmd("tabprevious") end)
43 vim.keymap.set("n", "<A-L>", function() vim.cmd("tabnext") end)
44end
45
46
47return M