Compare commits

..

28 Commits

Author SHA1 Message Date
8b0e6ab19e chore(main): release 1.9.4 (#271)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2023-02-16 13:29:41 +01:00
27248b0193 chore(build): auto-generate vimdoc 2023-02-15 13:04:31 +00:00
d198a19325 fix(health): also check for fdfind instead of just fd. Fixes #270 2023-02-15 14:03:46 +01:00
b64d980bbf chore(main): release 1.9.3 (#267)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2023-02-14 22:04:39 +01:00
5d6f0d58d5 fix(notify): install notify when noice is not enabled 2023-02-14 21:56:09 +01:00
cc3070d30e faet(util): added Util.on_very_lazy 2023-02-14 21:55:52 +01:00
e91903e810 chore(build): auto-generate vimdoc 2023-02-14 13:41:28 +00:00
38eb3bf115 fix(which-key): only add noice group when noice is enabled 2023-02-14 14:40:34 +01:00
2e18998c9e chore(main): release 1.9.2 (#251)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2023-02-12 16:52:20 +01:00
a3aeb27cbc fix(format): nil check 2023-02-12 12:31:43 +01:00
fab6150da9 fix(format): dont format if client capaibilities disabled it. #249 2023-02-12 11:43:31 +01:00
e8766c5edd chore(main): release 1.9.1 (#241)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2023-02-12 11:19:07 +01:00
5cb44bae6d chore(build): auto-generate vimdoc 2023-02-12 10:00:54 +00:00
543126818e fix(lsp): temp mason fix for sumenko_lua -> lua_ls rename. See #248 2023-02-12 10:59:58 +01:00
57e92b04e2 style: fix comment typo (#243) 2023-02-11 17:10:39 +01:00
31ad893788 fix(cmp): added <c-n> and <c-p> to make it more consistent 2023-02-11 13:29:27 +01:00
151bf12a9f fix(telescope): make key bindings more consistent for telescope 2023-02-11 13:28:11 +01:00
d9e95f8dcd chore(main): release 1.9.0 (#239)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2023-02-11 09:04:05 +01:00
490598b81a chore(build): auto-generate vimdoc 2023-02-11 08:00:32 +00:00
6669e63368 feat(config): allow to disable loading of the default keymaps/autocmds/options. Fixes #238 2023-02-11 08:59:42 +01:00
d9b1c79c3e chore(main): release 1.8.0 (#230)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2023-02-10 17:09:04 +01:00
f5d232b79c refactor(mini.ai): improved descriptions for mini.ai 2023-02-10 17:06:01 +01:00
fd0a0e829d feat(telescope): improved Telescope mappings in normal and insert mode (#231)
Co-authored-by: sourproton <sourproton98@gmail.com>
2023-02-10 16:49:03 +01:00
b96ea665b3 feat(mini.ai): added all mini.ai text-objects to which-key 2023-02-10 16:17:18 +01:00
b20f016b04 chore(build): auto-generate vimdoc 2023-02-10 09:05:28 +00:00
24cb9a90e5 chore(main): release 1.7.2 (#225)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2023-02-10 10:04:40 +01:00
42d2411bfa fix(leap): don't use the x and X mappings in visual mode 2023-02-09 22:49:07 +01:00
ddd1fceb76 ci: autogen recipes 2023-02-09 22:48:42 +01:00
11 changed files with 194 additions and 16 deletions

View File

@ -1,5 +1,59 @@
# Changelog
## [1.9.4](https://github.com/LazyVim/LazyVim/compare/v1.9.3...v1.9.4) (2023-02-15)
### Bug Fixes
* **health:** also check for fdfind instead of just fd. Fixes [#270](https://github.com/LazyVim/LazyVim/issues/270) ([d198a19](https://github.com/LazyVim/LazyVim/commit/d198a193256429e401fbec7fa8ac7a46de06f07b))
## [1.9.3](https://github.com/LazyVim/LazyVim/compare/v1.9.2...v1.9.3) (2023-02-14)
### Bug Fixes
* **notify:** install notify when noice is not enabled ([5d6f0d5](https://github.com/LazyVim/LazyVim/commit/5d6f0d58d5daf2f87ea9f0a49170103925d1b528))
* **which-key:** only add noice group when noice is enabled ([38eb3bf](https://github.com/LazyVim/LazyVim/commit/38eb3bf115f1b550e853a04545932fad3fbffe5b))
## [1.9.2](https://github.com/LazyVim/LazyVim/compare/v1.9.1...v1.9.2) (2023-02-12)
### Bug Fixes
* **format:** dont format if client capaibilities disabled it. [#249](https://github.com/LazyVim/LazyVim/issues/249) ([fab6150](https://github.com/LazyVim/LazyVim/commit/fab6150da919a094614752f95f5fe4e7f55832f8))
* **format:** nil check ([a3aeb27](https://github.com/LazyVim/LazyVim/commit/a3aeb27cbc2fa1f19d525b97ebb4cc1a56c7c538))
## [1.9.1](https://github.com/LazyVim/LazyVim/compare/v1.9.0...v1.9.1) (2023-02-12)
### Bug Fixes
* **cmp:** added `&lt;c-n&gt;` and `<c-p>` to make it more consistent ([31ad893](https://github.com/LazyVim/LazyVim/commit/31ad893788e0d207a75feaccd61632cdd95b49a0))
* **lsp:** temp mason fix for sumenko_lua -&gt; lua_ls rename. See [#248](https://github.com/LazyVim/LazyVim/issues/248) ([5431268](https://github.com/LazyVim/LazyVim/commit/543126818e678509ee9e17836f0e7906146a1002))
* **telescope:** make key bindings more consistent for telescope ([151bf12](https://github.com/LazyVim/LazyVim/commit/151bf12a9f9591bd324a359374e6c4a5fb65bbbc))
## [1.9.0](https://github.com/LazyVim/LazyVim/compare/v1.8.0...v1.9.0) (2023-02-11)
### Features
* **config:** allow to disable loading of the default keymaps/autocmds/options. Fixes [#238](https://github.com/LazyVim/LazyVim/issues/238) ([6669e63](https://github.com/LazyVim/LazyVim/commit/6669e63368b88430ff574b8f392e8afb6cb434cb))
## [1.8.0](https://github.com/LazyVim/LazyVim/compare/v1.7.2...v1.8.0) (2023-02-10)
### Features
* **mini.ai:** added all mini.ai text-objects to which-key ([b96ea66](https://github.com/LazyVim/LazyVim/commit/b96ea665b3056a6a4877de8e8ae6834923a2f415))
* **telescope:** improved Telescope mappings in normal and insert mode ([#231](https://github.com/LazyVim/LazyVim/issues/231)) ([fd0a0e8](https://github.com/LazyVim/LazyVim/commit/fd0a0e829d7ea6aa8179b1d1efdf7083a4936c44))
## [1.7.2](https://github.com/LazyVim/LazyVim/compare/v1.7.1...v1.7.2) (2023-02-09)
### Bug Fixes
* **leap:** don't use the x and X mappings in visual mode ([42d2411](https://github.com/LazyVim/LazyVim/commit/42d2411bfa1d6fcc5edc20ee6dbc0dff0f0fba6e))
## [1.7.1](https://github.com/LazyVim/LazyVim/compare/v1.7.0...v1.7.1) (2023-02-09)

View File

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

View File

@ -10,6 +10,12 @@ local defaults = {
colorscheme = function()
require("tokyonight").load()
end,
-- load the default settings
defaults = {
autocmds = true, -- lazyvim.config.autocmds
keymaps = true, -- lazyvim.config.keymaps
options = true, -- lazyvim.config.options
},
-- icons used by other plugins
icons = {
diagnostics = {
@ -120,8 +126,7 @@ end
---@param name "autocmds" | "options" | "keymaps"
function M.load(name)
local Util = require("lazy.core.util")
-- always load lazyvim, then user file
for _, mod in ipairs({ "lazyvim.config." .. name, "config." .. name }) do
local function _load(mod)
Util.try(function()
require(mod)
end, {
@ -134,6 +139,11 @@ function M.load(name)
end,
})
end
-- always load lazyvim, then user file
if M.defaults[name] then
_load("lazyvim.config." .. name)
end
_load("config." .. name)
if vim.bo.filetype == "lazy" then
-- HACK: LazyVim may have overwritten options of the Lazy ui, so reset this here
vim.cmd([[do VimResized]])

View File

@ -9,11 +9,23 @@ function M.check()
vim.health.report_error("Neovim >= 0.8.0 is required")
end
for _, cmd in ipairs({ "git", "rg", "fd", "lazygit" }) do
if vim.fn.executable(cmd) == 1 then
vim.health.report_ok(("`%s` is installed"):format(cmd))
for _, cmd in ipairs({ "git", "rg", { "fd", "fdfind" }, "lazygit" }) do
local name = type(cmd) == "string" and cmd or vim.inspect(cmd)
local commands = type(cmd) == "string" and { cmd } or cmd
---@cast commands string[]
local found = false
for _, c in ipairs(commands) do
if vim.fn.executable(c) == 1 then
name = c
found = true
end
end
if found then
vim.health.report_ok(("`%s` is installed"):format(name))
else
vim.health.report_warn(("`%s` is not installed"):format(cmd))
vim.health.report_warn(("`%s` is not installed"):format(name))
end
end
end

View File

@ -50,6 +50,8 @@ return {
end,
},
mapping = cmp.mapping.preset.insert({
["<C-n>"] = cmp.mapping.select_next_item({ behavior = cmp.SelectBehavior.Insert }),
["<C-p>"] = cmp.mapping.select_prev_item({ behavior = cmp.SelectBehavior.Insert }),
["<C-b>"] = cmp.mapping.scroll_docs(-4),
["<C-f>"] = cmp.mapping.scroll_docs(4),
["<C-Space>"] = cmp.mapping.complete(),
@ -173,8 +175,50 @@ return {
}
end,
config = function(_, opts)
local ai = require("mini.ai")
ai.setup(opts)
require("mini.ai").setup(opts)
-- register all text objects with which-key
if require("lazyvim.util").has("which-key.nvim") then
---@type table<string, string|table>
local i = {
[" "] = "Whitespace",
['"'] = 'Balanced "',
["'"] = "Balanced '",
["`"] = "Balanced `",
["("] = "Balanced (",
[")"] = "Balanced ) including white-space",
[">"] = "Balanced > including white-space",
["<lt>"] = "Balanced <",
["]"] = "Balanced ] including white-space",
["["] = "Balanced [",
["}"] = "Balanced } including white-space",
["{"] = "Balanced {",
["?"] = "User Prompt",
_ = "Underscore",
a = "Argument",
b = "Balanced ), ], }",
c = "Class",
f = "Function",
o = "Block, conditional, loop",
q = "Quote `, \", '",
t = "Tag",
}
local a = vim.deepcopy(i)
for k, v in pairs(a) do
a[k] = v:gsub(" including.*", "")
end
local ic = vim.deepcopy(i)
local ac = vim.deepcopy(a)
for key, name in pairs({ n = "Next", l = "Last" }) do
i[key] = vim.tbl_extend("force", { name = "Inside " .. name .. " textobject" }, ic)
a[key] = vim.tbl_extend("force", { name = "Around " .. name .. " textobject" }, ac)
end
require("which-key").register({
mode = { "o", "x" },
i = i,
a = a,
})
end
end,
},
}

View File

@ -133,6 +133,17 @@ return {
["<C-Up>"] = function(...)
return require("telescope.actions").cycle_history_prev(...)
end,
["<C-f>"] = function(...)
return require("telescope.actions").preview_scrolling_down(...)
end,
["<C-b>"] = function(...)
return require("telescope.actions").preview_scrolling_up(...)
end,
},
n = {
["q"] = function(...)
return require("telescope.actions").close(...)
end,
},
},
},
@ -150,6 +161,8 @@ return {
leap.opts[k] = v
end
leap.add_default_mappings(true)
vim.keymap.del({ "x", "o" }, "x")
vim.keymap.del({ "x", "o" }, "X")
end,
},
@ -163,7 +176,7 @@ return {
config = function(_, opts)
local wk = require("which-key")
wk.setup(opts)
wk.register({
local keymaps = {
mode = { "n", "v" },
["g"] = { name = "+goto" },
["gz"] = { name = "+surround" },
@ -177,11 +190,14 @@ return {
["<leader>gh"] = { name = "+hunks" },
["<leader>q"] = { name = "+quit/session" },
["<leader>s"] = { name = "+search" },
["<leader>sn"] = { name = "+noice" },
["<leader>u"] = { name = "+ui" },
["<leader>w"] = { name = "+windows" },
["<leader>x"] = { name = "+diagnostics/quickfix" },
})
}
if Util.has("noice.nvim") then
keymaps["<leader>sn"] = { name = "+noice" }
end
wk.register(keymaps)
end,
},

View File

@ -38,6 +38,15 @@ function M.format()
end
function M.on_attach(client, buf)
-- dont format if client disabled it
if
client.config
and client.config.capabilities
and client.config.capabilities.documentFormattingProvider == false
then
return
end
if client.supports_method("textDocument/formatting") then
vim.api.nvim_create_autocmd("BufWritePre", {
group = vim.api.nvim_create_augroup("LspFormat." .. buf, {}),

View File

@ -28,7 +28,7 @@ return {
autoformat = true,
-- options for vim.lsp.buf.format
-- `bufnr` and `filter` is handled by the LazyVim formatter,
-- but can be also overriden when specified
-- but can be also overridden when specified
format = {
formatting_options = nil,
timeout_ms = nil,
@ -37,7 +37,7 @@ return {
---@type lspconfig.options
servers = {
jsonls = {},
sumneko_lua = {
lua_ls = {
-- mason = false, -- set to false if you don't want this server to be installed with mason
settings = {
Lua = {
@ -101,6 +101,14 @@ return {
require("lspconfig")[server].setup(server_opts)
end
-- temp fix for lspconfig rename
-- https://github.com/neovim/nvim-lspconfig/pull/2439
local mappings = require("mason-lspconfig.mappings.server")
if not mappings.lspconfig_to_package.lua_ls then
mappings.lspconfig_to_package.lua_ls = "lua-language-server"
mappings.package_to_lspconfig["lua-language-server"] = "lua_ls"
end
local mlsp = require("mason-lspconfig")
local available = mlsp.get_available_servers()

View File

@ -20,6 +20,15 @@ return {
return math.floor(vim.o.columns * 0.75)
end,
},
init = function()
-- when noice is not enabled, install notify on VeryLazy
local Util = require("lazyvim.util")
if not Util.has("noice.nvim") then
Util.on_very_lazy(function()
vim.notify = require("notify")
end)
end
end,
},
-- better vim.ui

View File

@ -136,7 +136,7 @@ function M.recipes()
local header = {} ---@type string[]
local block = {} ---@type string[]
for _, line in ipairs(lines) do
local comment = line:match("^ %-%- (.*)")
local comment = line:match("^ %-%- ?(.*)")
if comment then
header[#header + 1] = comment
elseif line:find("^ {") then
@ -160,6 +160,12 @@ end
function M.update2()
local docs = vim.fs.normalize("~/projects/lazyvim.github.io/docs")
local config = Docs.extract("lua/lazyvim/config/init.lua", "\nlocal defaults = ({.-\n})")
Docs.save({
config = config,
}, docs .. "/configuration/index.md")
Docs.save({
general = M.general(),
}, docs .. "/configuration/general.md")

View File

@ -20,6 +20,16 @@ function M.has(plugin)
return require("lazy.core.config").plugins[plugin] ~= nil
end
---@param fn fun()
function M.on_very_lazy(fn)
vim.api.nvim_create_autocmd("User", {
pattern = "VeryLazy",
callback = function()
fn()
end,
})
end
---@param name string
function M.opts(name)
local plugin = require("lazy.core.config").plugins[name]
@ -72,7 +82,7 @@ function M.get_root()
end
-- this will return a function that calls telescope.
-- cwd will defautlt to lazyvim.util.get_root
-- cwd will default to lazyvim.util.get_root
-- for `files`, git_files or find_files will be chosen depending on .git
function M.telescope(builtin, opts)
local params = { builtin = builtin, opts = opts }