aboutsummaryrefslogtreecommitdiffhomepage
path: root/vim/lua/chadrc.lua
blob: 4b65f528f3c232e5d2e4ece16edf4a5efb6267d4 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
-- This file  needs to have same structure as nvconfig.lua
-- https://github.com/NvChad/NvChad/blob/v2.5/lua/nvconfig.lua

---@type ChadrcConfig
local M = {}

M.ui = {
	theme = "onedark",
	hl_override = {
		CursorLineNr = { fg = "#eeee00" },
	},

	-- 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",
		},
	},
}

-- For tabufline
if M.ui.tabufline.enabled then
	vim.api.nvim_exec(
		[[
    function! CloseBufferSafely()
     lua require("nvchad.tabufline").close_buffer()
    endfunction
  ]],
		false
	)

	for i = 1, 9, 1 do
		vim.keymap.set("n", string.format("<A-%s>", i), function()
			vim.api.nvim_set_current_buf(vim.t.bufs[i])
		end)
	end
	vim.keymap.set("n", "<A-h>", function()
		require("nvchad.tabufline").move_buf(-1)
	end)
	vim.keymap.set("n", "<A-l>", function()
		require("nvchad.tabufline").move_buf(1)
	end)
	vim.keymap.set("n", "<A-H>", function()
		vim.cmd("tabprevious")
	end)
	vim.keymap.set("n", "<A-L>", function()
		vim.cmd("tabnext")
	end)
	vim.keymap.set("n", "<tab>", function()
		require("nvchad.tabufline").next()
	end, { desc = "buffer goto next" })
	vim.keymap.set("n", "<S-tab>", function()
		require("nvchad.tabufline").prev()
	end, { desc = "buffer goto prev" })
end

return M