Compare commits
25 Commits
Author | SHA1 | Date | |
---|---|---|---|
8f9f76a96f | |||
9e8ce289d1 | |||
5204aacf8d | |||
a0c2014b10 | |||
c882544224 | |||
e212c166b4 | |||
9fd89701da | |||
b1721bc20a | |||
3f68f44d72 | |||
a38bf3001d | |||
67d1cbfb01 | |||
abea2807ce | |||
44cdb5eac5 | |||
0db31c2840 | |||
22c9477b96 | |||
baa9614022 | |||
b660b51718 | |||
99f30f9a37 | |||
ae054ec13c | |||
bcff5a1937 | |||
299aae3545 | |||
0b020dc37b | |||
755419f39c | |||
ddb819cb9a | |||
9c120b5ef7 |
56
CHANGELOG.md
56
CHANGELOG.md
@ -1,5 +1,61 @@
|
||||
# Changelog
|
||||
|
||||
## [4.28.1](https://github.com/LazyVim/LazyVim/compare/v4.28.0...v4.28.1) (2023-07-12)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* **neoconf:** do neoconf setup in lspconfig setup. Fixes [#1070](https://github.com/LazyVim/LazyVim/issues/1070) ([9e8ce28](https://github.com/LazyVim/LazyVim/commit/9e8ce289d12eb65146be3cb1b3800440e208496d))
|
||||
|
||||
## [4.28.0](https://github.com/LazyVim/LazyVim/compare/v4.27.0...v4.28.0) (2023-07-12)
|
||||
|
||||
|
||||
### Features
|
||||
|
||||
* **catppuccin:** match navic bg with lualine ([#1085](https://github.com/LazyVim/LazyVim/issues/1085)) ([67d1cbf](https://github.com/LazyVim/LazyVim/commit/67d1cbfb01e84083649027a4b6356401f74d2d60))
|
||||
* **lang:** add docker support ([#1078](https://github.com/LazyVim/LazyVim/issues/1078)) ([a0c2014](https://github.com/LazyVim/LazyVim/commit/a0c2014b1045243d216b244235c6a545e92471a9))
|
||||
* **mini.ai:** decouple mini.ai from which-key. Closes [#1076](https://github.com/LazyVim/LazyVim/issues/1076) ([e212c16](https://github.com/LazyVim/LazyVim/commit/e212c166b4ce91bbd65a9f7fda17403ee91ed19c))
|
||||
* **util:** added util.on_load to execute code when a plugin loads ([9fd8970](https://github.com/LazyVim/LazyVim/commit/9fd89701da8bd3a5d9ffeae84fb2174a3f650797))
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* **lsp-config:** lsp-config error when nvim-cmp not enabled. ([#1095](https://github.com/LazyVim/LazyVim/issues/1095)) ([3f68f44](https://github.com/LazyVim/LazyVim/commit/3f68f44d725747339933298cdac02589b37ea76c))
|
||||
|
||||
## [4.27.0](https://github.com/LazyVim/LazyVim/compare/v4.26.0...v4.27.0) (2023-07-06)
|
||||
|
||||
|
||||
### Features
|
||||
|
||||
* **extras:** add terraform extra ([#1030](https://github.com/LazyVim/LazyVim/issues/1030)) ([0db31c2](https://github.com/LazyVim/LazyVim/commit/0db31c2840af662c856d5b9a09d87bc266e7fa40))
|
||||
* **flash:** use c-s in the cmdline to toggle flash ([22c9477](https://github.com/LazyVim/LazyVim/commit/22c9477b9642b1a8abc303ffcb44c6989c7a5ca2))
|
||||
* **lang:** add python support ([#1031](https://github.com/LazyVim/LazyVim/issues/1031)) ([44cdb5e](https://github.com/LazyVim/LazyVim/commit/44cdb5eac556733db53afeebcdc6ef91408de0c3))
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* **autocmds:** jump to last loc in buffer ([#1061](https://github.com/LazyVim/LazyVim/issues/1061)) ([baa9614](https://github.com/LazyVim/LazyVim/commit/baa96140227a3727b2ea2053f37aa2b7253bb45a))
|
||||
|
||||
## [4.26.0](https://github.com/LazyVim/LazyVim/compare/v4.25.1...v4.26.0) (2023-07-06)
|
||||
|
||||
|
||||
### Features
|
||||
|
||||
* **vscode:** easier way to enable/disable plugins ([ae054ec](https://github.com/LazyVim/LazyVim/commit/ae054ec13c987ff5ce39cfc88917f8243abae72e))
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* **flash:** depraction warning ([299aae3](https://github.com/LazyVim/LazyVim/commit/299aae3545aa7b7a67a6907e089d80cd63938bf6))
|
||||
* **util:** use spec to check if a plugin is enabled ([bcff5a1](https://github.com/LazyVim/LazyVim/commit/bcff5a19379e32a85049500de420aa24b271fb72))
|
||||
|
||||
## [4.25.1](https://github.com/LazyVim/LazyVim/compare/v4.25.0...v4.25.1) (2023-07-04)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* trigger ci ([755419f](https://github.com/LazyVim/LazyVim/commit/755419f39cf0ca0407a3a6a16dad35942c653572))
|
||||
|
||||
## [4.25.0](https://github.com/LazyVim/LazyVim/compare/v4.24.1...v4.25.0) (2023-07-03)
|
||||
|
||||
|
||||
|
@ -57,6 +57,7 @@ LazyVim 提供了两全其美的方式 - 根据需要调整配置的灵活性,
|
||||
- Neovim >= **0.8.0** (需要用 **LuaJIT** 构建)
|
||||
- Git >= **2.19.0** (用于部分克隆支持)
|
||||
- 一个 [Nerd Font](https://www.nerdfonts.com/) 字体 **_(可选)_**
|
||||
- 一个用于 `nvim-treesitter` 的 **C** 编译器。看 [这里](https://github.com/nvim-treesitter/nvim-treesitter#requirements)
|
||||
|
||||
## 🚀 入门
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
*LazyVim.txt* For Neovim >= 0.8.0 Last change: 2023 July 03
|
||||
*LazyVim.txt* For Neovim >= 0.8.0 Last change: 2023 July 12
|
||||
|
||||
==============================================================================
|
||||
Table of Contents *LazyVim-table-of-contents*
|
||||
|
@ -1,4 +1,4 @@
|
||||
-- This file is automatically loaded by lazyvim.config.init
|
||||
-- This file is automatically loaded by lazyvim.config.init.
|
||||
|
||||
local function augroup(name)
|
||||
return vim.api.nvim_create_augroup("lazyvim_" .. name, { clear = true })
|
||||
@ -38,7 +38,7 @@ vim.api.nvim_create_autocmd("BufReadPost", {
|
||||
local mark = vim.api.nvim_buf_get_mark(buf, '"')
|
||||
local lcount = vim.api.nvim_buf_line_count(buf)
|
||||
if mark[1] > 0 and mark[1] <= lcount then
|
||||
pcall(vim.api.nvim_win_set_cursor, buf, mark)
|
||||
pcall(vim.api.nvim_win_set_cursor, 0, mark)
|
||||
end
|
||||
end,
|
||||
})
|
||||
|
@ -173,7 +173,7 @@ return {
|
||||
config = function(_, opts)
|
||||
require("mini.ai").setup(opts)
|
||||
-- register all text objects with which-key
|
||||
if require("lazyvim.util").has("which-key.nvim") then
|
||||
require("lazyvim.util").on_load("which-key.nvim", function()
|
||||
---@type table<string, string|table>
|
||||
local i = {
|
||||
[" "] = "Whitespace",
|
||||
@ -214,7 +214,7 @@ return {
|
||||
i = i,
|
||||
a = a,
|
||||
})
|
||||
end
|
||||
end)
|
||||
end,
|
||||
},
|
||||
}
|
||||
|
@ -31,7 +31,7 @@ return {
|
||||
information = { "undercurl" },
|
||||
},
|
||||
},
|
||||
navic = { enabled = true },
|
||||
navic = { enabled = true, custom_bg = "lualine" },
|
||||
neotest = true,
|
||||
noice = true,
|
||||
notify = true,
|
||||
|
@ -216,9 +216,6 @@ return {
|
||||
-- easily jump to any location and enhanced f/t motions for Leap
|
||||
{
|
||||
"ggandor/flit.nvim",
|
||||
enabled = function()
|
||||
return require("lazyvim.util").has("leap")
|
||||
end,
|
||||
keys = function()
|
||||
---@type LazyKeys[]
|
||||
local ret = {}
|
||||
|
@ -40,6 +40,14 @@ return {
|
||||
end,
|
||||
desc = "Treesitter Search",
|
||||
},
|
||||
{
|
||||
"<c-s>",
|
||||
mode = { "c" },
|
||||
function()
|
||||
require("flash").toggle()
|
||||
end,
|
||||
desc = "Toggle Flash Search",
|
||||
},
|
||||
},
|
||||
},
|
||||
{
|
||||
@ -49,7 +57,7 @@ return {
|
||||
local function flash(prompt_bufnr)
|
||||
require("flash").jump({
|
||||
pattern = "^",
|
||||
highlight = { label = { after = { 0, 0 } } },
|
||||
label = { after = { 0, 0 } },
|
||||
search = {
|
||||
mode = "search",
|
||||
exclude = {
|
||||
|
36
lua/lazyvim/plugins/extras/lang/docker.lua
Normal file
36
lua/lazyvim/plugins/extras/lang/docker.lua
Normal file
@ -0,0 +1,36 @@
|
||||
return {
|
||||
{
|
||||
"nvim-treesitter/nvim-treesitter",
|
||||
opts = function(_, opts)
|
||||
if type(opts.ensure_installed) == "table" then
|
||||
vim.list_extend(opts.ensure_installed, { "dockerfile" })
|
||||
end
|
||||
end,
|
||||
},
|
||||
{
|
||||
"jose-elias-alvarez/null-ls.nvim",
|
||||
opts = function(_, opts)
|
||||
local nls = require("null-ls")
|
||||
opts.sources = opts.sources or {}
|
||||
vim.list_extend(opts.sources, {
|
||||
nls.builtins.diagnostics.hadolint,
|
||||
})
|
||||
end,
|
||||
dependencies = {
|
||||
"mason.nvim",
|
||||
opts = function(_, opts)
|
||||
opts.ensure_installed = opts.ensure_installed or {}
|
||||
vim.list_extend(opts.ensure_installed, { "hadolint" })
|
||||
end,
|
||||
},
|
||||
},
|
||||
{
|
||||
"neovim/nvim-lspconfig",
|
||||
opts = {
|
||||
servers = {
|
||||
dockerls = {},
|
||||
docker_compose_language_service = {},
|
||||
},
|
||||
},
|
||||
},
|
||||
}
|
67
lua/lazyvim/plugins/extras/lang/python.lua
Normal file
67
lua/lazyvim/plugins/extras/lang/python.lua
Normal file
@ -0,0 +1,67 @@
|
||||
return {
|
||||
{
|
||||
"nvim-treesitter/nvim-treesitter",
|
||||
opts = function(_, opts)
|
||||
if type(opts.ensure_installed) == "table" then
|
||||
vim.list_extend(opts.ensure_installed, { "ninja", "python", "rst", "toml" })
|
||||
end
|
||||
end,
|
||||
},
|
||||
{
|
||||
"neovim/nvim-lspconfig",
|
||||
opts = {
|
||||
servers = {
|
||||
pyright = {},
|
||||
ruff_lsp = {},
|
||||
},
|
||||
},
|
||||
setup = {
|
||||
ruff_lsp = function()
|
||||
require("lazyvim.util").on_attach(function(client, _)
|
||||
if client.name == "ruff_lsp" then
|
||||
-- Disable hover in favor of Pyright
|
||||
client.server_capabilities.hoverProvider = false
|
||||
end
|
||||
end)
|
||||
end,
|
||||
},
|
||||
},
|
||||
{
|
||||
"nvim-neotest/neotest",
|
||||
optional = true,
|
||||
dependencies = {
|
||||
"nvim-neotest/neotest-python",
|
||||
},
|
||||
opts = {
|
||||
adapters = {
|
||||
["neotest-python"] = {
|
||||
-- Here you can specify the settings for the adapter, i.e.
|
||||
-- runner = "pytest",
|
||||
-- python = ".venv/bin/python",
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
{
|
||||
"mfussenegger/nvim-dap",
|
||||
optional = true,
|
||||
dependencies = {
|
||||
"mfussenegger/nvim-dap-python",
|
||||
-- stylua: ignore
|
||||
keys = {
|
||||
{ "<leader>dPt", function() require('dap-python').test_method() end, desc = "Debug Method" },
|
||||
{ "<leader>dPc", function() require('dap-python').test_class() end, desc = "Debug Class" },
|
||||
},
|
||||
config = function()
|
||||
local path = require("mason-registry").get_package("debugpy"):get_install_path()
|
||||
require("dap-python").setup(path .. "/venv/bin/python")
|
||||
end,
|
||||
},
|
||||
},
|
||||
{
|
||||
"linux-cultist/venv-selector.nvim",
|
||||
cmd = "VenvSelect",
|
||||
opts = {},
|
||||
keys = { { "<leader>cv", "<cmd>:VenvSelect<cr>", desc = "Select VirtualEnv" } },
|
||||
},
|
||||
}
|
33
lua/lazyvim/plugins/extras/lang/terraform.lua
Normal file
33
lua/lazyvim/plugins/extras/lang/terraform.lua
Normal file
@ -0,0 +1,33 @@
|
||||
return {
|
||||
{
|
||||
"nvim-treesitter/nvim-treesitter",
|
||||
opts = function(_, opts)
|
||||
if type(opts.ensure_installed) == "table" then
|
||||
vim.list_extend(opts.ensure_installed, {
|
||||
"terraform",
|
||||
"hcl",
|
||||
})
|
||||
end
|
||||
end,
|
||||
},
|
||||
{
|
||||
"neovim/nvim-lspconfig",
|
||||
opts = {
|
||||
servers = {
|
||||
terraformls = {},
|
||||
},
|
||||
},
|
||||
},
|
||||
{
|
||||
"jose-elias-alvarez/null-ls.nvim",
|
||||
opts = function(_, opts)
|
||||
if type(opts.sources) == "table" then
|
||||
local null_ls = require("null-ls")
|
||||
vim.list_extend(opts.sources, {
|
||||
null_ls.builtins.formatting.terraform_fmt,
|
||||
null_ls.builtins.diagnostics.terraform_validate,
|
||||
})
|
||||
end
|
||||
end,
|
||||
},
|
||||
}
|
@ -21,23 +21,8 @@ local Config = require("lazy.core.config")
|
||||
local Plugin = require("lazy.core.plugin")
|
||||
Config.options.checker.enabled = false
|
||||
Config.options.change_detection.enabled = false
|
||||
|
||||
-- HACK: disable all plugins except the ones we want
|
||||
local fix_disabled = Plugin.Spec.fix_disabled
|
||||
function Plugin.Spec.fix_disabled(self)
|
||||
for _, plugin in pairs(self.plugins) do
|
||||
if not (vim.tbl_contains(enabled, plugin.name) or plugin.vscode) then
|
||||
plugin.enabled = false
|
||||
end
|
||||
end
|
||||
fix_disabled(self)
|
||||
end
|
||||
|
||||
-- HACK: don't clean plugins in vscode
|
||||
local update_state = Plugin.update_state
|
||||
function Plugin.update_state()
|
||||
update_state()
|
||||
Config.to_clean = {}
|
||||
Config.options.defaults.cond = function(plugin)
|
||||
return vim.tbl_contains(enabled, plugin.name) or plugin.vscode
|
||||
end
|
||||
|
||||
-- Add some vscode specific keymaps
|
||||
|
@ -4,7 +4,7 @@ return {
|
||||
"neovim/nvim-lspconfig",
|
||||
event = { "BufReadPre", "BufNewFile" },
|
||||
dependencies = {
|
||||
{ "folke/neoconf.nvim", cmd = "Neoconf", config = true },
|
||||
{ "folke/neoconf.nvim", cmd = "Neoconf", config = false, dependencies = { "nvim-lspconfig" } },
|
||||
{ "folke/neodev.nvim", opts = {} },
|
||||
"mason.nvim",
|
||||
"williamboman/mason-lspconfig.nvim",
|
||||
@ -89,6 +89,11 @@ return {
|
||||
---@param opts PluginLspOpts
|
||||
config = function(_, opts)
|
||||
local Util = require("lazyvim.util")
|
||||
|
||||
if Util.has("neoconf.nvim") then
|
||||
local plugin = require("lazy.core.config").spec.plugins["neoconf.nvim"]
|
||||
require("neoconf").setup(require("lazy.core.plugin").values(plugin, "opts", false))
|
||||
end
|
||||
-- setup autoformat
|
||||
require("lazyvim.plugins.lsp.format").setup(opts)
|
||||
-- setup formatting and keymaps
|
||||
@ -139,11 +144,12 @@ return {
|
||||
vim.diagnostic.config(vim.deepcopy(opts.diagnostics))
|
||||
|
||||
local servers = opts.servers
|
||||
local has_cmp, cmp_nvim_lsp = pcall(require, "cmp_nvim_lsp")
|
||||
local capabilities = vim.tbl_deep_extend(
|
||||
"force",
|
||||
{},
|
||||
vim.lsp.protocol.make_client_capabilities(),
|
||||
require("cmp_nvim_lsp").default_capabilities(),
|
||||
has_cmp and cmp_nvim_lsp.default_capabilities() or {},
|
||||
opts.capabilities or {}
|
||||
)
|
||||
|
||||
|
@ -17,7 +17,7 @@ end
|
||||
|
||||
---@param plugin string
|
||||
function M.has(plugin)
|
||||
return require("lazy.core.config").plugins[plugin] ~= nil
|
||||
return require("lazy.core.config").spec.plugins[plugin] ~= nil
|
||||
end
|
||||
|
||||
function M.fg(name)
|
||||
@ -256,4 +256,25 @@ function M.lsp_disable(server, cond)
|
||||
end)
|
||||
end
|
||||
|
||||
---@param name string
|
||||
---@param fn fun(name:string)
|
||||
function M.on_load(name, fn)
|
||||
local Config = require("lazy.core.config")
|
||||
if Config.plugins[name] and Config.plugins[name]._.loaded then
|
||||
vim.schedule(function()
|
||||
fn(name)
|
||||
end)
|
||||
else
|
||||
vim.api.nvim_create_autocmd("User", {
|
||||
pattern = "LazyLoad",
|
||||
callback = function(event)
|
||||
if event.data == name then
|
||||
fn(name)
|
||||
return true
|
||||
end
|
||||
end,
|
||||
})
|
||||
end
|
||||
end
|
||||
|
||||
return M
|
||||
|
Reference in New Issue
Block a user