Compare commits

..

No commits in common. "9b4fbc5021551188965d7cba54874fd1496d6ed2" and "648471c9eb1f757729e800ff0a6509e01232a8e9" have entirely different histories.

View File

@ -616,8 +616,6 @@ require('lazy').setup({
-- Special Lua Config, as recommended by neovim help docs -- Special Lua Config, as recommended by neovim help docs
lua_ls = { lua_ls = {
on_init = function(client) on_init = function(client)
client.server_capabilities.documentFormattingProvider = false -- Disable formatting (formatting is done by stylua)
if client.workspace_folders then if client.workspace_folders then
local path = client.workspace_folders[1].name local path = client.workspace_folders[1].name
if path ~= vim.fn.stdpath 'config' and (vim.uv.fs_stat(path .. '/.luarc.json') or vim.uv.fs_stat(path .. '/.luarc.jsonc')) then return end if path ~= vim.fn.stdpath 'config' and (vim.uv.fs_stat(path .. '/.luarc.json') or vim.uv.fs_stat(path .. '/.luarc.jsonc')) then return end
@ -639,11 +637,8 @@ require('lazy').setup({
}, },
}) })
end, end,
---@type lspconfig.settings.lua_ls
settings = { settings = {
Lua = { Lua = {},
format = { enable = false }, -- Disable formatting (formatting is done by stylua)
},
}, },
}, },
} }
@ -676,7 +671,7 @@ require('lazy').setup({
keys = { keys = {
{ {
'<leader>f', '<leader>f',
function() require('conform').format { async = true } end, function() require('conform').format { async = true, lsp_format = 'fallback' } end,
mode = '', mode = '',
desc = '[F]ormat buffer', desc = '[F]ormat buffer',
}, },
@ -686,23 +681,21 @@ require('lazy').setup({
opts = { opts = {
notify_on_error = false, notify_on_error = false,
format_on_save = function(bufnr) format_on_save = function(bufnr)
-- You can specify filetypes to autoformat on save here: -- Disable "format_on_save lsp_fallback" for languages that don't
local enabled_filetypes = { -- have a well standardized coding style. You can add additional
-- lua = true, -- languages here or re-enable it for the disabled ones.
-- python = true, local disable_filetypes = { c = true, cpp = true }
} if disable_filetypes[vim.bo[bufnr].filetype] then
if enabled_filetypes[vim.bo[bufnr].filetype] then
return { timeout_ms = 500 }
else
return nil return nil
else
return {
timeout_ms = 500,
lsp_format = 'fallback',
}
end end
end, end,
default_format_opts = {
lsp_format = 'fallback', -- Use external formatters if configured below, otherwise use LSP formatting. Set to `false` to disable LSP formatting entirely.
},
-- You can also specify external formatters in here.
formatters_by_ft = { formatters_by_ft = {
-- rust = { 'rustfmt' }, lua = { 'stylua' },
-- Conform can also run multiple formatters sequentially -- Conform can also run multiple formatters sequentially
-- python = { "isort", "black" }, -- python = { "isort", "black" },
-- --
@ -845,16 +838,9 @@ require('lazy').setup({
-- --
-- Examples: -- Examples:
-- - va) - [V]isually select [A]round [)]paren -- - va) - [V]isually select [A]round [)]paren
-- - yinq - [Y]ank [I]nside [I]next [Q]uote -- - yinq - [Y]ank [I]nside [N]ext [Q]uote
-- - ci' - [C]hange [I]nside [']quote -- - ci' - [C]hange [I]nside [']quote
require('mini.ai').setup { require('mini.ai').setup { n_lines = 500 }
-- NOTE: Avoid conflicts with the built-in incremental selection mappings on Neovim>=0.12 (see `:help treesitter-incremental-selection`)
mappings = {
around_next = 'aa',
inside_next = 'ii',
},
n_lines = 500,
}
-- Add/delete/replace surroundings (brackets, quotes, etc.) -- Add/delete/replace surroundings (brackets, quotes, etc.)
-- --