mirror of
https://github.com/dcarrillo/dotfiles.git
synced 2024-12-22 18:38:00 +00:00
[neovim] Linting, grouping anf fixing
This commit is contained in:
parent
3cf635cd67
commit
62bcbad040
@ -30,7 +30,9 @@ keymap("n", "<C-Right>", ":vertical resize +2<CR>", opts)
|
|||||||
|
|
||||||
-- Navigate buffers
|
-- Navigate buffers
|
||||||
keymap("n", "<S-l>", ":bnext<CR>", opts)
|
keymap("n", "<S-l>", ":bnext<CR>", opts)
|
||||||
|
keymap("n", "<C-PageDown>", ":bnext<CR>", opts)
|
||||||
keymap("n", "<S-h>", ":bprevious<CR>", opts)
|
keymap("n", "<S-h>", ":bprevious<CR>", opts)
|
||||||
|
keymap("n", "<C-PageUp>", ":bprevious<CR>", opts)
|
||||||
|
|
||||||
-- Clear highlights
|
-- Clear highlights
|
||||||
keymap("n", "<leader>h", "<cmd>nohlsearch<CR>", opts)
|
keymap("n", "<leader>h", "<cmd>nohlsearch<CR>", opts)
|
||||||
@ -53,6 +55,8 @@ keymap("n", "<leader>lj", "<cmd>Lspsaga diagnostic_jump_next<cr>", opts)
|
|||||||
keymap("n", "<leader>lk", "<cmd>Lspsaga diagnostic_jump_prev<cr>", opts)
|
keymap("n", "<leader>lk", "<cmd>Lspsaga diagnostic_jump_prev<cr>", opts)
|
||||||
keymap("n", "<leader>lr", "<cmd>Lspsaga rename<cr>", opts)
|
keymap("n", "<leader>lr", "<cmd>Lspsaga rename<cr>", opts)
|
||||||
keymap("n", "<leader>lp", "<cmd>Lspsaga peek_definition<cr>", opts)
|
keymap("n", "<leader>lp", "<cmd>Lspsaga peek_definition<cr>", opts)
|
||||||
|
keymap("n", "<leader>lf", "<cmd>lua vim.lsp.buf.format{ async=true }<cr>", opts)
|
||||||
|
keymap("n", "<leader>ls", "<cmd>lua vim.lsp.buf.signature_help()<cr>", opts)
|
||||||
|
|
||||||
-- Better paste
|
-- Better paste
|
||||||
keymap("v", "p", '"_dP', opts)
|
keymap("v", "p", '"_dP', opts)
|
||||||
|
@ -28,8 +28,8 @@ gitsigns.setup({
|
|||||||
map({ "n", "v" }, "<leader>hr", ":Gitsigns reset_hunk<CR>")
|
map({ "n", "v" }, "<leader>hr", ":Gitsigns reset_hunk<CR>")
|
||||||
map("n", "<leader>hp", gs.preview_hunk)
|
map("n", "<leader>hp", gs.preview_hunk)
|
||||||
map("n", "<leader>hR", gs.reset_buffer)
|
map("n", "<leader>hR", gs.reset_buffer)
|
||||||
map('n', '<leader>hd', gs.diffthis)
|
map("n", "<leader>hd", gs.diffthis)
|
||||||
map('n', '<leader>hj', gs.next_hunk)
|
map("n", "<leader>hj", gs.next_hunk)
|
||||||
map('n', '<leader>hk', gs.prev_hunk)
|
map("n", "<leader>hk", gs.prev_hunk)
|
||||||
end,
|
end,
|
||||||
})
|
})
|
||||||
|
@ -49,15 +49,7 @@ M.setup = function()
|
|||||||
})
|
})
|
||||||
end
|
end
|
||||||
|
|
||||||
local function lsp_keymaps(bufnr)
|
M.on_attach = function(client)
|
||||||
local opts = { noremap = true, silent = true }
|
|
||||||
local keymap = vim.api.nvim_buf_set_keymap
|
|
||||||
|
|
||||||
keymap(bufnr, "n", "<leader>lf", "<cmd>lua vim.lsp.buf.format{ async=true }<cr>", opts)
|
|
||||||
keymap(bufnr, "n", "<leader>ls", "<cmd>lua vim.lsp.buf.signature_help()<CR>", opts)
|
|
||||||
end
|
|
||||||
|
|
||||||
M.on_attach = function(client, bufnr)
|
|
||||||
if client.name == "tsserver" then
|
if client.name == "tsserver" then
|
||||||
client.server_capabilities.document_formatting = false
|
client.server_capabilities.document_formatting = false
|
||||||
end
|
end
|
||||||
@ -66,7 +58,6 @@ M.on_attach = function(client, bufnr)
|
|||||||
client.server_capabilities.document_formatting = false
|
client.server_capabilities.document_formatting = false
|
||||||
end
|
end
|
||||||
|
|
||||||
lsp_keymaps(bufnr)
|
|
||||||
local status_ok, illuminate = pcall(require, "illuminate")
|
local status_ok, illuminate = pcall(require, "illuminate")
|
||||||
if not status_ok then
|
if not status_ok then
|
||||||
return
|
return
|
||||||
|
Loading…
Reference in New Issue
Block a user