|
@@ -43,10 +43,10 @@ map("n", "<leader>wq", ":wqa!<CR>", opt)
|
|
|
map("n", "qq", ":q!<CR>", opt)
|
|
|
map("n", "<leader>q", ":qa!<CR>", opt)
|
|
|
|
|
|
-map("n", "<C-j>", "5j", opt)
|
|
|
-map("n", "<C-k>", "5k", opt)
|
|
|
-map("v", "<C-j>", "5j", opt)
|
|
|
-map("v", "<C-k>", "5k", opt)
|
|
|
+map("n", "<A-j>", "5j", opt)
|
|
|
+map("n", "<A-k>", "5k", opt)
|
|
|
+map("v", "<A-j>", "5j", opt)
|
|
|
+map("v", "<A-k>", "5k", opt)
|
|
|
|
|
|
|
|
|
|
|
@@ -59,6 +59,10 @@ map("n", "<leader>g", ":Telescope git_files<CR>", opt)
|
|
|
map("n", "<leader>p", ":Telescope projects<CR>", opt)
|
|
|
|
|
|
map("n", "<leader>u", ":PackerUpdate<CR>", opt)
|
|
|
+
|
|
|
+
|
|
|
+map("n", "<leader>cf", ":Prettier<CR>", opt)
|
|
|
+
|
|
|
|
|
|
local pluginKeys = {}
|
|
|
|
|
@@ -135,4 +139,59 @@ pluginKeys.nvimTreeList = {
|
|
|
action = "dir_up"
|
|
|
}}
|
|
|
|
|
|
+
|
|
|
+pluginKeys.lspList = function(bufnr)
|
|
|
+
|
|
|
+ bufmap(bufnr, "n", "<leader>rn", "<cmd>Lspsaga rename<CR>", opt)
|
|
|
+
|
|
|
+ bufmap(bufnr, "n", "<leader>ca", "<cmd>Lspsaga cade_action<CR>", opt)
|
|
|
+
|
|
|
+
|
|
|
+ bufmap(bufnr, "n", "gd", "<cmd>Lspsaga goto_definition<CR>", opt)
|
|
|
+
|
|
|
+ bufmap(bufnr, "n", "gt", "<cmd>Lspsaga goto_type_definition<CR>", opt)
|
|
|
+ bufmap(bufnr, "n", "gD", "<cmd>lua vim.lsp.buf.declaration()<CR>", opt)
|
|
|
+
|
|
|
+ bufmap(bufnr, "n", "gh", "<cmd>Lspsaga hover_doc<CR>", opt)
|
|
|
+ bufmap(bufnr, "n", "gi", "<cmd>lua vim.lsp.buf.implementation()<CR>", opt)
|
|
|
+
|
|
|
+ bufmap(bufnr, "n", "gr", "<cmd>Lspsaga lsp_finder<CR>", opt)
|
|
|
+
|
|
|
+
|
|
|
+ bufmap(bufnr, "n", "go", "<cmd>Lspsaga show_line_diagnostics<CR>", opt)
|
|
|
+
|
|
|
+ bufmap(bufnr, "n", "gn", "<cmd>Lspsaga diagnostic_jump_next<CR>", opt)
|
|
|
+
|
|
|
+ bufmap(bufnr, "n", "gp", "<cmd>Lspsaga diagnostic_jump_prev<CR>", opt)
|
|
|
+ bufmap(bufnr, "n", "<leader>f", "<cmd>lua vim.lsp.buf.format({ async = true })<CR>", opt)
|
|
|
+ bufmap(bufnr, "n", [[<M-\>]], "<cmd>Lspsaga term_toggle<CR>", opt)
|
|
|
+ bufmap(bufnr, "t", [[<M-\>]], "<cmd>Lspsaga term_toggle<CR>", opt)
|
|
|
+end
|
|
|
+
|
|
|
+
|
|
|
+pluginKeys.cmp = function(cmp)
|
|
|
+ return {
|
|
|
+
|
|
|
+ ["<A-.>"] = cmp.mapping(cmp.mapping.complete(), {"i", "c"}),
|
|
|
+
|
|
|
+ ["<A-,>"] = cmp.mapping({
|
|
|
+ i = cmp.mapping.abort(),
|
|
|
+ c = cmp.mapping.close()
|
|
|
+ }),
|
|
|
+
|
|
|
+ ["<C-k>"] = cmp.mapping.select_prev_item(),
|
|
|
+
|
|
|
+ ["<C-j>"] = cmp.mapping.select_next_item(),
|
|
|
+
|
|
|
+ ["<CR>"] = cmp.mapping.confirm({
|
|
|
+ select = true,
|
|
|
+ behavior = cmp.ConfirmBehavior.Replace
|
|
|
+ }),
|
|
|
+
|
|
|
+ ["<C-u>"] = cmp.mapping(cmp.mapping.scroll_docs(-4), {"i", "c"}),
|
|
|
+ ["<C-d>"] = cmp.mapping(cmp.mapping.scroll_docs(4), {"i", "c"}),
|
|
|
+ }
|
|
|
+end
|
|
|
+
|
|
|
+
|
|
|
return pluginKeys
|