forked from sauloperez/neovim_config
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmappings.lua
163 lines (157 loc) · 6.94 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
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
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
---@type MappingsTable
local M = {}
M.general = {
n = {
[";"] = { ":", "enter command mode", opts = { nowait = true } },
},
}
M.copilot = {
plugin = true,
[''] = {
-- Copilot
["<leader>tc"] = {
"<cmd> lua require('copilot.suggestion').toggle_auto_trigger()<CR><cmd>Copilot status<CR>",
"Copilot toggle suggestions",
},
["<leader>tC"] = {
"<cmd>Copilot disable<CR>",
"Copilot disable",
},
-- -- do not enable this one or it will make c-e not working
-- ["<A-]>"] = {
-- "<Nop>",
-- "Copilot suggestion next",
-- },
-- ["<A-[>"] = {
-- "<Nop>",
-- "Copilot suggestion prev",
-- },
-- ["<C-y>"] = {
-- "<Nop>",
-- "Copilot accept",
-- },
-- ["<C-e>"] = {
-- "<Nop>",
-- "Copilot cancel",
-- },
-- toggles
-- multiple copilot options, autosuggests / enable / disable, but normally with the previous one we should have enough
-- ["<leader>tcs"] = {
-- "<cmd> lua require('copilot.suggestion').toggle_auto_trigger()<CR><cmd>Copilot status<CR>",
-- "toggle Copilot suggestions",
-- { silent = true },
-- },
-- ["<leader>tcd"] = {
-- "<cmd>Copilot disable<CR>",
-- "toggle Copilot (disable)",
-- { silent = true },
-- },
-- ["<leader>tce"] = {
-- "<cmd>Copilot enable<CR>",
-- "toggle Copilot (enable)",
-- { silent = true },
-- -- },
},
}
M.gp = {
plugin = true,
-- Visual Mode mappings
v = {
["<C-g><C-t>"] = { ":<C-u>'<,'>GpChatNew tabnew<cr>", "ChatNew tabnew" },
["<C-g><C-v>"] = { ":<C-u>'<,'>GpChatNew vsplit<cr>", "ChatNew vsplit" },
["<C-g><C-x>"] = { ":<C-u>'<,'>GpChatNew split<cr>", "ChatNew split" },
["<C-g>a"] = { ":<C-u>'<,'>GpAppend<cr>", "Visual Append (after)" },
["<C-g>b"] = { ":<C-u>'<,'>GpPrepend<cr>", "Visual Prepend (before)" },
["<C-g>c"] = { ":<C-u>'<,'>GpChatNew<cr>", "Visual Chat New" },
-- ["<C-g>g"] = { group = "generate into new .." },
["<C-g>ge"] = { ":<C-u>'<,'>GpEnew<cr>", "Visual GpEnew" },
["<C-g>gn"] = { ":<C-u>'<,'>GpNew<cr>", "Visual GpNew" },
["<C-g>gp"] = { ":<C-u>'<,'>GpPopup<cr>", "Visual Popup" },
["<C-g>gt"] = { ":<C-u>'<,'>GpTabnew<cr>", "Visual GpTabnew" },
["<C-g>gv"] = { ":<C-u>'<,'>GpVnew<cr>", "Visual GpVnew" },
["<C-g>i"] = { ":<C-u>'<,'>GpImplement<cr>", "Implement selection" },
["<C-g>n"] = { "<cmd>GpNextAgent<cr>", "Next Agent" },
["<C-g>p"] = { ":<C-u>'<,'>GpChatPaste<cr>", "Visual Chat Paste" },
["<C-g>r"] = { ":<C-u>'<,'>GpRewrite<cr>", "Visual Rewrite" },
["<C-g>s"] = { "<cmd>GpStop<cr>", "GpStop" },
["<C-g>t"] = { ":<C-u>'<,'>GpChatToggle<cr>", "Visual Toggle Chat" },
-- ["<C-g>w"] = { group = "Whisper" },
["<C-g>wa"] = { ":<C-u>'<,'>GpWhisperAppend<cr>", "Whisper Append" },
["<C-g>wb"] = { ":<C-u>'<,'>GpWhisperPrepend<cr>", "Whisper Prepend" },
["<C-g>we"] = { ":<C-u>'<,'>GpWhisperEnew<cr>", "Whisper Enew" },
["<C-g>wn"] = { ":<C-u>'<,'>GpWhisperNew<cr>", "Whisper New" },
["<C-g>wp"] = { ":<C-u>'<,'>GpWhisperPopup<cr>", "Whisper Popup" },
["<C-g>wr"] = { ":<C-u>'<,'>GpWhisperRewrite<cr>", "Whisper Rewrite" },
["<C-g>wt"] = { ":<C-u>'<,'>GpWhisperTabnew<cr>", "Whisper Tabnew" },
["<C-g>wv"] = { ":<C-u>'<,'>GpWhisperVnew<cr>", "Whisper Vnew" },
["<C-g>ww"] = { ":<C-u>'<,'>GpWhisper<cr>", "Whisper" },
["<C-g>x"] = { ":<C-u>'<,'>GpContext<cr>", "Visual GpContext" },
},
--
-- -- Normal Mode mappings
n = {
["<C-g><C-t>"] = { "<cmd>GpChatNew tabnew<cr>", "New Chat tabnew" },
["<C-g><C-v>"] = { "<cmd>GpChatNew vsplit<cr>", "New Chat vsplit" },
["<C-g><C-x>"] = { "<cmd>GpChatNew split<cr>", "New Chat split" },
["<C-g>a"] = { "<cmd>GpAppend<cr>", "Append (after)" },
["<C-g>b"] = { "<cmd>GpPrepend<cr>", "Prepend (before)" },
["<C-g>c"] = { "<cmd>GpChatNew<cr>", "New Chat" },
["<C-g>f"] = { "<cmd>GpChatFinder<cr>", "Chat Finder" },
-- ["<C-g>g"] = { group = "generate into new .." },
["<C-g>ge"] = { "<cmd>GpEnew<cr>", "GpEnew" },
["<C-g>gn"] = { "<cmd>GpNew<cr>", "GpNew" },
["<C-g>gp"] = { "<cmd>GpPopup<cr>", "Popup" },
["<C-g>gt"] = { "<cmd>GpTabnew<cr>", "GpTabnew" },
["<C-g>gv"] = { "<cmd>GpVnew<cr>", "GpVnew" },
["<C-g>n"] = { "<cmd>GpNextAgent<cr>", "Next Agent" },
["<C-g>r"] = { "<cmd>GpRewrite<cr>", "Inline Rewrite" },
["<C-g>s"] = { "<cmd>GpStop<cr>", "GpStop" },
["<C-g>t"] = { "<cmd>GpChatToggle<cr>", "Toggle Chat" },
-- ["<C-g>w"] = { group = "Whisper" },
["<C-g>wa"] = { "<cmd>GpWhisperAppend<cr>", "Whisper Append (after)" },
["<C-g>wb"] = { "<cmd>GpWhisperPrepend<cr>", "Whisper Prepend (before)" },
["<C-g>we"] = { "<cmd>GpWhisperEnew<cr>", "Whisper Enew" },
["<C-g>wn"] = { "<cmd>GpWhisperNew<cr>", "Whisper New" },
["<C-g>wp"] = { "<cmd>GpWhisperPopup<cr>", "Whisper Popup" },
["<C-g>wr"] = { "<cmd>GpWhisperRewrite<cr>", "Whisper Inline Rewrite" },
["<C-g>wt"] = { "<cmd>GpWhisperTabnew<cr>", "Whisper Tabnew" },
["<C-g>wv"] = { "<cmd>GpWhisperVnew<cr>", "Whisper Vnew" },
["<C-g>ww"] = { "<cmd>GpWhisper<cr>", "Whisper" },
["<C-g>x"] = { "<cmd>GpContext<cr>", "Toggle GpContext" },
},
--
-- -- Insert Mode mappings
-- -- Insert mode mappings (continued)
i = {
["<C-g><C-t>"] = { "<cmd>GpChatNew tabnew<cr>", "New Chat tabnew" },
["<C-g><C-v>"] = { "<cmd>GpChatNew vsplit<cr>", "New Chat vsplit" },
["<C-g><C-x>"] = { "<cmd>GpChatNew split<cr>", "New Chat split" },
["<C-g>a"] = { "<cmd>GpAppend<cr>", "Append (after)" },
["<C-g>b"] = { "<cmd>GpPrepend<cr>", "Prepend (before)" },
["<C-g>c"] = { "<cmd>GpChatNew<cr>", "New Chat" },
["<C-g>f"] = { "<cmd>GpChatFinder<cr>", "Chat Finder" },
-- ["<C-g>g"] = { group = "generate into new .." },
["<C-g>ge"] = { "<cmd>GpEnew<cr>", "GpEnew" },
["<C-g>gn"] = { "<cmd>GpNew<cr>", "GpNew" },
["<C-g>gp"] = { "<cmd>GpPopup<cr>", "Popup" },
["<C-g>gt"] = { "<cmd>GpTabnew<cr>", "GpTabnew" },
["<C-g>gv"] = { "<cmd>GpVnew<cr>", "GpVnew" },
["<C-g>n"] = { "<cmd>GpNextAgent<cr>", "Next Agent" },
["<C-g>r"] = { "<cmd>GpRewrite<cr>", "Inline Rewrite" },
["<C-g>s"] = { "<cmd>GpStop<cr>", "GpStop" },
["<C-g>t"] = { "<cmd>GpChatToggle<cr>", "Toggle Chat" },
-- ["<C-g>w"] = { group = "Whisper" },
["<C-g>wa"] = { "<cmd>GpWhisperAppend<cr>", "Whisper Append (after)" },
["<C-g>wb"] = { "<cmd>GpWhisperPrepend<cr>", "Whisper Prepend (before)" },
["<C-g>we"] = { "<cmd>GpWhisperEnew<cr>", "Whisper Enew" },
["<C-g>wn"] = { "<cmd>GpWhisperNew<cr>", "Whisper New" },
["<C-g>wp"] = { "<cmd>GpWhisperPopup<cr>", "Whisper Popup" },
["<C-g>wr"] = { "<cmd>GpWhisperRewrite<cr>", "Whisper Inline Rewrite" },
["<C-g>wt"] = { "<cmd>GpWhisperTabnew<cr>", "Whisper Tabnew" },
["<C-g>wv"] = { "<cmd>GpWhisperVnew<cr>", "Whisper Vnew" },
["<C-g>ww"] = { "<cmd>GpWhisper<cr>", "Whisper" },
["<C-g>x"] = { "<cmd>GpContext<cr>", "Toggle GpContext" },
},
}
-- more keybinds!
return M