Compare commits
3 commits
3e49c39e53
...
e4de3f2670
Author | SHA1 | Date | |
---|---|---|---|
e4de3f2670 | |||
fdab14f6dc | |||
7c7e823b54 |
6
init.lua
6
init.lua
|
@ -18,6 +18,9 @@ vim.o.list = true
|
|||
vim.o.relativenumber = true
|
||||
vim.o.number = true
|
||||
|
||||
vim.g.mapleader = " "
|
||||
vim.g.maplocalleader = " "
|
||||
|
||||
vim.keymap.set("n", "\\q", "<cmd>wincmd q<cr>", { silent = true })
|
||||
vim.keymap.set("n", "zh", "<cmd>wincmd h<cr>", { silent = true })
|
||||
vim.keymap.set("n", "zj", "<cmd>wincmd j<cr>", { silent = true })
|
||||
|
@ -35,9 +38,6 @@ vim.keymap.set("n", "zx", "<cmd>bdelete<cr>", { silent = true })
|
|||
|
||||
vim.keymap.set("n", "<leader>nh", "<cmd>nohlsearch<cr>", { silent = true })
|
||||
|
||||
vim.g.mapleader = " "
|
||||
vim.g.maplocalleader = " "
|
||||
|
||||
-- Load custom config
|
||||
custom = {
|
||||
full_feature = false,
|
||||
|
|
|
@ -12,13 +12,13 @@ return {
|
|||
vim.keymap.set(mode, l, r, opts)
|
||||
end
|
||||
|
||||
m("n", "<leader>hj", function()
|
||||
m("n", "<leader>hn", function()
|
||||
if vim.wo.diff then return "]c" end
|
||||
vim.schedule(function() gs.next_hunk() end)
|
||||
return "<Ignore>"
|
||||
end, {expr=true})
|
||||
|
||||
m("n", "<leader>hk", function()
|
||||
m("n", "<leader>hp", function()
|
||||
if vim.wo.diff then return "[c" end
|
||||
vim.schedule(function() gs.prev_hunk() end)
|
||||
return "<Ignore>"
|
||||
|
@ -31,7 +31,7 @@ return {
|
|||
m("n", "<leader>hS", gs.stage_buffer)
|
||||
m("n", "<leader>hu", gs.undo_stage_hunk)
|
||||
m("n", "<leader>hR", gs.reset_buffer)
|
||||
m("n", "<leader>hp", gs.preview_hunk)
|
||||
m("n", "<leader>hv", gs.preview_hunk)
|
||||
m("n", "<leader>hb", function() gs.blame_line{full=true} end)
|
||||
m("n", "<leader>htb", gs.toggle_current_line_blame)
|
||||
m("n", "<leader>hd", gs.diffthis)
|
||||
|
|
|
@ -15,6 +15,7 @@ function setup_keymap_lsp()
|
|||
-- Buffer local mappings.
|
||||
-- See `:help vim.lsp.*` for documentation on any of the below functions
|
||||
local opts = { buffer = ev.buf }
|
||||
vim.keymap.set("n", "gt", vim.lsp.buf.type_definition, opts)
|
||||
vim.keymap.set("n", "gD", vim.lsp.buf.declaration, opts)
|
||||
vim.keymap.set("n", "gd", vim.lsp.buf.definition, opts)
|
||||
vim.keymap.set("n", "gi", vim.lsp.buf.implementation, opts)
|
||||
|
@ -26,10 +27,9 @@ function setup_keymap_lsp()
|
|||
vim.keymap.set("n", "<leader>wl", function()
|
||||
print(vim.inspect(vim.lsp.buf.list_workspace_folders()))
|
||||
end, opts)
|
||||
vim.keymap.set("n", "<leader>D", vim.lsp.buf.type_definition, opts)
|
||||
vim.keymap.set("n", "<leader>rn", vim.lsp.buf.rename, opts)
|
||||
vim.keymap.set({ "n", "v" }, "<leader>ca", vim.lsp.buf.code_action, opts)
|
||||
vim.keymap.set("n", "<leader>f", function()
|
||||
vim.keymap.set("n", "gR", vim.lsp.buf.rename, opts)
|
||||
vim.keymap.set({ "n", "v" }, "ga", vim.lsp.buf.code_action, opts)
|
||||
vim.keymap.set("n", "g=", function()
|
||||
vim.lsp.buf.format { async = true }
|
||||
end, opts)
|
||||
end,
|
||||
|
@ -92,10 +92,13 @@ return {
|
|||
setup_keymap_lsp()
|
||||
end,
|
||||
keys = {
|
||||
{ "<leader>e", vim.diagnostic.open_float, mode = "n" },
|
||||
{ "[d", vim.diagnostic.goto_prev, mode = "n" },
|
||||
{ "]d", vim.diagnostic.goto_next, mode = "n" },
|
||||
{ "<leader>q", vim.diagnostic.setloclist, mode = "n" }
|
||||
{ "gs", "<cmd>LspStart<cr>", mode = "n" },
|
||||
{ "gS", "<cmd>LspStop<cr>", mode = "n" },
|
||||
{ "gI", "<cmd>LspInfo<cr>", mode = "n" },
|
||||
{ "ge", vim.diagnostic.open_float, mode = "n" },
|
||||
{ "gp", vim.diagnostic.goto_prev, mode = "n" },
|
||||
{ "gn", vim.diagnostic.goto_next, mode = "n" },
|
||||
{ "gq", vim.diagnostic.setloclist, mode = "n" }
|
||||
},
|
||||
},
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue