(neovim) code formatting
This commit is contained in:
parent
aee5f18c4a
commit
95b8aef98d
7 changed files with 47 additions and 47 deletions
|
@ -74,7 +74,7 @@ vim.api.nvim_create_autocmd("LspAttach", {
|
||||||
end
|
end
|
||||||
local client = vim.lsp.get_client_by_id(event.data.client_id)
|
local client = vim.lsp.get_client_by_id(event.data.client_id)
|
||||||
if
|
if
|
||||||
client and client_supports_method(client, vim.lsp.protocol.Methods.textDocument_documentHighlight, event.buf)
|
client and client_supports_method(client, vim.lsp.protocol.Methods.textDocument_documentHighlight, event.buf)
|
||||||
then
|
then
|
||||||
local highlight_augroup = vim.api.nvim_create_augroup("lsp-highlight", { clear = false })
|
local highlight_augroup = vim.api.nvim_create_augroup("lsp-highlight", { clear = false })
|
||||||
vim.api.nvim_create_autocmd({ "CursorHold", "CursorHoldI" }, {
|
vim.api.nvim_create_autocmd({ "CursorHold", "CursorHoldI" }, {
|
||||||
|
|
|
@ -5,7 +5,7 @@ if not (vim.uv or vim.loop).fs_stat(lazypath) then
|
||||||
if vim.v.shell_error ~= 0 then
|
if vim.v.shell_error ~= 0 then
|
||||||
vim.api.nvim_echo({
|
vim.api.nvim_echo({
|
||||||
{ "Failed to clone lazy.nvim:\n", "ErrorMsg" },
|
{ "Failed to clone lazy.nvim:\n", "ErrorMsg" },
|
||||||
{ out, "WarningMsg" },
|
{ out, "WarningMsg" },
|
||||||
{ "\nPress any key to exit..." },
|
{ "\nPress any key to exit..." },
|
||||||
}, true, {})
|
}, true, {})
|
||||||
vim.fn.getchar()
|
vim.fn.getchar()
|
||||||
|
|
|
@ -113,24 +113,24 @@ local function check_lsp_capabilities()
|
||||||
local caps = client.server_capabilities
|
local caps = client.server_capabilities
|
||||||
|
|
||||||
local capability_list = {
|
local capability_list = {
|
||||||
{ "Completion", caps.completionProvider },
|
{ "Completion", caps.completionProvider },
|
||||||
{ "Hover", caps.hoverProvider },
|
{ "Hover", caps.hoverProvider },
|
||||||
{ "Signature Help", caps.signatureHelpProvider },
|
{ "Signature Help", caps.signatureHelpProvider },
|
||||||
{ "Go to Definition", caps.definitionProvider },
|
{ "Go to Definition", caps.definitionProvider },
|
||||||
{ "Go to Declaration", caps.declarationProvider },
|
{ "Go to Declaration", caps.declarationProvider },
|
||||||
{ "Go to Implementation", caps.implementationProvider },
|
{ "Go to Implementation", caps.implementationProvider },
|
||||||
{ "Go to Type Definition", caps.typeDefinitionProvider },
|
{ "Go to Type Definition", caps.typeDefinitionProvider },
|
||||||
{ "Find References", caps.referencesProvider },
|
{ "Find References", caps.referencesProvider },
|
||||||
{ "Document Highlight", caps.documentHighlightProvider },
|
{ "Document Highlight", caps.documentHighlightProvider },
|
||||||
{ "Document Symbol", caps.documentSymbolProvider },
|
{ "Document Symbol", caps.documentSymbolProvider },
|
||||||
{ "Workspace Symbol", caps.workspaceSymbolProvider },
|
{ "Workspace Symbol", caps.workspaceSymbolProvider },
|
||||||
{ "Code Action", caps.codeActionProvider },
|
{ "Code Action", caps.codeActionProvider },
|
||||||
{ "Code Lens", caps.codeLensProvider },
|
{ "Code Lens", caps.codeLensProvider },
|
||||||
{ "Document Formatting", caps.documentFormattingProvider },
|
{ "Document Formatting", caps.documentFormattingProvider },
|
||||||
{ "Document Range Formatting", caps.documentRangeFormattingProvider },
|
{ "Document Range Formatting", caps.documentRangeFormattingProvider },
|
||||||
{ "Rename", caps.renameProvider },
|
{ "Rename", caps.renameProvider },
|
||||||
{ "Folding Range", caps.foldingRangeProvider },
|
{ "Folding Range", caps.foldingRangeProvider },
|
||||||
{ "Selection Range", caps.selectionRangeProvider },
|
{ "Selection Range", caps.selectionRangeProvider },
|
||||||
}
|
}
|
||||||
|
|
||||||
for _, cap in ipairs(capability_list) do
|
for _, cap in ipairs(capability_list) do
|
||||||
|
|
|
@ -17,8 +17,8 @@ local lualine_sections = {
|
||||||
lualine_x = {},
|
lualine_x = {},
|
||||||
lualine_y = {
|
lualine_y = {
|
||||||
{ "searchcount" },
|
{ "searchcount" },
|
||||||
{ "progress", padding = { left = 1, right = 0 }, separator = " " },
|
{ "progress", padding = { left = 1, right = 0 }, separator = " " },
|
||||||
{ "location", padding = { left = 0, right = 1 } },
|
{ "location", padding = { left = 0, right = 1 } },
|
||||||
},
|
},
|
||||||
lualine_z = {},
|
lualine_z = {},
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,31 +1,31 @@
|
||||||
return {
|
return {
|
||||||
{
|
{
|
||||||
"echasnovski/mini.pairs",
|
"echasnovski/mini.pairs",
|
||||||
event = "VeryLazy",
|
event = "VeryLazy",
|
||||||
config = function()
|
config = function()
|
||||||
require("mini.pairs").setup({
|
require("mini.pairs").setup({
|
||||||
modes = { insert = true, command = true, terminal = false },
|
modes = { insert = true, command = true, terminal = false },
|
||||||
skip_next = [=[[%w%%%'%[%"%.%`%$]]=],
|
skip_next = [=[[%w%%%'%[%"%.%`%$]]=],
|
||||||
skip_ts = { "string" },
|
skip_ts = { "string" },
|
||||||
skip_unbalanced = true,
|
skip_unbalanced = true,
|
||||||
markdown = true,
|
markdown = true,
|
||||||
})
|
})
|
||||||
end,
|
end,
|
||||||
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"loctvl842/monokai-pro.nvim",
|
"loctvl842/monokai-pro.nvim",
|
||||||
priority = 10000,
|
priority = 10000,
|
||||||
lazy = false,
|
lazy = false,
|
||||||
dependencies = {
|
dependencies = {
|
||||||
"echasnovski/mini.icons",
|
"echasnovski/mini.icons",
|
||||||
"echasnovski/mini.pairs",
|
"echasnovski/mini.pairs",
|
||||||
},
|
},
|
||||||
config = function()
|
config = function()
|
||||||
require("monokai-pro").setup({
|
require("monokai-pro").setup({
|
||||||
filter = "classic",
|
filter = "classic",
|
||||||
})
|
})
|
||||||
vim.cmd.colorscheme("monokai-pro")
|
vim.cmd.colorscheme("monokai-pro")
|
||||||
end,
|
end,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -8,7 +8,7 @@ local whichkey_spec = {
|
||||||
|
|
||||||
if MainHost then
|
if MainHost then
|
||||||
vim.list_extend(whichkey_spec, {
|
vim.list_extend(whichkey_spec, {
|
||||||
{ "<leader>c", group = "code" },
|
{ "<leader>c", group = "code" },
|
||||||
{ "<leader>cd", vim.diagnostic.open_float, { desc = "diagnostics", remap = true } },
|
{ "<leader>cd", vim.diagnostic.open_float, { desc = "diagnostics", remap = true } },
|
||||||
{
|
{
|
||||||
"<leader>cf",
|
"<leader>cf",
|
||||||
|
|
|
@ -39,7 +39,7 @@ return {
|
||||||
draw = {
|
draw = {
|
||||||
columns = {
|
columns = {
|
||||||
{ "kind_icon" },
|
{ "kind_icon" },
|
||||||
{ "label", "label_description", gap = 1 },
|
{ "label", "label_description", gap = 1 },
|
||||||
{ "kind" },
|
{ "kind" },
|
||||||
{ "source_name" },
|
{ "source_name" },
|
||||||
},
|
},
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue