-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmappings.lua
75 lines (70 loc) · 1.63 KB
/
mappings.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
local M = {}
M.general = {
n = {
["<C-h>"] = {"<C-w>h","Left Window"},
["<C-j>"]= {"<C-w>j","Below Window"},
["<C-k>"]= {"<C-w>k","Up Window"},
["<C-l>"]= {"<C-w>l","Right Window"},
["<S-l>"]={":bnext<CR>","Next Buffer"},
["<S-h>"]={":bprevious<CR>","Prev Buffer"},
["<leader>q"] = { ":q<cr>", "Quit" },
["<leader>w"] = { ":w<cr>", "Save" },
["<leader>h"] = { "<cmd>nohlsearch<CR>", "No Highlight" },
["<leader>H"] = { ":split<CR>", "Split Horizontally" },
["<leader>v"] = { ":vsplit<CR>", "Split Vertically" },
},
i = {
["jk"] = {"<ESC>", "escape insert mode" , opts = { nowait = true }}
},
x = {
["jk"] = {"<ESC>"},
},
v={
["J"]= {":move '>+1<CR>gv-gv"},
["K"]= {":move '<-2<CR>gv-gv"},
["H"]= {"<gv"},
["L"]= {">gv"}
}
}
M.telescope ={
n = {
["<leader>b"] = {":Telescope buffers<cr>", "View Buffers" },
["<leader>f"] = { ":Telescope find_files<cr>", "Telescope Find Files" },
["<leader>F"] = { ":Telescope live_grep<cr>", "Telescope Live Grep" },
}
}
M.lspconfig = {
n = {
["<leader>lR"] = {
function()
require("nvchad_ui.renamer").open()
end,
"lsp rename",
},
["<leader>la"] = {
function()
vim.lsp.buf.code_action()
end,
"lsp code_action",
},
["<leader>le"] = {
function()
vim.diagnostic.open_float()
end,
"floating diagnostic",
},
["gk"] = {
function()
vim.diagnostic.goto_prev()
end,
"goto prev",
},
["gj"] = {
function()
vim.diagnostic.goto_next()
end,
"goto_next",
},
}
}
return M