Compare commits

..

23 Commits

Author SHA1 Message Date
28b7a5add2 chore(main): release 9.9.0 (#1648)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2023-10-11 14:39:44 +02:00
e8c26c70e2 refactor(eslint): use util.get_clients instead of deprecated method 2023-10-10 11:54:33 +02:00
599798a366 fix(treesitter): typo with commands 2023-10-10 11:07:58 +02:00
b1c9fd15bd feat(dap): added run with args leader-ca. Fixes #1629 2023-10-10 11:06:00 +02:00
4719dadfda chore(build): auto-generate vimdoc 2023-10-10 05:51:42 +00:00
88d465c3ef fix(hypr): automatically update/install hypr treesitter parser when needed 2023-10-10 07:51:02 +02:00
23a0004a86 chore(main): release 9.8.0 (#1642)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2023-10-10 00:13:40 +02:00
02bc41412a fix(telescope): remove telescope folding hack since PR with fix has been merged upstream 2023-10-09 23:32:34 +02:00
44984dcbe2 feat(telescope): add telescope-fzf-native by default. Will only be enabled if make is on your system. 2023-10-09 22:28:09 +02:00
0955129796 fix(project): make sure to load telescope extension after telescope ran setup 2023-10-09 22:11:17 +02:00
4e8a88fc1f fix(util): dont schedule on_load 2023-10-09 22:09:39 +02:00
9a4b9aa804 refactor(edgy): make telescope optional 2023-10-09 20:16:02 +02:00
9357ea2881 fix(edgy): typo 2023-10-09 20:12:45 +02:00
fb70170058 feat(edgy): when edgy is enabled, use edgy's main window for Telescope to open results in 2023-10-09 20:12:07 +02:00
c0ce89fe62 feat(telescope): smarter way to determine the window to open a file in 2023-10-09 20:11:45 +02:00
5d44c976a7 fix(autocmds): extra check that we didn't do last_loc more than once for the buffer 2023-10-09 20:11:05 +02:00
6b857f1de6 feat(options): set virtualedit=block by default 2023-10-09 17:49:00 +02:00
9670c8a400 feat(dashboard): show loaded/count plugins on dashboard instead of just count 2023-10-09 12:49:33 +02:00
2abb5907ef style(config): added tracking for colorscheme 2023-10-09 12:49:09 +02:00
2c658a374d style(cmp): dont include cmp-nvim-lsp as a dep of lspconfig 2023-10-09 11:34:58 +02:00
4fe7ccae73 build(format): sort requires 2023-10-09 11:34:23 +02:00
0a05888d99 fix(cmp): set default group_index to 1 to prevent issues with custom sources 2023-10-09 10:05:57 +02:00
d894556c37 feat(cmp): ctrl+CR will abort cmp and enter a new line 2023-10-09 09:51:55 +02:00
18 changed files with 134 additions and 41 deletions

View File

@ -1,5 +1,40 @@
# Changelog
## [9.9.0](https://github.com/LazyVim/LazyVim/compare/v9.8.0...v9.9.0) (2023-10-10)
### Features
* **dap:** added run with args `leader-ca`. Fixes [#1629](https://github.com/LazyVim/LazyVim/issues/1629) ([b1c9fd1](https://github.com/LazyVim/LazyVim/commit/b1c9fd15bdbc0bae5bf1ba1efd88ce7355e7f2c1))
### Bug Fixes
* **hypr:** automatically update/install hypr treesitter parser when needed ([88d465c](https://github.com/LazyVim/LazyVim/commit/88d465c3efac065f912e1de162c9a48bbae15316))
* **treesitter:** typo with commands ([599798a](https://github.com/LazyVim/LazyVim/commit/599798a366d5fead7e8486e1b02dd2362d2e6bd1))
## [9.8.0](https://github.com/LazyVim/LazyVim/compare/v9.7.0...v9.8.0) (2023-10-09)
### Features
* **cmp:** ctrl+CR will abort cmp and enter a new line ([d894556](https://github.com/LazyVim/LazyVim/commit/d894556c375c1c2398f170c21f9323c9c1eba9d4))
* **dashboard:** show loaded/count plugins on dashboard instead of just count ([9670c8a](https://github.com/LazyVim/LazyVim/commit/9670c8a400100d38e15c9662f488232508bfb1bb))
* **edgy:** when edgy is enabled, use edgy's main window for Telescope to open results in ([fb70170](https://github.com/LazyVim/LazyVim/commit/fb7017005809d6be06a1ece748ef2406c37a34d9))
* **options:** set `virtualedit=block` by default ([6b857f1](https://github.com/LazyVim/LazyVim/commit/6b857f1de648292f2410f9beaa95318bd30454d5))
* **telescope:** add telescope-fzf-native by default. Will only be enabled if `make` is on your system. ([44984dc](https://github.com/LazyVim/LazyVim/commit/44984dcbe25c13e0e1bc582d5a51ccc2a4be8f70))
* **telescope:** smarter way to determine the window to open a file in ([c0ce89f](https://github.com/LazyVim/LazyVim/commit/c0ce89fe62bffc0fe35bf76d3e5f501c8b5276c2))
### Bug Fixes
* **autocmds:** extra check that we didn't do last_loc more than once for the buffer ([5d44c97](https://github.com/LazyVim/LazyVim/commit/5d44c976a746e29cfe52ceab93dd3de5db2eafa8))
* **cmp:** set default group_index to 1 to prevent issues with custom sources ([0a05888](https://github.com/LazyVim/LazyVim/commit/0a05888d992b37749f9aae25c7f63f2534ec1024))
* **edgy:** typo ([9357ea2](https://github.com/LazyVim/LazyVim/commit/9357ea2881fdd57b028256597c01e15601c29aaf))
* **project:** make sure to load telescope extension after telescope ran setup ([0955129](https://github.com/LazyVim/LazyVim/commit/0955129796749651e1413006e36e9a1c6d3027f3))
* **telescope:** remove telescope folding hack since PR with fix has been merged upstream ([02bc414](https://github.com/LazyVim/LazyVim/commit/02bc41412a14c1c0bb823421ef82ff5596f42571))
* **util:** dont schedule on_load ([4e8a88f](https://github.com/LazyVim/LazyVim/commit/4e8a88fc1f28d0420aa3badb703296f344d89968))
## [9.7.0](https://github.com/LazyVim/LazyVim/compare/v9.6.0...v9.7.0) (2023-10-09)

View File

@ -1,4 +1,4 @@
*LazyVim.txt* For Neovim >= 0.8.0 Last change: 2023 October 09
*LazyVim.txt* For Neovim >= 0.8.0 Last change: 2023 October 10
==============================================================================
Table of Contents *LazyVim-table-of-contents*

View File

@ -34,9 +34,10 @@ vim.api.nvim_create_autocmd("BufReadPost", {
callback = function(event)
local exclude = { "gitcommit" }
local buf = event.buf
if vim.tbl_contains(exclude, vim.bo[buf].filetype) then
if vim.tbl_contains(exclude, vim.bo[buf].filetype) or vim.b[buf].lazyvim_last_loc then
return
end
vim.b[buf].lazyvim_last_loc = true
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
@ -91,16 +92,3 @@ vim.api.nvim_create_autocmd({ "BufWritePre" }, {
vim.fn.mkdir(vim.fn.fnamemodify(file, ":p:h"), "p")
end,
})
-- HACK: re-caclulate folds when entering a buffer through Telescope
-- @see https://github.com/nvim-telescope/telescope.nvim/issues/699
vim.api.nvim_create_autocmd("BufEnter", {
group = augroup("fix_folds"),
callback = function()
if vim.opt.foldmethod:get() == "expr" then
vim.schedule(function()
vim.opt.foldmethod = "expr"
end)
end
end,
})

View File

@ -1,3 +1,5 @@
local Util = require("lazy.core.util")
---@class LazyVimConfig: LazyVimOptions
local M = {}
@ -160,7 +162,8 @@ function M.setup(opts)
M.lazy_file()
end
require("lazy.core.util").try(function()
Util.track("colorscheme")
Util.try(function()
if type(M.colorscheme) == "function" then
M.colorscheme()
else
@ -169,10 +172,11 @@ function M.setup(opts)
end, {
msg = "Could not load your colorscheme",
on_error = function(msg)
require("lazy.core.util").error(msg)
Util.error(msg)
vim.cmd.colorscheme("habamax")
end,
})
Util.track()
end
-- Properly load file based plugins without blocking the UI
@ -184,7 +188,6 @@ function M.lazy_file()
return
end
local Event = require("lazy.core.handler.event")
local Util = require("lazy.core.util")
vim.api.nvim_del_augroup_by_name("lazy_file")
Util.track({ event = "LazyVim.lazy_file" })
@ -236,7 +239,6 @@ end
---@param name "autocmds" | "options" | "keymaps"
function M.load(name)
local Util = require("lazy.core.util")
local function _load(mod)
Util.try(function()
require(mod)
@ -290,7 +292,7 @@ function M.init()
Plugin.Spec.add = function(self, plugin, ...)
if type(plugin) == "table" then
if M.renames[plugin[1]] then
require("lazy.core.util").warn(
Util.warn(
("Plugin `%s` was renamed to `%s`.\nPlease update your config for `%s`"):format(
plugin[1],
M.renames[plugin[1]],

View File

@ -43,6 +43,7 @@ opt.timeoutlen = 300
opt.undofile = true
opt.undolevels = 10000
opt.updatetime = 200 -- Save swap file and trigger CursorHold
opt.virtualedit = "block" -- Allow cursor to move where there is no text in visual block mode
opt.wildmode = "longest:full,full" -- Command-line completion mode
opt.winminwidth = 5 -- Minimum window width
opt.wrap = false -- Disable line wrap

View File

@ -66,13 +66,18 @@ return {
behavior = cmp.ConfirmBehavior.Replace,
select = true,
}), -- Accept currently selected item. Set `select` to `false` to only confirm explicitly selected items.
["<C-CR>"] = function(fallback)
cmp.abort()
fallback()
end,
}),
sources = cmp.config.sources({
{ name = "nvim_lsp" },
{ name = "luasnip" },
{ name = "path" },
}, {
{ name = "buffer" },
}),
sources = {
{ name = "nvim_lsp", group_index = 1 },
{ name = "luasnip", group_index = 1 },
{ name = "buffer", group_index = 2 },
{ name = "path", group_index = 2 },
},
formatting = {
format = function(_, item)
local icons = require("lazyvim.config").icons.kinds
@ -90,6 +95,13 @@ return {
sorting = defaults.sorting,
}
end,
---@param opts cmp.ConfigSchema
config = function(_, opts)
for _, source in ipairs(opts.sources) do
source.group_index = source.group_index or 1
end
require("cmp").setup(opts)
end,
},
-- auto pairs

View File

@ -100,6 +100,18 @@ return {
"nvim-telescope/telescope.nvim",
cmd = "Telescope",
version = false, -- telescope did only one release, so use HEAD for now
dependencies = {
{
"nvim-telescope/telescope-fzf-native.nvim",
build = "make",
enabled = vim.fn.executable("make") == 1,
config = function()
Util.on_load("telescope.nvim", function()
require("telescope").load_extension("fzf")
end)
end,
},
},
keys = {
{ "<leader>,", "<cmd>Telescope buffers show_all_buffers=true<cr>", desc = "Switch Buffer" },
{ "<leader>/", Util.telescope("live_grep"), desc = "Grep (root dir)" },
@ -201,6 +213,19 @@ return {
defaults = {
prompt_prefix = "",
selection_caret = "",
-- open files in the first window that is an actual file.
-- use the current window if no other window is available.
get_selection_window = function()
local wins = vim.api.nvim_list_wins()
table.insert(wins, 1, vim.api.nvim_get_current_win())
for _, win in ipairs(wins) do
local buf = vim.api.nvim_win_get_buf(win)
if vim.bo[buf].buftype == "" then
return win
end
end
return 0
end,
mappings = {
i = {
["<c-t>"] = open_with_trouble,

View File

@ -1,3 +1,14 @@
---@param config {args?:string[]|fun():string[]?}
local function get_args(config)
local args = type(config.args) == "function" and (config.args() or {}) or config.args or {}
---@cast args string[]
config.args = function()
local new_args = vim.fn.input("Run with args: ", table.concat(args, " ")) --[[@as string]]
return vim.split(vim.fn.expand(new_args) --[[@as string]], " ")
end
return config
end
return {
"mfussenegger/nvim-dap",
@ -76,6 +87,7 @@ return {
{ "<leader>dB", function() require("dap").set_breakpoint(vim.fn.input('Breakpoint condition: ')) end, desc = "Breakpoint Condition" },
{ "<leader>db", function() require("dap").toggle_breakpoint() end, desc = "Toggle Breakpoint" },
{ "<leader>dc", function() require("dap").continue() end, desc = "Continue" },
{ "<leader>da", function() require("dap").continue({ before = get_args }) end, desc = "Run with Args" },
{ "<leader>dC", function() require("dap").run_to_cursor() end, desc = "Run to Cursor" },
{ "<leader>dg", function() require("dap").goto_() end, desc = "Go to line (no execute)" },
{ "<leader>di", function() require("dap").step_into() end, desc = "Step Into" },

View File

@ -21,7 +21,7 @@ return {
return
end
local client = vim.lsp.get_active_clients({ bufnr = event.buf, name = "eslint" })[1]
local client = require("lazyvim.util").get_clients({ bufnr = event.buf, name = "eslint" })[1]
if client then
local diag = vim.diagnostic.get(event.buf, { namespace = vim.lsp.diagnostic.get_namespace(client.id) })
if #diag > 0 then

View File

@ -38,7 +38,7 @@ return {
footer = function()
local stats = require("lazy").stats()
local ms = (math.floor(stats.startuptime * 100 + 0.5) / 100)
return { "⚡ Neovim loaded " .. stats.count .. " plugins in " .. ms .. "ms" }
return { "⚡ Neovim loaded " .. stats.loaded .. "/" .. stats.count .. " plugins in " .. ms .. "ms" }
end,
},
}

View File

@ -118,6 +118,20 @@ return {
end,
},
-- use edgy's selection window
{
"nvim-telescope/telescope.nvim",
optional = true,
opts = {
defaults = {
get_selection_window = function()
require("edgy").goto_main()
return 0
end,
},
},
},
-- prevent neo-tree from opening files in edgy windows
{
"nvim-neo-tree/neo-tree.nvim",

View File

@ -13,6 +13,7 @@ return {
"luckasRanarison/tree-sitter-hypr",
enabled = have("hypr"),
event = "BufRead */hypr/*.conf",
build = ":TSUpdate hypr",
config = function()
-- Fix ft detection for hyprland
vim.filetype.add({

View File

@ -9,7 +9,9 @@ return {
event = "VeryLazy",
config = function(_, opts)
require("project_nvim").setup(opts)
require("telescope").load_extension("projects")
require("lazyvim.util").on_load("telescope.nvim", function()
require("telescope").load_extension("projects")
end)
end,
keys = {
{ "<leader>fp", "<Cmd>Telescope projects<CR>", desc = "Projects" },

View File

@ -8,12 +8,6 @@ return {
{ "folke/neodev.nvim", opts = {} },
"mason.nvim",
"williamboman/mason-lspconfig.nvim",
{
"hrsh7th/cmp-nvim-lsp",
cond = function()
return require("lazyvim.util").has("nvim-cmp")
end,
},
},
---@class PluginLspOpts
opts = {

View File

@ -34,7 +34,7 @@ return {
end,
},
},
cmd = { "TSUpdateSync" },
cmd = { "TSUpdateSync", "TSUpdate", "TSInstall" },
keys = {
{ "<c-space>", desc = "Increment selection" },
{ "<bs>", desc = "Decrement selection", mode = "x" },

View File

@ -353,7 +353,13 @@ return {
callback = function()
local stats = require("lazy").stats()
local ms = (math.floor(stats.startuptime * 100 + 0.5) / 100)
dashboard.section.footer.val = "⚡ Neovim loaded " .. stats.count .. " plugins in " .. ms .. "ms"
dashboard.section.footer.val = "⚡ Neovim loaded "
.. stats.loaded
.. "/"
.. stats.count
.. " plugins in "
.. ms
.. "ms"
pcall(vim.cmd.AlphaRedraw)
end,
})

View File

@ -283,9 +283,7 @@ end
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)
fn(name)
else
vim.api.nvim_create_autocmd("User", {
pattern = "LazyLoad",

View File

@ -1,3 +1,6 @@
indent_type = "Spaces"
indent_width = 2
column_width = 120
column_width = 120
[sort_requires]
enabled = true