-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathchadrc.lua
102 lines (95 loc) · 3.43 KB
/
chadrc.lua
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
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
-- Use this file to make changes to plugins or nvchad option
---@type ChadrcConfig
local M = {}
M.ui = { theme = "ayu_dark" }
M.plugins = "custom.plugins"
M.mappings = {
disabled = {
-- ["<C-n>"] = { "<cmd> NvimTreeToggle <CR>", "Toggle nvimtree" },
["<leader>v"] = "",
["<leader>h"] = "",
},
general = {
i = {
["<C-s>"] = { "<cmd>w<cr>" ,"Save file (insert mode)" },
["<C-q>"] = { "<cmd>wq<cr>" ,"Save file and quit (insert mode)" },
},
n = {
-- ["<leader>F"] = {
-- function()
-- -- --[[ vim.g.rustfmt_autosave = 0 ]]
-- lsp.formatting.format_on_save.enabled = false
-- end,
-- "Toggle formatting",
-- },
["<C-s>"] = { "<cmd>w<cr>" ,"Save file (insert mode)" },
["<C-q>"] = { "<cmd>wq<cr>" ,"Save file and quit (insert mode)" },
["|"] = { "<cmd>vsplit<cr>", "Vertical Split" },
["\\"] = { "<cmd>split<cr>", "Horizontal Split" },
["<C-a>"] = { "ggVG", "Highlight all text" },
},
v = {
["<S-Tab>"] = { "<gv", desc = "Unindent line" },
["<Tab>"] = { ">gv", desc = "Indent line" },
["/"] = { "y/<C-R>\"<CR>", desc = "Copy highlighted text" },
-- ["<leader>r"] = { "y%s//\r/gc<CR>", desc = "Find and replace" },
},
},
session_manager = {
n = {
["<leader>Sl"] = { "<cmd>SessionManager! load_last_session<cr>", desc = "Load last session" },
["<leader>Ss"] = { "<cmd>SessionManager! save_current_session<cr>", desc = "Save this session" },
["<leader>Sd"] = { "<cmd>SessionManager! delete_session<cr>", desc = "Delete session" },
["<leader>Sf"] = { "<cmd>SessionManager! load_session<cr>", desc = "Search sessions" },
["<leader>S."] = { "<cmd>SessionManager! load_current_dir_session<cr>", desc = "Load current directory session" },
},
},
lazygit = {
n = {
["<leader>gg"] = { "<cmd> LazyGit<CR>", "Toggle lazygit" },
},
},
nvterm = {
i = {
-- improved terminal navigation
["<C-h>"] = { "<cmd>wincmd h<cr>", desc = "Terminal left window navigation" },
["<C-j>"] = { "<cmd>wincmd j<cr>", desc = "Terminal down window navigation" },
["<C-k>"] = { "<cmd>wincmd k<cr>", desc = "Terminal up window navigation" },
["<C-l>"] = { "<cmd>wincmd l<cr>", desc = "Terminal right window navigation" },
},
-- toggle in terminal mode
t = {
["<F7>"] = {
function() require("nvterm.terminal").toggle "float" end,
"Toggle floating term",
},
-- improved terminal navigation
["<C-h>"] = { "<cmd>wincmd h<cr>", desc = "Terminal left window navigation" },
["<C-j>"] = { "<cmd>wincmd j<cr>", desc = "Terminal down window navigation" },
["<C-k>"] = { "<cmd>wincmd k<cr>", desc = "Terminal up window navigation" },
["<C-l>"] = { "<cmd>wincmd l<cr>", desc = "Terminal right window navigation" },
["<esc>"] = { "<esc><C-\\><C-n>", desc = "Escape terminal mode" },
["<esc><esc>"] = { "<cmd> :q <cr>", desc = "Exit terminal mode" },
},
-- toggle in normal mode
n = {
["<F7>"] = {
function() require("nvterm.terminal").toggle "float" end,
"New horizontal term",
},
},
},
tabufline = {
n = {
["<"] = {
function() require("nvchad.tabufline").move_buf(-1) end,
"Move prev buffer",
},
[">"] = {
function() require("nvchad.tabufline").move_buf(1) end,
"Move next buffer",
},
}
}
}
return M