-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathkeymaps.lua
More file actions
52 lines (44 loc) · 1.13 KB
/
Copy pathkeymaps.lua
File metadata and controls
52 lines (44 loc) · 1.13 KB
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
local function open_term(cmd, opts)
opts = opts or {}
if opts.size then
vim.cmd(("botright %d vsplit | term %s"):format(opts.size, cmd))
else
vim.cmd(("tabnew | term %s"):format(cmd))
end
vim.cmd.startinsert()
end
lib.set_keymaps {
{ "n", "<leader>q", "<cmd>q<cr>" },
{ "n", "<C-s>", "<cmd>w<cr>" },
{ "n", "<C-e>", "<cmd>bd<cr>" },
{ "n", "<C-h>", "<C-w>h", { remap = true } },
{ "n", "<C-j>", "<C-w>j", { remap = true } },
{ "n", "<C-k>", "<C-w>k", { remap = true } },
{ "n", "<C-l>", "<C-w>l", { remap = true } },
{ "v", "<", "<gv" },
{ "v", ">", ">gv" },
{ "t", "<C-x>", "<C-\\><C-n>" },
{ "n", "<leader>ph", "<cmd>Lazy<cr>" },
{ "n", "<leader>ps", "<cmd>Lazy sync<cr>" },
{
"n",
"<leader>gg",
function()
open_term "lazygit"
end,
},
{
"n",
"<leader>ai",
function()
open_term("opencode", { size = 80 })
end,
},
{
"n",
"<leader>ac",
function()
open_term("opencode --continue", { size = 80 })
end,
},
}