Compare commits
17 Commits
Author | SHA1 | Date | |
---|---|---|---|
c42ebc216a | |||
bdddb215cc | |||
eb143ebe11 | |||
86ac9989ea | |||
dc1d48f436 | |||
5202a0f006 | |||
7b9145c12d | |||
3e46dd61cd | |||
43763a6226 | |||
6c334fed6a | |||
d18331ca89 | |||
59f3b3e096 | |||
4fbb7a2803 | |||
b760ec63c4 | |||
d565684ade | |||
c7aeda9db1 | |||
3a718c5c85 |
34
CHANGELOG.md
34
CHANGELOG.md
@ -1,5 +1,39 @@
|
||||
# Changelog
|
||||
|
||||
## [2.12.1](https://github.com/LazyVim/LazyVim/compare/v2.12.0...v2.12.1) (2023-04-28)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* **format:** only do null-ls formatting logic when null-ls is availble. Fixes [#684](https://github.com/LazyVim/LazyVim/issues/684) ([eb143eb](https://github.com/LazyVim/LazyVim/commit/eb143ebe110995fb208fc480958a55858944c5f9))
|
||||
|
||||
## [2.12.0](https://github.com/LazyVim/LazyVim/compare/v2.11.0...v2.12.0) (2023-04-24)
|
||||
|
||||
|
||||
### Features
|
||||
|
||||
* **bufferline:** use `mini.bufremove` to close a buffer ([#670](https://github.com/LazyVim/LazyVim/issues/670)) ([3e46dd6](https://github.com/LazyVim/LazyVim/commit/3e46dd61cdc79bbb915f81e4188fc5337cd2f84b))
|
||||
* **telescope:** added keymap for recent files in the current directory. ([#669](https://github.com/LazyVim/LazyVim/issues/669)) ([6c334fe](https://github.com/LazyVim/LazyVim/commit/6c334fed6a59f6b1dc3a38f6253f2b4265557f30))
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* **spectre:** use new url by default ([7b9145c](https://github.com/LazyVim/LazyVim/commit/7b9145c12d15a81e40a721974a9a68994ccd8855))
|
||||
|
||||
## [2.11.0](https://github.com/LazyVim/LazyVim/compare/v2.10.0...v2.11.0) (2023-04-23)
|
||||
|
||||
|
||||
### Features
|
||||
|
||||
* **dap:** Change DAP REPL binding from open to toggle ([#663](https://github.com/LazyVim/LazyVim/issues/663)) ([3a718c5](https://github.com/LazyVim/LazyVim/commit/3a718c5c85e966e2751dade0006dcbeed72e8b00))
|
||||
* **lsp:** automatically resolve denols/tsserver conflicts if both are configured ([d565684](https://github.com/LazyVim/LazyVim/commit/d565684ade6e04eb77319ddb5becac9c5bd21cc4))
|
||||
* **plugins:** automatically handle plugin repo renames ([59f3b3e](https://github.com/LazyVim/LazyVim/commit/59f3b3e096280629a459054bc5538c058854dffc))
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* **health:** remove deprecated api warning ([#666](https://github.com/LazyVim/LazyVim/issues/666)) ([4fbb7a2](https://github.com/LazyVim/LazyVim/commit/4fbb7a280310a6ea500509aa73a4f7c7d06f6bea))
|
||||
|
||||
## [2.10.0](https://github.com/LazyVim/LazyVim/compare/v2.9.0...v2.10.0) (2023-04-21)
|
||||
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
*LazyVim.txt* For Neovim >= 0.8.0 Last change: 2023 April 21
|
||||
*LazyVim.txt* For Neovim >= 0.8.0 Last change: 2023 April 28
|
||||
|
||||
==============================================================================
|
||||
Table of Contents *LazyVim-table-of-contents*
|
||||
|
@ -77,6 +77,10 @@ local defaults = {
|
||||
},
|
||||
}
|
||||
|
||||
M.renames = {
|
||||
["windwp/nvim-spectre"] = "nvim-pack/nvim-spectre",
|
||||
}
|
||||
|
||||
---@type LazyVimConfig
|
||||
local options
|
||||
|
||||
@ -170,6 +174,14 @@ function M.init()
|
||||
-- this is needed to make sure options will be correctly applied
|
||||
-- after installing missing plugins
|
||||
require("lazyvim.config").load("options")
|
||||
local Plugin = require("lazy.core.plugin")
|
||||
local add = Plugin.Spec.add
|
||||
Plugin.Spec.add = function(self, plugin, ...)
|
||||
if type(plugin) == "table" and M.renames[plugin[1]] then
|
||||
plugin[1] = M.renames[plugin[1]]
|
||||
end
|
||||
return add(self, plugin, ...)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
|
@ -1,12 +1,17 @@
|
||||
local M = {}
|
||||
|
||||
local start = vim.health.start or vim.health.report_start
|
||||
local ok = vim.health.ok or vim.health.report_ok
|
||||
local warn = vim.health.warn or vim.health.report_warn
|
||||
local error = vim.health.error or vim.health.report_error
|
||||
|
||||
function M.check()
|
||||
vim.health.report_start("LazyVim")
|
||||
start("LazyVim")
|
||||
|
||||
if vim.fn.has("nvim-0.8.0") == 1 then
|
||||
vim.health.report_ok("Using Neovim >= 0.8.0")
|
||||
ok("Using Neovim >= 0.8.0")
|
||||
else
|
||||
vim.health.report_error("Neovim >= 0.8.0 is required")
|
||||
error("Neovim >= 0.8.0 is required")
|
||||
end
|
||||
|
||||
for _, cmd in ipairs({ "git", "rg", { "fd", "fdfind" }, "lazygit" }) do
|
||||
@ -23,9 +28,9 @@ function M.check()
|
||||
end
|
||||
|
||||
if found then
|
||||
vim.health.report_ok(("`%s` is installed"):format(name))
|
||||
ok(("`%s` is installed"):format(name))
|
||||
else
|
||||
vim.health.report_warn(("`%s` is not installed"):format(name))
|
||||
warn(("`%s` is not installed"):format(name))
|
||||
end
|
||||
end
|
||||
end
|
||||
|
@ -71,7 +71,7 @@ return {
|
||||
|
||||
-- search/replace in multiple files
|
||||
{
|
||||
"windwp/nvim-spectre",
|
||||
"nvim-pack/nvim-spectre",
|
||||
-- stylua: ignore
|
||||
keys = {
|
||||
{ "<leader>sr", function() require("spectre").open() end, desc = "Replace in files (Spectre)" },
|
||||
@ -93,6 +93,7 @@ return {
|
||||
{ "<leader>ff", Util.telescope("files"), desc = "Find Files (root dir)" },
|
||||
{ "<leader>fF", Util.telescope("files", { cwd = false }), desc = "Find Files (cwd)" },
|
||||
{ "<leader>fr", "<cmd>Telescope oldfiles<cr>", desc = "Recent" },
|
||||
{ "<leader>fR", Util.telescope("oldfiles", { cwd = vim.loop.cwd() }), desc = "Recent (cwd)" },
|
||||
-- git
|
||||
{ "<leader>gc", "<cmd>Telescope git_commits<CR>", desc = "commits" },
|
||||
{ "<leader>gs", "<cmd>Telescope git_status<CR>", desc = "status" },
|
||||
|
@ -82,7 +82,7 @@ return {
|
||||
{ "<leader>do", function() require("dap").step_out() end, desc = "Step Out" },
|
||||
{ "<leader>dO", function() require("dap").step_over() end, desc = "Step Over" },
|
||||
{ "<leader>dp", function() require("dap").pause() end, desc = "Pause" },
|
||||
{ "<leader>dr", function() require("dap").repl.open() end, desc = "Repl" },
|
||||
{ "<leader>dr", function() require("dap").repl.toggle() end, desc = "Toggle REPL" },
|
||||
{ "<leader>ds", function() require("dap").session() end, desc = "Session" },
|
||||
{ "<leader>dt", function() require("dap").terminate() end, desc = "Terminate" },
|
||||
{ "<leader>dw", function() require("dap.ui.widgets").hover() end, desc = "Widgets" },
|
||||
|
@ -25,7 +25,8 @@ function M.format(opts)
|
||||
return
|
||||
end
|
||||
local ft = vim.bo[buf].filetype
|
||||
local have_nls = #require("null-ls.sources").get_available(ft, "NULL_LS_FORMATTING") > 0
|
||||
local have_nls = package.loaded["null-ls"]
|
||||
and (#require("null-ls.sources").get_available(ft, "NULL_LS_FORMATTING") > 0)
|
||||
|
||||
vim.lsp.buf.format(vim.tbl_deep_extend("force", {
|
||||
bufnr = buf,
|
||||
|
@ -75,10 +75,11 @@ return {
|
||||
},
|
||||
---@param opts PluginLspOpts
|
||||
config = function(_, opts)
|
||||
local Util = require("lazyvim.util")
|
||||
-- setup autoformat
|
||||
require("lazyvim.plugins.lsp.format").autoformat = opts.autoformat
|
||||
-- setup formatting and keymaps
|
||||
require("lazyvim.util").on_attach(function(client, buffer)
|
||||
Util.on_attach(function(client, buffer)
|
||||
require("lazyvim.plugins.lsp.format").on_attach(client, buffer)
|
||||
require("lazyvim.plugins.lsp.keymaps").on_attach(client, buffer)
|
||||
end)
|
||||
@ -153,6 +154,14 @@ return {
|
||||
mlsp.setup({ ensure_installed = ensure_installed })
|
||||
mlsp.setup_handlers({ setup })
|
||||
end
|
||||
|
||||
if Util.lsp_get_config("denols") and Util.lsp_get_config("tsserver") then
|
||||
local is_deno = require("lspconfig.util").root_pattern("deno.json", "deno.jsonc")
|
||||
Util.lsp_disable("tsserver", is_deno)
|
||||
Util.lsp_disable("denols", function(root_dir)
|
||||
return not is_deno(root_dir)
|
||||
end)
|
||||
end
|
||||
end,
|
||||
},
|
||||
|
||||
|
@ -8,7 +8,7 @@ return {
|
||||
function()
|
||||
require("notify").dismiss({ silent = true, pending = true })
|
||||
end,
|
||||
desc = "Delete all Notifications",
|
||||
desc = "Dismiss all Notifications",
|
||||
},
|
||||
},
|
||||
opts = {
|
||||
@ -59,6 +59,10 @@ return {
|
||||
},
|
||||
opts = {
|
||||
options = {
|
||||
-- stylua: ignore
|
||||
close_command = function(n) require("mini.bufremove").delete(n, false) end,
|
||||
-- stylua: ignore
|
||||
right_mouse_command = function(n) require("mini.bufremove").delete(n, false) end,
|
||||
diagnostics = "nvim_lsp",
|
||||
always_show_bufferline = false,
|
||||
diagnostics_indicator = function(_, _, diag)
|
||||
|
@ -196,4 +196,21 @@ function M.lazy_notify()
|
||||
timer:start(500, 0, replay)
|
||||
end
|
||||
|
||||
function M.lsp_get_config(server)
|
||||
local configs = require("lspconfig.configs")
|
||||
return rawget(configs, server)
|
||||
end
|
||||
|
||||
---@param server string
|
||||
---@param cond fun( root_dir, config): boolean
|
||||
function M.lsp_disable(server, cond)
|
||||
local util = require("lspconfig.util")
|
||||
local def = M.lsp_get_config(server)
|
||||
def.document_config.on_new_config = util.add_hook_before(def.document_config.on_new_config, function(config, root_dir)
|
||||
if cond(root_dir, config) then
|
||||
config.enabled = false
|
||||
end
|
||||
end)
|
||||
end
|
||||
|
||||
return M
|
||||
|
Reference in New Issue
Block a user